private void Awake() { if (instance == null) { instance = this as CheckpointHandler; } else { Destroy(gameObject); } DontDestroyOnLoad(this); }
public void RegisterCheckpointHandler(string checkpointType, CheckpointHandler handler) { _checkpointHandlers[checkpointType] = handler; }
// Use this for initialization void Start() { //isActive = false; checkPointSprite = GetComponent <SpriteRenderer>(); checkHand = GameObject.Find("CheckpointManager").GetComponent <CheckpointHandler>(); }
/// <summary> /// 添加刷新操作 /// </summary> /// <param name="process"></param> public void AddUpdateProcess(CheckpointHandler process) => CheckUpdateProcess += process;
/// <summary> /// 添加完成操作 /// </summary> /// <param name="process"></param> public void AddCheckProcess(CheckpointHandler process) => CheckpointProcess += process;