This commit is contained in:
parent
7c45a376ce
commit
2a27c3bf7a
File diff suppressed because one or more lines are too long
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 9ea913af302bbdf42a9f003451c70e02
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 11400000
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Binary file not shown.
|
@ -1,21 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 4eae2d3f036a9f34e8b72ef95695be9d
|
|
||||||
TrueTypeFontImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 4
|
|
||||||
fontSize: 16
|
|
||||||
forceTextureCase: -2
|
|
||||||
characterSpacing: 0
|
|
||||||
characterPadding: 1
|
|
||||||
includeFontData: 1
|
|
||||||
fontNames:
|
|
||||||
- Alimama ShuHeiTi
|
|
||||||
fallbackFontReferences: []
|
|
||||||
customCharacters:
|
|
||||||
fontRenderingMode: 0
|
|
||||||
ascentCalculationMode: 1
|
|
||||||
useLegacyBoundsCalculation: 0
|
|
||||||
shouldRoundAdvanceValue: 1
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
File diff suppressed because one or more lines are too long
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: f8ef5cb2ab4d4da4093d3fe60f978c99
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 11400000
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Binary file not shown.
|
@ -1,21 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 60b5d8dde4f509a4185ee4a54a236416
|
|
||||||
TrueTypeFontImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 4
|
|
||||||
fontSize: 16
|
|
||||||
forceTextureCase: -2
|
|
||||||
characterSpacing: 0
|
|
||||||
characterPadding: 1
|
|
||||||
includeFontData: 1
|
|
||||||
fontNames:
|
|
||||||
- Source Han Sans CN
|
|
||||||
fallbackFontReferences: []
|
|
||||||
customCharacters:
|
|
||||||
fontRenderingMode: 0
|
|
||||||
ascentCalculationMode: 1
|
|
||||||
useLegacyBoundsCalculation: 0
|
|
||||||
shouldRoundAdvanceValue: 1
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
File diff suppressed because one or more lines are too long
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 1c4004df1d65ff944b6e23e3af757df7
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 11400000
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Binary file not shown.
|
@ -1,21 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 8af3ad854ddf42d4bad8563aff10a985
|
|
||||||
TrueTypeFontImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 4
|
|
||||||
fontSize: 16
|
|
||||||
forceTextureCase: -2
|
|
||||||
characterSpacing: 0
|
|
||||||
characterPadding: 1
|
|
||||||
includeFontData: 1
|
|
||||||
fontNames:
|
|
||||||
- Source Han Sans CN
|
|
||||||
fallbackFontReferences: []
|
|
||||||
customCharacters:
|
|
||||||
fontRenderingMode: 0
|
|
||||||
ascentCalculationMode: 1
|
|
||||||
useLegacyBoundsCalculation: 0
|
|
||||||
shouldRoundAdvanceValue: 1
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
File diff suppressed because one or more lines are too long
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: f23cde0c3d86dad49bedc202ad993d21
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 11400000
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
Binary file not shown.
|
@ -1,21 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 21e520e9f4216d64e86ecdad0d82df46
|
|
||||||
TrueTypeFontImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 4
|
|
||||||
fontSize: 16
|
|
||||||
forceTextureCase: -2
|
|
||||||
characterSpacing: 0
|
|
||||||
characterPadding: 1
|
|
||||||
includeFontData: 1
|
|
||||||
fontNames:
|
|
||||||
- Source Han Sans CN
|
|
||||||
fallbackFontReferences: []
|
|
||||||
customCharacters:
|
|
||||||
fontRenderingMode: 0
|
|
||||||
ascentCalculationMode: 1
|
|
||||||
useLegacyBoundsCalculation: 0
|
|
||||||
shouldRoundAdvanceValue: 1
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 79e309f1e0c36e849a1766c6c66545ed
|
|
||||||
TextScriptImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
|
@ -144,11 +144,11 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
||||||
propertyPath: m_LocalPosition.x
|
propertyPath: m_LocalPosition.x
|
||||||
value: -1.134
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
||||||
propertyPath: m_LocalPosition.y
|
propertyPath: m_LocalPosition.y
|
||||||
value: 1.24
|
value: 1.5
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
||||||
propertyPath: m_LocalPosition.z
|
propertyPath: m_LocalPosition.z
|
||||||
|
@ -156,7 +156,7 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
||||||
propertyPath: m_LocalRotation.w
|
propertyPath: m_LocalRotation.w
|
||||||
value: 1
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
||||||
propertyPath: m_LocalRotation.x
|
propertyPath: m_LocalRotation.x
|
||||||
|
@ -164,7 +164,7 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
||||||
propertyPath: m_LocalRotation.y
|
propertyPath: m_LocalRotation.y
|
||||||
value: 0
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
||||||
propertyPath: m_LocalRotation.z
|
propertyPath: m_LocalRotation.z
|
||||||
|
@ -176,7 +176,7 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
value: 0
|
value: 180
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
- target: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
|
@ -6201,6 +6201,10 @@ PrefabInstance:
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 2557768358979172441, guid: f8a9676618f065446b3926269089375e, type: 3}
|
||||||
|
propertyPath: toolId
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2557768358979172441, guid: f8a9676618f065446b3926269089375e, type: 3}
|
- target: {fileID: 2557768358979172441, guid: f8a9676618f065446b3926269089375e, type: 3}
|
||||||
propertyPath: _highlight
|
propertyPath: _highlight
|
||||||
value:
|
value:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using HighlightPlus;
|
using HighlightPlus;
|
||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
|
@ -11,27 +12,97 @@ using UnityEngine.EventSystems;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class BaseToolOrDevice : MonoBehaviour
|
public abstract class BaseToolOrDevice : MonoBehaviour
|
||||||
{
|
{
|
||||||
/// <summary>
|
//public struct ItemInfo
|
||||||
/// 工具Id
|
//{
|
||||||
/// </summary>
|
// public int toolId;
|
||||||
|
// public string toolName;
|
||||||
|
// public E_ToolOrDeviceOrMaterials toolOrDeviceOrMaterial;
|
||||||
|
//}
|
||||||
|
public class ItemInfo
|
||||||
|
{
|
||||||
public int toolId;
|
public int toolId;
|
||||||
public string toolName;
|
public string toolName;
|
||||||
/// <summary>
|
|
||||||
/// 工器具类型 工具/材质/设备
|
|
||||||
/// </summary>
|
|
||||||
public E_ToolOrDeviceOrMaterials toolOrDeviceOrMaterial;
|
public E_ToolOrDeviceOrMaterials toolOrDeviceOrMaterial;
|
||||||
|
public ItemInfo(int id, string Name, E_ToolOrDeviceOrMaterials itemType)
|
||||||
|
{
|
||||||
|
toolId = id;
|
||||||
|
toolName = Name;
|
||||||
|
toolOrDeviceOrMaterial = itemType;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 你可以在这里添加更多的属性和方法
|
||||||
|
}
|
||||||
|
///// <summary>
|
||||||
|
///// 工具Id
|
||||||
|
///// </summary>
|
||||||
|
//public int toolId;
|
||||||
|
//public string toolName;
|
||||||
|
///// <summary>
|
||||||
|
///// 工器具类型 工具/材质/设备
|
||||||
|
///// </summary>
|
||||||
|
//public E_ToolOrDeviceOrMaterials toolOrDeviceOrMaterial;
|
||||||
public HighlightEffect _highlight;
|
public HighlightEffect _highlight;
|
||||||
public bool IsClick = true;
|
public bool IsClick = true;
|
||||||
|
private SomeOtherClass otherClass = new SomeOtherClass();
|
||||||
|
|
||||||
|
private Dictionary<string, ItemInfo> itemDatabase = new Dictionary<string, ItemInfo>();
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
_highlight = GetComponent<HighlightEffect>();
|
_highlight = GetComponent<HighlightEffect>();
|
||||||
|
//itemDatabase.Add("Screwdriver", new ItemInfo { toolId = 2, toolName = "螺丝刀", toolOrDeviceOrMaterial = E_ToolOrDeviceOrMaterials.Tool });
|
||||||
}
|
}
|
||||||
|
|
||||||
[ContextMenu("GetInfo")]
|
public class SomeOtherClass
|
||||||
public void GetInfo()
|
|
||||||
{
|
{
|
||||||
//TODO:后续 根据英文名称去获取ID 中文名 和其它
|
public void ProcessItemInfo(ItemInfo itemInfo)
|
||||||
|
{
|
||||||
|
Debug.Log($"处理物品: ID={itemInfo.toolId}, 中文名={itemInfo.toolName}, 类型={itemInfo.toolOrDeviceOrMaterial}");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
[ContextMenu("GetInfo")]
|
||||||
|
public void GetInfo(string itemName)
|
||||||
|
{
|
||||||
|
if (itemDatabase.ContainsKey(itemName))
|
||||||
|
{
|
||||||
|
ItemInfo info = itemDatabase[itemName];
|
||||||
|
otherClass.ProcessItemInfo(info); // 设置ItemInfo对象
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//public void GetInfo(string itemName)
|
||||||
|
//{
|
||||||
|
// if (itemDatabase.ContainsKey(itemName))
|
||||||
|
// {
|
||||||
|
// ItemInfo info = itemDatabase[itemName];
|
||||||
|
// OnItemInfoReceived?.Invoke(info);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//public void GetInfo(GameObject Item,string ItemName,E_ToolOrDeviceOrMaterials E_Item)
|
||||||
|
//{
|
||||||
|
|
||||||
|
// Item.SetActive(false);
|
||||||
|
// if (itemDatabase.ContainsKey(ItemName))
|
||||||
|
// {
|
||||||
|
// // 获取物品信息
|
||||||
|
// ItemInfo info = itemDatabase[ItemName];
|
||||||
|
// // TODO: 后续处理,例如更新UI或执行其他逻辑
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// Debug.LogWarning($"物品 '{ItemName}' 不存在于数据库中");
|
||||||
|
// }
|
||||||
|
// switch (E_Item)
|
||||||
|
// {
|
||||||
|
// case E_ToolOrDeviceOrMaterials.Tool:
|
||||||
|
|
||||||
|
// break;
|
||||||
|
// case E_ToolOrDeviceOrMaterials.Materials:
|
||||||
|
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// //TODO:后续 根据英文名称去获取ID 中文名 和其它
|
||||||
|
//}
|
||||||
|
|
||||||
private void OnMouseEnter()
|
private void OnMouseEnter()
|
||||||
{
|
{
|
||||||
|
@ -52,7 +123,7 @@ public abstract class BaseToolOrDevice : MonoBehaviour
|
||||||
if (GameManager.RunModelMgr.SceneType!= E_SceneType.ToolRoom) return;
|
if (GameManager.RunModelMgr.SceneType!= E_SceneType.ToolRoom) return;
|
||||||
if (EventSystem.current.IsPointerOverGameObject()) return;
|
if (EventSystem.current.IsPointerOverGameObject()) return;
|
||||||
OnDown();
|
OnDown();
|
||||||
gameObject.SetActive(false);
|
//gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnMouseExit()
|
private void OnMouseExit()
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class Tool_SelectComponent : BaseToolOrDevice
|
||||||
if (IsClick)
|
if (IsClick)
|
||||||
{
|
{
|
||||||
//묏야츰냔뵨묏야렴흙묏야움
|
//묏야츰냔뵨묏야렴흙묏야움
|
||||||
GameManager.PacksackBagMgr.AddOneToolOrMater(gameObject.name);
|
GameManager.PacksackBagMgr.AddOneToolOrMater(this.gameObject.name);
|
||||||
this.gameObject.SetActive(false);
|
this.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue