修改完成人物检视逻辑
This commit is contained in:
parent
885839a586
commit
ee90d20e8e
Binary file not shown.
|
|
@ -7,7 +7,7 @@ Material:
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: "\u5B89\u5168\u5E3D"
|
m_Name: "\u56FD\u7F51\u5B89\u5168\u5E3D"
|
||||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||||
m_ValidKeywords:
|
m_ValidKeywords:
|
||||||
- _SURFACE_TYPE_TRANSPARENT
|
- _SURFACE_TYPE_TRANSPARENT
|
||||||
|
|
@ -20,7 +20,7 @@ Material:
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: "\u7EB1\u5E03\u624B\u5957"
|
m_Name: "\u7EDD\u7F18\u624B\u5957"
|
||||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||||
m_ValidKeywords:
|
m_ValidKeywords:
|
||||||
- _EMISSION
|
- _EMISSION
|
||||||
|
|
@ -20,7 +20,7 @@ Material:
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: "\u5B89\u5168\u5E3D"
|
m_Name: "\u56FD\u7F51\u5B89\u5168\u5E3D"
|
||||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||||
m_ValidKeywords:
|
m_ValidKeywords:
|
||||||
- _EMISSION
|
- _EMISSION
|
||||||
|
|
@ -7,7 +7,7 @@ Material:
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: "\u7EB1\u5E03\u624B\u5957"
|
m_Name: "\u7EDD\u7F18\u624B\u5957"
|
||||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||||
m_ValidKeywords:
|
m_ValidKeywords:
|
||||||
- _EMISSION
|
- _EMISSION
|
||||||
|
|
@ -137,6 +137,8 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: ad9f843a32e8ae64589a09a12c9665b8, type: 3}
|
m_Script: {fileID: 11500000, guid: ad9f843a32e8ae64589a09a12c9665b8, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
itemInfo: []
|
||||||
|
itemCloseBtn: {fileID: 3108141478781955695}
|
||||||
--- !u!1 &1287235293540347711
|
--- !u!1 &1287235293540347711
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -626,7 +626,7 @@ PrefabInstance:
|
||||||
- target: {fileID: 8782376414673638281, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
|
- target: {fileID: 8782376414673638281, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
|
||||||
propertyPath: m_Materials.Array.data[0]
|
propertyPath: m_Materials.Array.data[0]
|
||||||
value:
|
value:
|
||||||
objectReference: {fileID: 2100000, guid: bf6b11f1a7c512745a24503e6af14f44, type: 2}
|
objectReference: {fileID: 2100000, guid: 5636cb61d4933e446ac7bf2ddecabf95, type: 2}
|
||||||
- target: {fileID: 8803340364929241480, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
|
- target: {fileID: 8803340364929241480, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
|
||||||
propertyPath: m_Layer
|
propertyPath: m_Layer
|
||||||
value: 6
|
value: 6
|
||||||
|
|
@ -654,6 +654,21 @@ Transform:
|
||||||
m_CorrespondingSourceObject: {fileID: 1584437988020157986, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
|
m_CorrespondingSourceObject: {fileID: 1584437988020157986, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
|
||||||
m_PrefabInstance: {fileID: 810725974}
|
m_PrefabInstance: {fileID: 810725974}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!4 &810725976 stripped
|
||||||
|
Transform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 4268823935262762977, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 810725974}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!4 &810725977 stripped
|
||||||
|
Transform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 2575655662766773950, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 810725974}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
--- !u!4 &810725978 stripped
|
||||||
|
Transform:
|
||||||
|
m_CorrespondingSourceObject: {fileID: 9023546900043378599, guid: 69e264891bba88c4b87f73112f0b3c84, type: 3}
|
||||||
|
m_PrefabInstance: {fileID: 810725974}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1001 &860489968
|
--- !u!1001 &860489968
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -1041,7 +1056,7 @@ PrefabInstance:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2528995886889388087, guid: c26cb815ef7c52f4790cfe113ed6566f, type: 3}
|
- target: {fileID: 2528995886889388087, guid: c26cb815ef7c52f4790cfe113ed6566f, type: 3}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: "\u5DE5\u4F5C\u670D (1)"
|
value: "\u5DE5\u4F5C\u670D"
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2528995886889388087, guid: c26cb815ef7c52f4790cfe113ed6566f, type: 3}
|
- target: {fileID: 2528995886889388087, guid: c26cb815ef7c52f4790cfe113ed6566f, type: 3}
|
||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
|
|
@ -1452,10 +1467,9 @@ MonoBehaviour:
|
||||||
- {fileID: 4762243372118872815}
|
- {fileID: 4762243372118872815}
|
||||||
- {fileID: 1943116163}
|
- {fileID: 1943116163}
|
||||||
- {fileID: 1510720948}
|
- {fileID: 1510720948}
|
||||||
headSlot: {fileID: 0}
|
headSlot: {fileID: 810725978}
|
||||||
bodySlot: {fileID: 0}
|
bodySlot: {fileID: 810725977}
|
||||||
HandSlot: {fileID: 0}
|
HandSlot: {fileID: 810725976}
|
||||||
isChange: 0
|
|
||||||
--- !u!1 &2090806849
|
--- !u!1 &2090806849
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class TooRoomlMannger : MonoBehaviour
|
public class TooRoomlMannger : SingletonMono<TooRoomlMannger>
|
||||||
{
|
{
|
||||||
public BaseToolOrDevice[] allTMDs;
|
public BaseToolOrDevice[] allTMDs;
|
||||||
public Transform headSlot;
|
public Transform headSlot;
|
||||||
|
|
@ -11,7 +12,6 @@ public class TooRoomlMannger : MonoBehaviour
|
||||||
public Transform HandSlot;
|
public Transform HandSlot;
|
||||||
private List<Material> _cancel; //帤援渴第窐ヶ
|
private List<Material> _cancel; //帤援渴第窐ヶ
|
||||||
private List<Material> _wear; //援渴第窐ヶ
|
private List<Material> _wear; //援渴第窐ヶ
|
||||||
public bool isChange = false;
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
|
@ -25,9 +25,11 @@ public class TooRoomlMannger : MonoBehaviour
|
||||||
tmd.GetInfo();
|
tmd.GetInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Wear(string equipName)
|
|
||||||
|
|
||||||
|
|
||||||
|
public void Wear(string equipName,bool isChange)
|
||||||
{
|
{
|
||||||
isChange = !isChange;
|
|
||||||
Material ma = null;
|
Material ma = null;
|
||||||
if (isChange)
|
if (isChange)
|
||||||
{
|
{
|
||||||
|
|
@ -40,15 +42,18 @@ public class TooRoomlMannger : MonoBehaviour
|
||||||
|
|
||||||
switch (equipName)
|
switch (equipName)
|
||||||
{
|
{
|
||||||
case "安全帽":
|
case "国网安全帽":
|
||||||
headSlot.GetComponent<SkinnedMeshRenderer>().material = ma;
|
headSlot.GetComponent<SkinnedMeshRenderer>().material = ma;
|
||||||
break;
|
break;
|
||||||
case "馱釬督":
|
case "馱釬督":
|
||||||
bodySlot.GetComponent<SkinnedMeshRenderer>().material = ma;
|
bodySlot.GetComponent<SkinnedMeshRenderer>().material = ma;
|
||||||
break;
|
break;
|
||||||
case "纱布手套":
|
case "绝缘手套":
|
||||||
HandSlot.GetComponent<SkinnedMeshRenderer>().material = ma;
|
HandSlot.GetComponent<SkinnedMeshRenderer>().material = ma;
|
||||||
break;
|
break;
|
||||||
|
case "绝缘靴":
|
||||||
|
Debug.Log("靴子");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,10 @@ public class MirrorController : PermanentTriggerBase
|
||||||
protected override void OnMDown()
|
protected override void OnMDown()
|
||||||
{
|
{
|
||||||
base.OnMDown();
|
base.OnMDown();
|
||||||
GameManager.UIMgr.ShowPanel<UI_CheckMyselfPanel>(E_UI_Layer.Mid, (p) =>
|
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerID, true) == 0)
|
||||||
{
|
{
|
||||||
|
GameManager.UIMgr.ShowPanel<UI_CheckMyselfPanel>(E_UI_Layer.Mid);
|
||||||
});
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
|
|
@ -11,7 +12,7 @@ public class UI_CheckMyselfItem : BaseItem
|
||||||
public void Init(ItemInfo _itemInfo)
|
public void Init(ItemInfo _itemInfo)
|
||||||
{
|
{
|
||||||
itemInfo = _itemInfo;
|
itemInfo = _itemInfo;
|
||||||
if(PacksackBagMgr.Instance.wearDic.ContainsKey(itemInfo.toolId))
|
if (PacksackBagMgr.Instance.wearDic.ContainsKey(itemInfo.toolId))
|
||||||
{
|
{
|
||||||
isOn = true;
|
isOn = true;
|
||||||
tips.text = isOn ? "ÒÑ×°Åä" : "";
|
tips.text = isOn ? "ÒÑ×°Åä" : "";
|
||||||
|
|
@ -24,9 +25,13 @@ public class UI_CheckMyselfItem : BaseItem
|
||||||
switch (btnName)
|
switch (btnName)
|
||||||
{
|
{
|
||||||
case "IconBtn":
|
case "IconBtn":
|
||||||
isOn = !isOn;
|
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(itemInfo.triggerID, true) == 0)
|
||||||
tips.text = isOn ? "ÒÑ×°Åä" : "";
|
{
|
||||||
PacksackBagMgr.Instance.WearItemState(itemInfo, isOn);
|
isOn = !isOn;
|
||||||
|
tips.text = isOn ? "ÒÑ×°Åä" : "";
|
||||||
|
PacksackBagMgr.Instance.WearItemState(itemInfo, isOn);
|
||||||
|
TooRoomlMannger.Instance.Wear(itemInfo.toolName, isOn);
|
||||||
|
}
|
||||||
Debug.Log("IconBtn");
|
Debug.Log("IconBtn");
|
||||||
break;
|
break;
|
||||||
case "UI_CheckMyselfItem":
|
case "UI_CheckMyselfItem":
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,18 @@ using System.Collections.Generic;
|
||||||
using Sirenix.OdinInspector;
|
using Sirenix.OdinInspector;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class UI_ToolOrMaterialsOrDeviceItem : BaseItem
|
public class UI_ToolOrMaterialsOrDeviceItem : BaseItem
|
||||||
{
|
{
|
||||||
public List<ItemInfo> itemInfo;
|
public List<ItemInfo> itemInfo;
|
||||||
|
public Button itemCloseBtn;
|
||||||
public void Init(List<ItemInfo> _itemInfo)
|
public void Init(List<ItemInfo> _itemInfo)
|
||||||
{
|
{
|
||||||
|
if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
|
||||||
|
{
|
||||||
|
itemCloseBtn.gameObject.SetActive(false);
|
||||||
|
}
|
||||||
GetControl<TextMeshProUGUI>("CountText").text = _itemInfo.Count.ToString();
|
GetControl<TextMeshProUGUI>("CountText").text = _itemInfo.Count.ToString();
|
||||||
itemInfo = _itemInfo;
|
itemInfo = _itemInfo;
|
||||||
}
|
}
|
||||||
|
|
@ -20,24 +25,20 @@ public class UI_ToolOrMaterialsOrDeviceItem : BaseItem
|
||||||
switch (btnName)
|
switch (btnName)
|
||||||
{
|
{
|
||||||
case "ItemCloseBtn":
|
case "ItemCloseBtn":
|
||||||
if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
|
int counts = 0; ;
|
||||||
|
if (itemInfo.Count > 1)
|
||||||
{
|
{
|
||||||
int counts = 0; ;
|
counts = itemInfo.Count - 1;
|
||||||
if (itemInfo.Count > 1)
|
|
||||||
{
|
|
||||||
counts = itemInfo.Count - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
GameObject obj = Instantiate(itemInfo[counts].objPrefab);
|
|
||||||
obj.transform.position = itemInfo[counts].selfPosInToolRoom;
|
|
||||||
obj.name = itemInfo[counts].toolName;
|
|
||||||
obj.GetComponent<Tool_SelectComponent>().itemInfo = itemInfo[counts];
|
|
||||||
GameManager.PacksackBagMgr.RemoveOneToolOrMater(itemInfo[counts]);
|
|
||||||
itemInfo.Remove(itemInfo[counts]);
|
|
||||||
GetControl<TextMeshProUGUI>("CountText").text = itemInfo.Count.ToString();
|
|
||||||
if (itemInfo.Count == 0)
|
|
||||||
Destroy(gameObject);
|
|
||||||
}
|
}
|
||||||
|
GameObject obj = Instantiate(itemInfo[counts].objPrefab);
|
||||||
|
obj.transform.position = itemInfo[counts].selfPosInToolRoom;
|
||||||
|
obj.name = itemInfo[counts].toolName;
|
||||||
|
obj.GetComponent<Tool_SelectComponent>().itemInfo = itemInfo[counts];
|
||||||
|
GameManager.PacksackBagMgr.RemoveOneToolOrMater(itemInfo[counts]);
|
||||||
|
itemInfo.Remove(itemInfo[counts]);
|
||||||
|
GetControl<TextMeshProUGUI>("CountText").text = itemInfo.Count.ToString();
|
||||||
|
if (itemInfo.Count == 0)
|
||||||
|
Destroy(gameObject);
|
||||||
break;
|
break;
|
||||||
case "UI_ToolOrMaterialsOrDeviceItem":
|
case "UI_ToolOrMaterialsOrDeviceItem":
|
||||||
Debug.Log("ICon");
|
Debug.Log("ICon");
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,6 @@ public class SingletonMono<T> : MonoBehaviour where T : MonoBehaviour
|
||||||
instance = this as T;
|
instance = this as T;
|
||||||
//我们挂载继承该单例模式基类的脚本后 依附的对象过场景时就不会被移除了
|
//我们挂载继承该单例模式基类的脚本后 依附的对象过场景时就不会被移除了
|
||||||
//就可以保证在游戏的整个生命周期中都存在
|
//就可以保证在游戏的整个生命周期中都存在
|
||||||
DontDestroyOnLoad(instance.gameObject);
|
//DontDestroyOnLoad(instance.gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,17 @@ public class EventCenter : BaseManager<EventCenter>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 触发有参事件
|
||||||
|
/// </summary>
|
||||||
|
public void EventTrigger<T,D>(string eventName, T info)
|
||||||
|
{
|
||||||
|
if (eventDic.ContainsKey(eventName))
|
||||||
|
{
|
||||||
|
(eventDic[eventName] as EventInfo<T>).actions?.Invoke(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 清空所有事件监听
|
/// 清空所有事件监听
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue