public IEnumerator SwitchNPC(NPCCharacter NPCScript) { Debug.Log("Switching NPC to " + NPCScript._characterName); NPCAnimator.SetBool("OnStage", false); do { if (NPCAnimator.GetCurrentAnimatorStateInfo(0).IsName("OffStage")) { NPCImage.sprite = NPCScript.GetNPCSprite; NPCName.text = NPCScript._characterName; NPCAnimator.SetBool("OnStage", true); } else { yield return(new WaitForEndOfFrame()); } } while (!NPCAnimator.GetBool("OnStage")); yield return(true); }
private void Awake() { _sortingGroup = GetComponent <SortingGroup>(); TouchHandler = GetComponentInChildren <TouchHandler>(); TouchHandler.OnClick .Merge(TouchHandler.OnDoubleClick) .Merge(TouchHandler.OnMultipleClick) .Subscribe(_ => PlayAnimation(NPCAnimation.Type.Click)) .AddTo(gameObject); TouchHandler.OnMouseDown .Subscribe(_ => PlayAnimation(NPCAnimation.Type.Over)) .AddTo(gameObject); Animator = new NPCAnimator(this) { TimeScale = AnimatorTimeScale }; Animator.OnEvent.Subscribe(OnAnimatorEvent); }
//private #if UNITY_EDITOR private void Reset() { anim = GetComponent <NPCAnimator>(); }
void Awake() { state = AnimalState.ACTIVE; npcAnimator = GetComponent <NPCAnimator>(); }
private void Awake() { movement = GetComponent <NPCMovement>(); anim = GetComponent <NPCAnimator>(); }
private void Awake() { npcAnimator = GetComponent <NPCAnimator>(); stat = GetComponent <Stat>(); }
private void Awake() { animator = this.GetComponent <NPCAnimator>(); phoneWalk.SetActive(false); phoneIdle.SetActive(true); }