Beispiel #1
0
    public void SetState(Node.eState state)
    {
        switch (state)
        {
        case Node.eState.BLOCKER:
            image.sprite = GameManager.PersistentData.GameConfiguration.blocked;
            break;

        case Node.eState.START:
            image.sprite = GameManager.PersistentData.GameConfiguration.start;
            break;

        case Node.eState.END_OPEN:
            image.sprite = GameManager.PersistentData.GameConfiguration.open_door;
            break;

        case Node.eState.END_LOCKED:
            image.sprite = GameManager.PersistentData.GameConfiguration.closed_door;
            break;

        default:
            image.sprite = GameManager.PersistentData.GameConfiguration.empty;
            break;
        }
    }
Beispiel #2
0
        protected Pool <Node> .Node CreateNode(int nodeIndex)
        {
            System.Diagnostics.Debug.Assert(m_nodePool.ActiveCount == m_expandedNodes.Count);

            Pool <Node> .Node newNode = m_nodePool.Get();
            m_expandedNodes[nodeIndex] = newNode;
            Node.eState nodeState = Node.eState.kUnvisited;
            if (World.IsNodeBlocked(nodeIndex))
            {
                nodeState = Node.eState.kBlocked;
            }
            newNode.Item.Awake(nodeIndex, nodeState);

            System.Diagnostics.Debug.Assert(m_nodePool.ActiveCount == m_expandedNodes.Count);

            return(newNode);
        }