Esempio n. 1
0
        public void UpdateSensor()
        {
            var worldSpacePositionToSearch = transform.TransformVector(m_directionToSearch) + transform.position;

            if (m_board != null)
            {
                m_currentNode  = m_board.FindNodeAt(transform.position);
                m_nodeToSearch = m_board.FindNodeAt(worldSpacePositionToSearch);
                if (m_nodeToSearch == m_board.PlayerNode && m_currentNode.LinkedNodes.Contains(m_nodeToSearch) && !m_nodeToSearch.isLevelGoal)
                {
                    m_foundPlayer = true;
                    Debug.Log("Found Player");
                }
            }
        }
Esempio n. 2
0
        public void Move(Vector3 destinationPos, float delayTime = .25f)
        {
            if (isMoving)
            {
                return;
            }

            if (m_board != null)
            {
                var targetNode = m_board.FindNodeAt(destinationPos);
                if (targetNode == null && m_currentNode == null)
                {
                    return;
                }
                if (!m_currentNode.LinkedNodes.Contains(targetNode))
                {
                    return;
                }
            }
            StartCoroutine(MoveRoutine(destinationPos, delayTime));
        }