Exemple #1
0
 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);
 }
Exemple #2
0
        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);
        }
Exemple #3
0
    //private

#if UNITY_EDITOR
    private void Reset()
    {
        anim = GetComponent <NPCAnimator>();
    }
Exemple #4
0
 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);
 }