// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { npcMovement = animator.GetComponent <NpcMovement>(); transform = animator.GetComponent <Transform>(); getDestination = animator.GetComponent <GetDestination>(); destination = getDestination.SetDestination(); }
private void Start() { captureCollider = GetComponent <Collider2D>(); float randomIdleStart = Random.Range(0, animator.GetCurrentAnimatorStateInfo(0).length); animator.Play(0, 0, randomIdleStart); getDestination = GetComponent <GetDestination>(); if (getDestination.chickenPen == null) { getDestination.chickenPen = PlayerInformation.instance.player; SetRandomDestination(); } SetRandomDestination(); currentSpeed = SetRandomSpeed(); }
private void Start() { captureCollider = GetComponent <Collider2D>(); float randomIdleStart = Random.Range(0, animator.GetCurrentAnimatorStateInfo(0).length); animator.Play(0, 0, randomIdleStart); DayNightCycle.instance.FullHourEventCallBack.AddListener(SleepForNight); getDestination = GetComponent <GetDestination>(); if (getDestination.chickenPen == null) { getDestination.chickenPen = PlayerInformation.instance.player; SetRandomDestination(); } SetRandomDestination(); currentSpeed = SetRandomSpeed(); }
private void Start() { captureCollider = GetComponent <Collider2D>(); float randomIdleStart = Random.Range(0, animator.GetCurrentAnimatorStateInfo(0).length); animator.Play(0, 0, randomIdleStart); isFluttering = false; fireflySpritePosition.gameObject.SetActive(false); DayNightCycle.instance.FullHourEventCallBack.AddListener(FireflyLoop); getDestination = GetComponent <GetDestination>(); if (getDestination.chickenPen == null) { getDestination.chickenPen = PlayerInformation.instance.player; SetRandomDestination(); } SetRandomDestination(); currentSpeed = SetRandomSpeed(); }