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; }
private void OnTriggerStay2D(Collider2D collision) { if (CurrentState == OldManState.MOVING_TO_LAUNDRY && collision.gameObject.GetInstanceID() == laundryTarget.GetInstanceID()) { NextState = OldManState.AT_LAUNDRY; } }
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; } }
public void EnableDoggo() { doggoFollower.SetActive(true); NextState = OldManState.GOT_DOGGO; }