9001
This commit is contained in:
parent
250b113e08
commit
1b5ad67dcb
|
@ -11,6 +11,8 @@ using UnityEngine;
|
|||
/// </summary>
|
||||
public class Device_Control_9001 : Device_Control
|
||||
{
|
||||
public static Device_Control_9001 instance;
|
||||
|
||||
/// <summary>
|
||||
/// 当前机柜中安装的三相四线电能表
|
||||
/// </summary>
|
||||
|
@ -88,7 +90,7 @@ public class Device_Control_9001 : Device_Control
|
|||
ewmOK = false;
|
||||
isSMOK = false;
|
||||
|
||||
|
||||
instance = this;
|
||||
|
||||
//设置控制脚本
|
||||
StepStateControl.instance?.SetDeviceControl(9001,this);
|
||||
|
|
|
@ -43,7 +43,8 @@ public class StepState_9001 : StepState
|
|||
//办公室场景首个步骤
|
||||
//查看任务单
|
||||
//OfficeManager.Instance.mobileController.downIndex = 0;
|
||||
PacksackBagMgr.Instance.ClearAllData();
|
||||
TooRoomMannger.Instance.CreateTool();
|
||||
PacksackBagMgr.Instance.ClearAllToolAndDiveceAndMaterial();
|
||||
TooRoomMannger.Instance.CheckWearByWearDic();
|
||||
//MobileAttach10007_7002.index = 0;
|
||||
Score_9001.cdzIndex = 0;
|
||||
|
|
|
@ -14,8 +14,9 @@ public class Tool_EWM : Tool_Base
|
|||
if (Physics.Raycast(tmpray, out RaycastHit hit))
|
||||
{
|
||||
Door ts = hit.transform.GetComponent<Door>();
|
||||
if (ts != null)
|
||||
if (ts != null && !Device_Control_9001.instance.ewmh.activeInHierarchy)
|
||||
{
|
||||
Device_Control_9001.EWM_OBJ = Device_Control_9001.instance.ewm;
|
||||
Device_Control_9001.EWM_OBJ.SetActive(true);
|
||||
Device_Control_9001.ewmOK = true;
|
||||
}
|
||||
|
|
|
@ -179,6 +179,31 @@ public class TooRoomMannger : SingletonMono<TooRoomMannger>
|
|||
// GameManager.EventMgr.RemoveEventListener<bool>(Enum_EventType.PlayerCanMove, SwitchFirstPersonControllerMove);
|
||||
//}
|
||||
|
||||
public void CreateTool()
|
||||
{
|
||||
var bagDatas = GameManager.PacksackBagMgr.GetCurrentBagData();
|
||||
var wearDate = GameManager.PacksackBagMgr.wearDic;
|
||||
foreach (var item in bagDatas.Keys)
|
||||
{
|
||||
List<ItemInfo> temp = bagDatas[item];
|
||||
for (int j = 0; j < temp.Count; j++)
|
||||
{
|
||||
int indexJ = j;
|
||||
if (temp[indexJ].selfPosInToolRoom != Vector3.zero)
|
||||
{
|
||||
GameObject obj = Instantiate(temp[indexJ].objPrefab, toolParent);
|
||||
obj.name = temp[indexJ].toolName;
|
||||
obj.transform.position = temp[indexJ].selfPosInToolRoom;
|
||||
obj.transform.eulerAngles = temp[indexJ].selfAngleInToolRoom;
|
||||
obj.GetComponent<Tool_SelectComponent>().itemInfo = temp[indexJ];
|
||||
obj.GetComponent<Tool_SelectComponent>().GetInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
allTMDs.Clear();
|
||||
allTMDs = toolParent.GetComponentsInChildren<BaseToolOrDevice>(true).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -18,6 +18,8 @@ public class ItemInfo
|
|||
public E_ToolOrDeviceOrMaterials toolOrDeviceOrMaterial;
|
||||
public GameObject objPrefab;
|
||||
public Vector3 selfPosInToolRoom;
|
||||
public Vector3 selfAngleInToolRoom;
|
||||
public int index;
|
||||
}
|
||||
/// <summary>
|
||||
/// 工具或者材料基类,此脚本必须挂在工具或者材料上
|
||||
|
@ -30,6 +32,13 @@ public abstract class BaseToolOrDevice : MonoBehaviour
|
|||
public Tween tween;
|
||||
private void Awake()
|
||||
{
|
||||
//此脚本仅工具间有用
|
||||
if (GameManager.RunModelMgr.SceneType != E_SceneType.ToolRoom)
|
||||
{
|
||||
Destroy(this);
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetComponent<HighlightEffect>())
|
||||
{
|
||||
_highlight = GetComponent<HighlightEffect>();
|
||||
|
@ -72,13 +81,13 @@ public abstract class BaseToolOrDevice : MonoBehaviour
|
|||
itemInfo.toolOrDeviceOrMaterial = (E_ToolOrDeviceOrMaterials)dTMD.type;
|
||||
gameObject.SetActive(true);
|
||||
itemInfo.objPrefab = Resources.Load<GameObject>("Prefabs/Objects/Tools/" + gameObject.name);
|
||||
Debug.Log("生成");
|
||||
itemInfo.selfPosInToolRoom = transform.position;
|
||||
itemInfo.selfAngleInToolRoom = transform.eulerAngles;
|
||||
}
|
||||
else
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// gameObject.SetActive(false);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue