예제 #1
0
    private void Update()
    {
        if (NextState == OldManState.MOVING_TO_LAUNDRY)
        {
            RandomMovement rm = GetComponent <RandomMovement>();
            if (rm)
            {
                rm.StopAllCoroutines();
            }
        }

        if (NextState == OldManState.AT_LAUNDRY)
        {
            StartCoroutine(FadeOut(true));
        }

        if (NextState != OldManState.NONE && NextState != CurrentState)
        {
            CurrentState = NextState;
            NextState    = OldManState.NONE;
        }

        if (CurrentState == OldManState.MOVING_TO_LAUNDRY)
        {
            MoveTowardsTarget(laundryTarget.transform.position);
        }

        WalkAnimation();
        previousPosition = transform.position;
    }
예제 #2
0
 private void OnTriggerStay2D(Collider2D collision)
 {
     if (CurrentState == OldManState.MOVING_TO_LAUNDRY && collision.gameObject.GetInstanceID() == laundryTarget.GetInstanceID())
     {
         NextState = OldManState.AT_LAUNDRY;
     }
 }
예제 #3
0
 public override void Interact(Action action, Clickable target)
 {
     if (!target.enabled)
     {
         return;
     }
     if (action == Action.GET_SUIT && CurrentState == OldManState.GOT_DOGGO)
     {
         NextState = OldManState.MOVING_TO_LAUNDRY;
     }
 }
예제 #4
0
 public void EnableDoggo()
 {
     doggoFollower.SetActive(true);
     NextState = OldManState.GOT_DOGGO;
 }