Esempio n. 1
0
    void MoveControl()
    {
        unit = mover.GetComponent<UnitScript>();

        foreach(Vector2 node in available){
            if(node == destination)
                viableFlag = true;
        }
        if(viableFlag){
            // rxl244: if statement prevents player from moving enemy units
            if(unit.team != 2){
                unit.SendMessage("moveTo", destination);
            }
            //reset values
            destination = Vector2.zero;
            mover = null;
            available = null;
        }
        viableFlag = false;
        //		Debug.Log ("unit moved");
    }