コード例 #1
0
    void Behaviour()
    {
        state = maq.GetState();
        Ordering();
        switch (state)
        {
        case (int)States.ToMine:
            ToMine();
            nodes.ResetAllNodes();

            /*Debug.Log("asd");
             * movingToMine = true;*/
            break;

        case (int)States.ToDeposit:
            ToDeposit();
            nodes.ResetAllNodes();
            // movingToMine = false;
            break;

        case (int)States.Mining:
            Mining();
            nodes.ResetAllNodes();
            // movingToMine = true;
            break;

        case (int)States.Idle:
            //Debug.Log("Idling");
            goingToMine.ClearAnything();
            goingToWarehouse.ClearAnything();
            thePathMine.Clear();
            thePathWarehouse.Clear();
            nodes.ResetAllNodes();
            thePathMine      = goingToMine.GetPath(nodes.GetNodeByPosition(transform.position), nodes.GetNodeByPosition(mine.transform.position));
            thePathWarehouse = goingToWarehouse.GetPath(nodes.GetNodeByPosition(transform.position), nodes.GetNodeByPosition(warehouse.transform.position));
            break;
        }
        NoMine();
    }