コード例 #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();
 }
コード例 #2
0
ファイル: Butterfly.cs プロジェクト: youwho42/a-look-into
    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();
    }
コード例 #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();
    }
コード例 #4
0
ファイル: Firefly.cs プロジェクト: youwho42/a-look-into
    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();
    }