This commit is contained in:
陈向学 2024-08-23 14:48:56 +08:00
commit 533935d475
4 changed files with 48 additions and 4 deletions

View File

@ -3591,6 +3591,11 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
--- !u!4 &1501092962 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2399593117452945566, guid: 86a8666f9623b6b46b8f4b860a11546f, type: 3}
m_PrefabInstance: {fileID: 1501092961}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1566240508 stripped --- !u!114 &1566240508 stripped
MonoBehaviour: MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 2576541079921355267, guid: 10f4454f32eb20e4298912d896f6020e, type: 3} m_CorrespondingSourceObject: {fileID: 2576541079921355267, guid: 10f4454f32eb20e4298912d896f6020e, type: 3}
@ -4193,6 +4198,37 @@ MonoBehaviour:
hitFxFadeOutDuration: 0.25 hitFxFadeOutDuration: 0.25
hitFxColor: {r: 1, g: 1, b: 1, a: 1} hitFxColor: {r: 1, g: 1, b: 1, a: 1}
hitFxRadius: 0.5 hitFxRadius: 0.5
--- !u!1 &1927580342
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1927580343}
m_Layer: 0
m_Name: ToolPos
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1927580343
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1927580342}
m_LocalRotation: {x: -0.0000000745058, y: 0.000000029802319, z: 0.26736447, w: 0.9635955}
m_LocalPosition: {x: 0.224, y: 0.648, z: 0.474}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1501092962}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1968113507 stripped --- !u!1 &1968113507 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: -7138000903914520420, guid: 92b1a298e95fb664cb2aa2aff35920e0, type: 3} m_CorrespondingSourceObject: {fileID: -7138000903914520420, guid: 92b1a298e95fb664cb2aa2aff35920e0, type: 3}

View File

@ -7,6 +7,7 @@ public class LiveSceneManager : SingletonMono<LiveSceneManager>
[HideInInspector] [HideInInspector]
public FirstPersonController firstPersonController; public FirstPersonController firstPersonController;
public GameObject currentTool; public GameObject currentTool;
protected override void Awake() protected override void Awake()
{ {
base.Awake(); base.Awake();

View File

@ -7,7 +7,6 @@ using UnityEngine;
/// </summary> /// </summary>
public class PacksackBagMgr : BaseManager<PacksackBagMgr> public class PacksackBagMgr : BaseManager<PacksackBagMgr>
{ {
//包里用了哪些工器具
private readonly Dictionary<int, List<ItemInfo>> toolAndMaterialDic = new Dictionary<int, List<ItemInfo>>(); private readonly Dictionary<int, List<ItemInfo>> toolAndMaterialDic = new Dictionary<int, List<ItemInfo>>();
public Dictionary<int, ItemInfo> wearDic = new Dictionary<int, ItemInfo>(); public Dictionary<int, ItemInfo> wearDic = new Dictionary<int, ItemInfo>();
@ -94,6 +93,14 @@ public class PacksackBagMgr : BaseManager<PacksackBagMgr>
} }
} }
/// <summary>
/// 移除全部工具 设备 材料
/// </summary>
public void ClearAllToolAndDiveceAndMaterial()
{
toolAndMaterialDic.Clear();
}
/// <summary> /// <summary>
/// 添加 穿戴 状态 0 去掉 1 穿上 /// 添加 穿戴 状态 0 去掉 1 穿上
/// </summary> /// </summary>

View File

@ -54,10 +54,10 @@ public class UI_ToolOrMaterialsOrDeviceItem : BaseItem
currentTool.GetComponent<BaseToolOrDevice>().enabled = false; currentTool.GetComponent<BaseToolOrDevice>().enabled = false;
currentTool.GetComponent<Collider>().enabled = false; currentTool.GetComponent<Collider>().enabled = false;
currentTool.name = currentItem.toolName; currentTool.name = currentItem.toolName;
Vector3 pos = Camera.main.transform.position + Camera.main.transform.forward * 0.3f; Vector3 pos = Camera.main.transform.position + Camera.main.transform.forward * 0.8f;
currentTool.transform.parent = LiveSceneManager.Instance.firstPersonController.transform; currentTool.transform.parent = LiveSceneManager.Instance.firstPersonController.transform;
currentTool.transform.position = new Vector3(pos.x + 0.2f, pos.y - 0.14f, pos.z + 0.1f); currentTool.transform.localPosition = new Vector3(pos.x + 0.375f, pos.y - 0.22f, pos.z - 0.1f);
currentTool.transform.eulerAngles = LiveSceneManager.Instance.firstPersonController.transform.eulerAngles; currentTool.transform.localEulerAngles = LiveSceneManager.Instance.firstPersonController.transform.eulerAngles;
break; break;
} }
} }