修改注册事件
This commit is contained in:
parent
7d9fc1250c
commit
57338dc352
|
@ -17,25 +17,27 @@ public class ImageTips : MonoBehaviour
|
||||||
gameObject.SetActive(true);
|
gameObject.SetActive(true);
|
||||||
selfRect = GetComponent<RectTransform>();
|
selfRect = GetComponent<RectTransform>();
|
||||||
image = GetComponent<Image>();
|
image = GetComponent<Image>();
|
||||||
|
image.enabled = true;
|
||||||
selfRect.SetParent(target);
|
selfRect.SetParent(target);
|
||||||
selfRect.anchorMin = Vector2.zero;
|
selfRect.anchorMin = Vector2.zero;
|
||||||
selfRect.anchorMax = new Vector2(1, 1);
|
selfRect.anchorMax = new Vector2(1, 1);
|
||||||
selfRect.offsetMax = Vector2.zero;
|
selfRect.offsetMax = Vector2.zero;
|
||||||
selfRect.offsetMin = Vector2.zero;
|
selfRect.offsetMin = Vector2.zero;
|
||||||
//selfRect.sizeDelta = target.sizeDelta + sizeOffset;
|
//selfRect.sizeDelta = target.sizeDelta + sizeOffset;
|
||||||
if (gameObject.activeSelf)
|
if (gameObject.activeSelf && gameObject.activeInHierarchy)
|
||||||
StartCoroutine(FlashRoutine());
|
StartCoroutine(FlashRoutine());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HideTips()
|
public void HideTips()
|
||||||
{
|
{
|
||||||
transform.parent = null;
|
transform.parent = null;
|
||||||
if (gameObject.activeSelf)
|
if (gameObject.activeSelf && gameObject.activeInHierarchy)
|
||||||
{
|
{
|
||||||
StopCoroutine(FlashRoutine());
|
StopCoroutine(FlashRoutine());
|
||||||
gameObject.SetActive(false);
|
gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator FlashRoutine()
|
private IEnumerator FlashRoutine()
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
|
|
|
@ -83,11 +83,8 @@ public class PermanentTriggerBase : MonoBehaviour
|
||||||
{
|
{
|
||||||
GameManager.EventMgr.RemoveEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
|
GameManager.EventMgr.RemoveEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
|
||||||
}
|
}
|
||||||
private void OnDisable()
|
//private void OnDisable()
|
||||||
{
|
//{
|
||||||
GameManager.EventMgr.RemoveEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
|
// GameManager.EventMgr.RemoveEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@ public class UI_ToolOrMaterialsOrDeviceItem : BaseItem
|
||||||
currentTool.GetComponent<Collider>().enabled = false;
|
currentTool.GetComponent<Collider>().enabled = false;
|
||||||
currentTool.name = currentItem.toolName;
|
currentTool.name = currentItem.toolName;
|
||||||
LiveSceneManager.Instance.SetSpawnToolInfo(currentTool);
|
LiveSceneManager.Instance.SetSpawnToolInfo(currentTool);
|
||||||
|
GameManager.UIMgr.imageTips.HideTips();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue