Ejemplo n.º 1
0
 // 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();
 }
Ejemplo n.º 2
0
    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();
    }
Ejemplo n.º 3
0
    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();
    }
Ejemplo n.º 4
0
    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();
    }