This commit is contained in:
taosuqi 2024-08-30 09:09:58 +08:00
commit 517e0b1899
18 changed files with 252 additions and 133 deletions

View File

@ -67,7 +67,7 @@ TextureImporter:
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
maxTextureSize: 64
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1

View File

@ -13,6 +13,10 @@ public class Device_Base : PermanentTriggerBase
/// trigger触发事件
/// </summary>
public Func<string, bool, int> triggerAction;
/// <summary>
/// 是否正在移动
/// </summary>
public bool isMoving;
private Vector3 head_LocalPos;
private Vector3 head_LocalEulerAnglesl;
@ -55,6 +59,15 @@ public class Device_Base : PermanentTriggerBase
this.triggerAction = action;
}
public void AddStartAction(Action callback)
{
startAction += callback;
}
public void AddEndAction(Action callback)
{
endAction += callback;
}
/// <summary>
/// 设置工具回到手中的位置
/// </summary>

View File

@ -184,11 +184,13 @@ public class Device_3Phase4WireMeter : Device_Base
//拆下电能表
if (!fix_screw_left.isInstall && !fix_screw_right.isInstall)
{
startAction?.Invoke();
SiteManager.instance.measuringCabinet.meteringDevice = null;
Debug.Log("电能表已拆除");
transform.DOLocalMove(transform.localPosition - new Vector3(0, 0.2f, 0.2f), 2).OnComplete(() =>
{
CallScoreAction(false);
endAction?.Invoke();
gameObject.SetActive(false);
});
}
@ -203,6 +205,7 @@ public class Device_3Phase4WireMeter : Device_Base
SiteManager.instance.measuringCabinet.meteringDevice = this;
//默认是拆除的状态
Init(false);
startAction?.Invoke();
transform.DOLocalMove(new Vector3(0.1469002f, -0.1793365f, 0.5191498f), 2).OnStart(() =>
{
transform.localEulerAngles = Vector3.zero;
@ -211,6 +214,7 @@ public class Device_3Phase4WireMeter : Device_Base
LiveSceneManager.Instance.currentTool = null;
Debug.Log("电能表已安装");
CallScoreAction(true);
endAction?.Invoke();
});
}
}

View File

@ -31,20 +31,24 @@ public class Device_Cover : Device_Base
protected override void OnMDown()
{
base.OnMDown();
if ((triggerAction == null ? 0 : triggerAction.Invoke(triggerName, false)) == 0)
if (!isMoving)
{
isCheckOK = true;
if ((triggerAction == null ? 0 : triggerAction.Invoke(triggerName, false)) == 0)
{
isCheckOK = true;
if (!isOpen)
{
if (!cover_screw_Left.isInstall && !cover_screw_Right.isInstall)
if (!isOpen)
{
Open();
//螺丝都拧松才能拆盖子
if (!cover_screw_Left.isInstall && !cover_screw_Right.isInstall)
{
Open();
}
}
else
{
Close();
}
}
else if (isOpen)
{
Close();
}
}
}
@ -54,18 +58,26 @@ public class Device_Cover : Device_Base
/// </summary>
public void Open()
{
Debug.Log("´ò¿ª¸Ç×Ó");
isOpen = true;
//盖子螺丝不在动才能动盖子
if (!cover_screw_Left.isMoving && !cover_screw_Right.isMoving)
{
isMoving = true;
Debug.Log("打开盖子");
startAction?.Invoke();
Transform parent = cover_screw_Left.transform.parent;
cover_screw_Left.transform.parent = transform;
cover_screw_Right.transform.parent = transform;
transform.DOLocalMove(new Vector3(transform.localPosition.x, -0.1388763f, -0.2485413f), 2).OnComplete(() =>
{
isOpen = true;
cover_screw_Left.transform.parent = parent;
cover_screw_Right.transform.parent = parent;
isMoving = false;
Transform parent = cover_screw_Left.transform.parent;
cover_screw_Left.transform.parent = transform;
cover_screw_Right.transform.parent = transform;
transform.DOLocalMove(new Vector3(transform.localPosition.x, -0.1388763f, -0.2485413f), 2).OnComplete(() =>
{
cover_screw_Left.transform.parent = parent;
cover_screw_Right.transform.parent = parent;
int result = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true));
});
int result = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true));
endAction?.Invoke();
});
}
}
/// <summary>
@ -73,17 +85,25 @@ public class Device_Cover : Device_Base
/// </summary>
public void Close()
{
Debug.Log("¸ÇÉϸÇ×Ó");
isOpen = false;
//盖子螺丝不在动才能动盖子
if (!cover_screw_Left.isMoving && !cover_screw_Right.isMoving)
{
isMoving=true;
Debug.Log("盖上盖子");
startAction?.Invoke();
Transform parent = cover_screw_Left.transform.parent;
cover_screw_Left.transform.parent = transform;
cover_screw_Right.transform.parent = transform;
transform.DOLocalMove(new Vector3(transform.localPosition.x, 0.01112366f, -0.09854126f), 2).OnComplete(() =>
{
isOpen = false;
cover_screw_Left.transform.parent = parent;
cover_screw_Right.transform.parent = parent;
isMoving = false;
Transform parent = cover_screw_Left.transform.parent;
cover_screw_Left.transform.parent = transform;
cover_screw_Right.transform.parent = transform;
transform.DOLocalMove(new Vector3(transform.localPosition.x, 0.01112366f, -0.09854126f), 2).OnComplete(() =>
{
cover_screw_Left.transform.parent = parent;
cover_screw_Right.transform.parent = parent;
int result = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true));
});
int result = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true));
endAction?.Invoke();
});
}
}
}

View File

@ -34,6 +34,7 @@ public class Device_NamePlate : Device_Base
GameObject tip = Instantiate<GameObject>(checkUiPrefb, GameManager.UIMgr.canvas.transform);
ProcessTipPanel processTipPanel = tip.GetComponent<ProcessTipPanel>();
startAction?.Invoke();
//¿ªÊ¼×ß½ø¶È
processTipPanel.StartProcess(result =>
{
@ -49,6 +50,7 @@ public class Device_NamePlate : Device_Base
}
int state = (triggerAction == null ? 0 : triggerAction.Invoke(triggerName, true));
CallScoreAction();
endAction?.Invoke();
}
});
}

View File

@ -23,6 +23,7 @@ public class Device_CabinetDoor : Device_Base
public void Open()
{
Debug.Log("开门");
startAction?.Invoke();
//开锁
transform.Find("计量柜锁2/计量柜锁3").DOLocalRotate(new Vector3(-45f, 0, 0), 1).OnComplete(() =>
{
@ -30,12 +31,14 @@ public class Device_CabinetDoor : Device_Base
transform.DOLocalRotate(new Vector3(0, 0, 180), 3).OnComplete(() =>
{
isOpen = true;
endAction?.Invoke();
});
});
}
public void Close()
{
Debug.Log("关门");
startAction?.Invoke();
//关门
transform.DOLocalRotate(new Vector3(0, 0, 0), 3).OnComplete(() =>
{
@ -43,6 +46,7 @@ public class Device_CabinetDoor : Device_Base
transform.Find("计量柜锁2/计量柜锁3").DOLocalRotate(new Vector3(0, 0, 0), 1).OnComplete(() =>
{
isOpen = false;
endAction?.Invoke();
});
});
}

View File

@ -65,7 +65,14 @@ public class Tool_Base : PermanentTriggerBase
{
this.triggerAction = action;
}
public void AddStartAction(Action callback)
{
startAction += callback;
}
public void AddEndAction(Action callback)
{
endAction += callback;
}
/// <summary>
/// 设置工具回到手中的位置
/// </summary>
@ -90,6 +97,7 @@ public class Tool_Base : PermanentTriggerBase
transform.localPosition = head_LocalPos;
transform.localEulerAngles = head_LocalEulerAnglesl;
isMoving = false;
endAction?.Invoke();
});
}
}

View File

@ -27,12 +27,6 @@ public class Tool_Screw : Tool_Base
/// </summary>
public bool hasElectricity;
/// <summary>
/// 正在移动不能操作
/// </summary>
private bool isMoving;
/// <summary>
/// 安装状态时Y的local值
/// </summary>
@ -61,35 +55,24 @@ public class Tool_Screw : Tool_Base
/// <param name="screwdriver"></param>
public void BeInstalled(Tool_Screwdriver screwdriver)
{
if (!isMoving)
{
isMoving = true;
Debug.Log("开始拧紧螺丝");
//设置螺丝刀初始位置
screwdriver.transform.parent = null;
screwdriver.transform.DOLocalRotate(installPos.localEulerAngles, 0.5f);
screwdriver.transform.DOMove(installPos.position, 1).OnComplete(() =>
//动画
transform.DOLocalMoveY(initPostionY, 1)
.OnUpdate(() =>
{
//动画
transform.DOLocalMoveY(initPostionY, 1)
.OnUpdate(() =>
{
transform.RotateAroundLocal(Vector3.up, 1);
screwdriver.transform.position = installPos.position;
screwdriver.transform.RotateAroundLocal(Vector3.right, 10);
})
.OnComplete(() =>
{
Debug.Log("螺丝已拧紧");
isInstall = true;
isMoving = false;
installAction?.Invoke(true);
screwdriver.ReBackHead();
screwdriver.isMoving = false;
CallScoreAction(true);
});
transform.RotateAroundLocal(Vector3.up, 1);
screwdriver.transform.position = installPos.position;
screwdriver.transform.RotateAroundLocal(Vector3.right, 10);
})
.OnComplete(() =>
{
Debug.Log("螺丝已拧紧");
isInstall = true;
isMoving = false;
screwdriver.isMoving = false;
installAction?.Invoke(true);
screwdriver.ReBackHead();
CallScoreAction(true);
});
}
}
/// <summary>
@ -98,34 +81,23 @@ public class Tool_Screw : Tool_Base
/// <param name="screwdriver"></param>
public void BeUnInstalled(Tool_Screwdriver screwdriver)
{
if (!isMoving)
{
isMoving = true;
Debug.Log("开始卸螺丝");
//设置螺丝刀初始位置
screwdriver.transform.parent = null;
screwdriver.transform.DOLocalRotate(installPos.localEulerAngles, 0.5f);
screwdriver.transform.DOMove(installPos.position, 1).OnComplete(() =>
//动画
transform.DOLocalMoveY(initPostionY - 0.02f, 1)
.OnUpdate(() =>
{
//动画
transform.DOLocalMoveY(initPostionY - 0.02f, 1)
.OnUpdate(() =>
{
transform.RotateAroundLocal(Vector3.up, 1);
screwdriver.transform.position = installPos.position;
screwdriver.transform.RotateAroundLocal(Vector3.right, 10);
})
.OnComplete(() =>
{
Debug.Log("螺丝已拧松");
isInstall = false;
isMoving = false;
installAction?.Invoke(false);
screwdriver.ReBackHead();
screwdriver.isMoving = false;
CallScoreAction(false);
});
transform.RotateAroundLocal(Vector3.up, 1);
screwdriver.transform.position = installPos.position;
screwdriver.transform.RotateAroundLocal(Vector3.right, 10);
})
.OnComplete(() =>
{
Debug.Log("螺丝已拧松");
isInstall = false;
isMoving = false;
screwdriver.isMoving = false;
installAction?.Invoke(false);
screwdriver.ReBackHead();
CallScoreAction(false);
});
}
}
}

View File

@ -14,10 +14,19 @@ public class Tool_Screwdriver : Tool_Base
/// <param name="screw"></param>
public void Install(Tool_Screw screw)
{
if (!screw.isInstall)
if (!screw.isInstall && !screw.isMoving && !isMoving)
{
screw.isMoving = true;
isMoving = true;
screw.BeInstalled(this);
Debug.Log("开始拧紧螺丝");
startAction?.Invoke();
//螺丝刀移到螺丝上
transform.parent = null;
transform.DOLocalRotate(screw.installPos.localEulerAngles, 0.5f);
transform.DOMove(screw.installPos.position, 1).OnComplete(() =>
{
screw.BeInstalled(this);
});
}
}
@ -27,10 +36,19 @@ public class Tool_Screwdriver : Tool_Base
/// <param name="screw"></param>
public void UnInstall(Tool_Screw screw)
{
if (screw.isInstall)
if (screw.isInstall && !screw.isMoving && !isMoving)
{
screw.isMoving = true;
isMoving = true;
screw.BeUnInstalled(this);
Debug.Log("开始卸螺丝");
startAction?.Invoke();
//螺丝刀移到螺丝处
transform.parent = null;
transform.DOLocalRotate(screw.installPos.localEulerAngles, 0.5f);
transform.DOMove(screw.installPos.position, 1).OnComplete(() =>
{
screw.BeUnInstalled(this);
});
}
}

View File

@ -116,6 +116,7 @@ public class Tool_TestPen : Tool_Base
if (tool_base.toolType == ToolType.)
{
var tmp = ((Tool_Screw)tool_base);
base.startAction?.Invoke();
//位置移动
transform.parent = null;
transform.DOLocalRotate(tmp.installPos.localEulerAngles, 0.5f);

View File

@ -15,7 +15,8 @@ public class Tool_WireStripper : Tool_Base
/// <param name="device_Seal"></param>
public void CutOpen(Device_Seal device_Seal)
{
isMoving = true;
base.startAction?.Invoke();
base.isMoving = true;
transform.parent = null;
transform.DORotate(device_Seal.testPosAndRot.eulerAngles, 0.5f);
transform.DOMove(device_Seal.testPosAndRot.position, 1).OnComplete(() =>
@ -51,6 +52,7 @@ public class Tool_WireStripper : Tool_Base
//¼ô¶Ï
device_Seal.Cut();
isMoving = false;
ReBackHead();
int result = (triggerAction == null ? 0 : triggerAction.Invoke(device_Seal.triggerName, true));
}
@ -67,7 +69,7 @@ public class Tool_WireStripper : Tool_Base
Device_Seal ds = hit.transform.GetComponent<Device_Seal>();
if (ds != null)
{
if ((triggerAction == null ? 0 : triggerAction.Invoke(ds.triggerName, false))== 0)
if ((triggerAction == null ? 0 : triggerAction.Invoke(ds.triggerName, false)) == 0)
{
CutOpen(ds);
}

View File

@ -25,9 +25,29 @@ public class LiveSceneManager : SingletonMono<LiveSceneManager>
currentTool.transform.localPosition = spawnToolPos.localPosition;
currentTool.transform.localEulerAngles = spawnToolPos.localEulerAngles;
if (currentTool.GetComponent<Tool_Base>())
{
currentTool.GetComponent<Tool_Base>().SetHeadPosAndEulerang(currentTool.transform.localPosition, currentTool.transform.localEulerAngles);
currentTool.GetComponent<Tool_Base>().AddStartAction(() =>
{
tMDTips.gameObject.SetActive(false);
});
currentTool.GetComponent<Tool_Base>().AddEndAction(() =>
{
tMDTips.gameObject.SetActive(true);
});
}
if (currentTool.GetComponent<Device_Base>())
{
currentTool.GetComponent<Device_Base>().SetHeadPosAndEulerang(currentTool.transform.localPosition, currentTool.transform.localEulerAngles);
currentTool.GetComponent<Device_Base>().AddStartAction(() =>
{
tMDTips.gameObject.SetActive(false);
});
currentTool.GetComponent<Device_Base>().AddEndAction(() =>
{
tMDTips.gameObject.SetActive(true);
});
}
tMDTips.gameObject.SetActive(true);
if (currentTool.name.Equals("¹¤×÷Ö¤"))
{

View File

@ -137,7 +137,6 @@ public class ProcessManager : BaseManager<ProcessManager>
{
HandoverSubProcess(spID, 0);
GameManager.EventMgr.EventTrigger<int>(Enum_EventType.SwitchSubProcess, d_Scheme.CurrentProcess.CurrentSubProcessId);
//Debug.Log($"<color=red>进入下一步子流程</color>");
//Debug.Log("进入下一步子流程");
return true;
}
@ -171,13 +170,13 @@ public class ProcessManager : BaseManager<ProcessManager>
}
}
//public int currentSubProcessIDTemp = 0;
/// <summary>
/// 0 正常1 不在当前步骤触发ID2 当前步骤没有触发ID了
/// </summary>
/// <param name="triggerID"></param>
/// <param name="triggerName"></param>
/// <returns></returns>
public int IsRightSubProcessStepsTriggerID(string triggerID, bool isRemove)
public int IsRightSubProcessStepsTriggerID(string triggerName, bool isRemove)
{
if (GameManager.RunModelMgr.ModeType != E_ModeType.Study) return 0;
if (d_Scheme.CurrentProcess.CurrentSubProcess.CurrentSubProcessStep.precondition == GameManager.RunModelMgr.SceneType.ToString())
@ -185,7 +184,7 @@ public class ProcessManager : BaseManager<ProcessManager>
if (d_Scheme.CurrentProcess.CurrentSubProcess.CurrentSubProcessStep.triggersName.Count > 0)
{
string currentSubProcessStepTriggerID = d_Scheme.CurrentProcess.CurrentSubProcess.CurrentSubProcessStep.triggersName[0];
if (triggerID == currentSubProcessStepTriggerID)
if (triggerName == currentSubProcessStepTriggerID)
{
if (isRemove)
{
@ -193,7 +192,15 @@ public class ProcessManager : BaseManager<ProcessManager>
}
if (d_Scheme.CurrentProcess.CurrentSubProcess.CurrentSubProcessStep.triggersName.Count == 0)
{
if (triggerID != "工具间按钮" && triggerID != "现场按钮" && triggerID != "收回工具")
//if (currentSubProcessIDTemp == d_Scheme.CurrentProcess.CurrentSubProcess.CurrentSubProcessStep.subProcessId)
//{
// Debug.Log($"<color=red>子流程id相等</color>");
//}
//else
//{
// Debug.Log($"<color=green>子流程id不相等</color>");
//}
if (triggerName != "工具间按钮" && triggerName != "现场按钮" && triggerName != "收回工具")
{
GameManager.UIMgr.ShowPanel<UI_MessagePanel>(E_UI_Layer.System, (p) =>
{
@ -210,6 +217,7 @@ public class ProcessManager : BaseManager<ProcessManager>
}
}
CurrentSubProcessStepTriggerNames();
return 0;
}
else

View File

@ -18,6 +18,14 @@ public class PermanentTriggerBase : MonoBehaviour
/// 打分事件
/// </summary>
private Action<string, object, int, int> scoreAction;
/// <summary>
/// 开始操作的回调(工具为从手里开始使用时调用,设备为开始操作时调用)
/// </summary>
protected Action startAction;
/// <summary>
/// 操作结束回调(工具为回到手中时调用,设备为操作结束时调用)
/// </summary>
protected Action endAction;
private void Awake()
{

View File

@ -26,10 +26,7 @@ public class UI_SubProcessItem : BaseItem
{
GameManager.EventMgr.AddEventListener<int>(Enum_EventType.SwitchSubProcess, SwitchSubProcess);
}
public override void HideMe()
{
GameManager.EventMgr.RemoveEventListener<int>(Enum_EventType.SwitchSubProcess, SwitchSubProcess);
}
/// <summary>
/// ¿ØÖư´Å¥×´Ì¬
/// </summary>
@ -48,12 +45,27 @@ public class UI_SubProcessItem : BaseItem
switch (btnName)
{
case "subProcessBtn":
GameManager.ProcessMgr.HandoverProcess(processID, subProcessID, subProcessStepID);
//ÖØÖÃÎïÌå
StepStateControl.instance.InvokeInitStepState(GameManager.Instance.systemId, GameManager.ProcessMgr.d_Scheme.id, subProcessID);
GameManager.EventMgr.EventTrigger<int>(Enum_EventType.SwitchSubProcess, subProcessID);
Debug.LogError(ProcessManager.Instance.subProcessStepTriggerID);
GameManager.EventMgr.EventTrigger<string>(Enum_EventType.SwitchSubProcessStepTriggerID, ProcessManager.Instance.subProcessStepTriggerID);
if (GameManager.ProcessMgr.d_Scheme.CurrentProcess.CurrentSubProcess.CurrentSubProcessStep.triggersName.Count > 0)
{
GameManager.UIMgr.ShowPanel<UI_MessagePanel>(E_UI_Layer.System, (p) =>
{
p.Init("提示", "当前步骤还没有学完,确定要切换吗?", E_MessageType.Error, () =>
{
GameManager.ProcessMgr.HandoverProcess(processID, subProcessID, subProcessStepID);
//重置物体
StepStateControl.instance.InvokeInitStepState(GameManager.Instance.systemId, GameManager.ProcessMgr.d_Scheme.id, subProcessID);
GameManager.EventMgr.EventTrigger<int>(Enum_EventType.SwitchSubProcess, subProcessID);
//Debug.LogError(ProcessManager.Instance.subProcessStepTriggerID);
GameManager.EventMgr.EventTrigger<string>(Enum_EventType.SwitchSubProcessStepTriggerID, ProcessManager.Instance.subProcessStepTriggerID);
},
() =>
{
GameManager.UIMgr.HidePanel<UI_MessagePanel>();
});
});
}
break;
}
}

View File

@ -57,37 +57,54 @@ public class UI_MenuBar : BasePanel
private void SwitchSubProcessStepTriggerID(string triggerID)
{
bool isOpen = false;
if (triggerID == workOrderName)
{
GameManager.UIMgr.imageTips.ShowTips(workOrderBtn.GetComponent<RectTransform>());
isOpen = true;
}
else if (triggerID == disassemblyAssemblyWorkOrderName)
{
GameManager.UIMgr.imageTips.ShowTips(disassemblyAssemblyWorkOrderBtn.GetComponent<RectTransform>());
isOpen = true;
}
else if (triggerID == toolKitName)
{
GameManager.UIMgr.imageTips.ShowTips(toolKitBtn.GetComponent<RectTransform>());
isOpen = true;
}
else if (triggerID == siteName)
{
GameManager.UIMgr.imageTips.ShowTips(siteBtn.GetComponent<RectTransform>());
isOpen = true;
}
else if (triggerID == officeName)
{
GameManager.UIMgr.imageTips.ShowTips(officeBtn.GetComponent<RectTransform>());
isOpen = true;
}
else if (triggerID == toolRoomName)
{
GameManager.UIMgr.imageTips.ShowTips(toolRoomBtn.GetComponent<RectTransform>());
isOpen = true;
}
else if (triggerID == notifyName)
{
GameManager.UIMgr.imageTips.ShowTips(notifyBtn.GetComponent<RectTransform>());
isOpen = true;
}
else
{
GameManager.UIMgr.imageTips.HideTips();
isOpen = false;
}
if (isOpen)
{
OpenMenu();
}
else
{
CloseMenu();
}
}
@ -99,11 +116,7 @@ public class UI_MenuBar : BasePanel
public void CheckBtnBySceneName(E_SceneType type)
{
Debug.Log(type.ToString());
if (GetControl<Image>("MenuBar").transform.localPosition.x == 960)
{
GetControl<Image>("CloseDefaultBtn").sprite = ExpandSprite;
GetControl<Image>("MenuBar").transform.DOLocalMoveX(1070, 0.5f);
}
CloseMenu();
toolRoomBtn.gameObject.SetActive(type != E_SceneType.ToolRoom);
siteBtn.gameObject.SetActive(type == E_SceneType.ToolRoom);
workOrderBtn.gameObject.SetActive(type == E_SceneType.Office);
@ -114,6 +127,17 @@ public class UI_MenuBar : BasePanel
notifyBtn.gameObject.SetActive(type == E_SceneType.Site);
}
private void OpenMenu()
{
GetControl<Image>("CloseDefaultBtn").sprite = ExpandSprite;
GetControl<Image>("MenuBar").rectTransform.DOAnchorPosX(0, 0.5f);
}
private void CloseMenu()
{
GetControl<Image>("MenuBar").rectTransform.DOAnchorPosX(110, 0.5f);
GetControl<Image>("CloseDefaultBtn").sprite = CollapseSprite;
}
/// <summary>
/// µ¹¼ÆÊ±
@ -128,7 +152,7 @@ public class UI_MenuBar : BasePanel
while (countDown > 0)
{
yield return waitForSeconds;
GetControl<Image>("MenuBar").transform.DOLocalMoveX(1070, 0.5f);
CloseMenu();
}
}
protected override void OnClick(string btnName)
@ -136,12 +160,13 @@ public class UI_MenuBar : BasePanel
switch (btnName)
{
case "CloseDefaultBtn":
GetControl<Image>("MenuBar").transform.DOLocalMoveX(960, 0.5f);
GetControl<Image>("CloseDefaultBtn").sprite = CollapseSprite;
if (GetControl<Image>("MenuBar").transform.localPosition.x == 960)
if (GetControl<Image>("MenuBar").rectTransform.anchoredPosition.x == 0)
{
GetControl<Image>("CloseDefaultBtn").sprite = ExpandSprite;
GetControl<Image>("MenuBar").transform.DOLocalMoveX(1070, 0.5f);
CloseMenu();
}
else if (GetControl<Image>("MenuBar").rectTransform.anchoredPosition.x == 110)
{
OpenMenu();
}
break;
case "OfficeBtn":

View File

@ -49,16 +49,16 @@ public class UI_MessagePanel : BasePanel
case E_MessageType.Error:
GetControl<Image>("Image_NormalBackGround").gameObject.SetActive(true);
GetControl<Button>("Button_NormalConfirm").gameObject.SetActive(true);
GetControl<Button>("Button_NormalCancel").gameObject.SetActive(true);
GetControl<Image>("Image_WarnBackGround").gameObject.SetActive(false);
GetControl<Button>("Button_NormalCancel").gameObject.SetActive(true);
GetControl<Button>("Button_WarmConfirm").gameObject.SetActive(false);
break;
case E_MessageType.Warning:
GetControl<Image>("Image_WarnBackGround").gameObject.SetActive(true);
GetControl<Button>("Button_WarmConfirm").gameObject.SetActive(true);
GetControl<Image>("Image_NormalBackGround").gameObject.SetActive(false);
GetControl<Button>("Button_NormalConfirm").gameObject.SetActive(false);
GetControl<Image>("Image_WarnBackGround").gameObject.SetActive(true);
GetControl<Button>("Button_NormalCancel").gameObject.SetActive(false);
GetControl<Button>("Button_WarmConfirm").gameObject.SetActive(true);
break;
}

View File

@ -14,6 +14,8 @@ public class UI_ToolAndMaterialPanel : BasePanel
{
if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
GetControl<Button>("closeBtn").interactable = false;
if (GameManager.RunModelMgr.SceneType != E_SceneType.ToolRoom)
GetControl<Button>("closeBtn").gameObject.SetActive(false);
CreatItem(E_ToolOrDeviceOrMaterials.Tool); //默认打开显示工器具
}
@ -41,7 +43,7 @@ public class UI_ToolAndMaterialPanel : BasePanel
uiTMDitem.Init(bagDatas[item]);
}
}
GameManager.EventMgr.EventTrigger<string>(Enum_EventType.SwitchSubProcessStepTriggerID,GameManager.ProcessMgr.subProcessStepTriggerID);
GameManager.EventMgr.EventTrigger<string>(Enum_EventType.SwitchSubProcessStepTriggerID, GameManager.ProcessMgr.subProcessStepTriggerID);
}