コード例 #1
0
 // Update is called once per frame
 void Update()
 {
     if (treeStatus != Node.Status.SUCCESS)
     {
         treeStatus = tree.Process();
     }
 }
コード例 #2
0
 void Update()
 {
     Node.Status status = child.Tick(Time.deltaTime);
     if (status == Node.Status.Success)
     {
     }
     Debug.Log(status);
 }
コード例 #3
0
ファイル: AnimalBehaviour.cs プロジェクト: mp525/GameDevExam
    // Update is called once per frame
    void FixedUpdate()
    {
        float distanceToPlayer = Vector3.Distance(player.transform.position, this.transform.position);

        if (treeStatus != Node.Status.SUCCESS)
        {
            treeStatus = tree.Process();
        }
        if (distanceToPlayer > 10 && lonelyness < 1000)
        {
            lonelyness += 1;
        }

        if (distanceToPlayer < 10 && lonelyness > 0)
        {
            lonelyness -= 1;
        }
        SwitchAnimationState(currentState);
    }