/// <summary> /// 要素をすべて受け取る /// </summary> public bool ReceiveAllElement(ElementBase[] receiveList) { // 要素のコピー移動 foreach (var element in receiveList) { if (element) { if (element.Type != ElementType.Action) { this.CopyComponent(element); //現在の向きを取得 if (element.Type != ElementType.Direction) { _currentDirection = element.GetComponent <DiectionTest>().GetDir(); } // 要素の更新 this.ElementUpdate(); } } } // 状態の変更 _stats = ElementStates.Element; //上書き時の位置を保存 _overwritePos.Add(_rigidBody2d.transform.position); // n秒後思い出すコルーチン StartCoroutine(WaitSanity()); return(true); }
/// <summary> /// 要素を思い出す /// </summary> private void ReCallElement() { foreach (var element in _rememberList) { if (element) { var copy = this.CopyComponent(element); copy.enabled = true; if (copy.Type != ElementType.Direction) { _currentDirection = copy.GetComponent <DiectionTest>().GetDir(); } } } // 更新 ElementUpdate(); // 状態の変更 _stats = ElementStates.Default; }
private IEnumerator ReturnToSanityCorutine() { // SE if (InGameManager.IsInstance()) { if (InGameManager.Instance.GameState == InGameManager.State.Play) { Util.Sound.SoundManager.Instance.PlayOneShot(AudioKey.in_sanity); } } // 状態の変更 _stats = ElementStates.Remember; // 今の要素を忘れる ForgetAllElement(); // 元の位置に戻る yield return(ReturnToInitPos()); // 要素を思い出す ReCallElement(); }
public virtual void UpdateState(ElementStates state) { // }