You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
834 B
25 lines
834 B
using UnityEngine; |
|
using AX.MessageSystem; |
|
using System; |
|
using UnityEngine.UI; |
|
|
|
public class CloneCharacterDisable : MonoBehaviour { |
|
|
|
private Toggle cloneButton; |
|
void Start() |
|
{ |
|
cloneButton = GetComponent<Toggle>(); |
|
GetComponent<CloneCharacterBtn>().mCloneObjType = (CloneObjType)Enum.Parse(typeof(CloneObjType),"Character");//必要条件是"Character"和克隆的对象类型的字符串同名 |
|
MessageDispatcher.AddListener("CloneCharacterDisable", setDisable); |
|
} |
|
private void OnDestroy() |
|
{ |
|
MessageDispatcher.RemoveListener("CloneCharacterDisable", setDisable); |
|
} |
|
private void setDisable(IMessage obj) |
|
{ |
|
cloneButton.isOn = false; |
|
cloneButton.interactable = false; |
|
InputManager.cloneObjType = CloneObjType.None; |
|
} |
|
}
|
|
|