コード例 #1
0
        void Start()
        {
            stats = GetComponentInParent <EnemyStats>();
            rb    = GetComponentInParent <Rigidbody>();

            stats.movementClock.ClockEnded += OnShouldMove;

            currentNode      = stats.gameObject.transform.position;
            currentDirection = MouchouDirection.Down;
        }
コード例 #2
0
        public void OnShouldMove()
        {
            if (canMove == true)
            {
                currentDirection = pattern.patternList[patternIndex];

                if (patternIndex == pattern.patternList.Count - 1)
                {
                    patternIndex = 0;
                }
                else
                {
                    patternIndex++;
                }

                GetNextNode();
                UpdateMovement();
            }
        }