Beispiel #1
0
    void BuildCommand(Icommand command)
    {
        bool atDestination = true;

        this.command = command;
        if (transform.position != command.GetPoint())
        {
            atDestination = false;
            GetComponent <Movement>().MoveUnit(command.GetPoint());
            StartCoroutine(AtBuildingPlacement(command.GetPoint(), atDestination));
        }
        else
        {
            CmdBuildBuilding();
        }
    }
Beispiel #2
0
 public void RpcBuildBuilding()
 {
     if (this.isServer)
     {
         //GameObject obj = Instantiate(Resources.Load("Models/FactionA/Units/Buildings/Town Hall/TownHall", typeof(GameObject)) as GameObject);
         //NetworkServer.SpawnWithClientAuthority(obj, this.connectionToClient);
         GameObject obj = Instantiate(command.GetUnit(), command.GetPoint(), Quaternion.Euler(0, -30, 0));
     }
     SetState(state.BUILDING);
 }
Beispiel #3
0
 void MoveCommand(Icommand command)
 {
     GetComponent <Movement>().MoveUnit(command.GetPoint());
 }