示例#1
0
 // Update is called once per frame
 void Update()
 {
     if (NetworkManager.Instance.IsServer)
     {
         if (blueTeamDead.Count > 0)
         {
             if (TimeMachine.blueTimeMachine.MAvalableLaboreres.Count > 0)
             {
                 Debug.Log("respawning player as blue");
                 NetworkingPlayer toGive = blueTeamDead.Dequeue();
                 RMManager        obj    = TimeMachine.blueTimeMachine.MAvalableLaboreres.Dequeue();
                 obj.networkObject.Destroy();
                 RobotManagerBehavior behavior = NetworkManager.Instance.InstantiateRobotManager();
                 StartCoroutine(respawnPlayer(behavior, 2, toGive, 0.1f));
             }
         }
         if (redTeamDead.Count > 0)
         {
             Debug.Log("this is right");
             if (TimeMachine.redTimeMachine.MAvalableLaboreres.Count > 0)
             {
                 Debug.Log("respawning player as red");
                 NetworkingPlayer toGive = redTeamDead.Dequeue();
                 RMManager        obj    = TimeMachine.redTimeMachine.MAvalableLaboreres.Dequeue();
                 obj.networkObject.Destroy();
                 RobotManagerBehavior behavior = NetworkManager.Instance.InstantiateRobotManager();
                 StartCoroutine(respawnPlayer(behavior, 1, toGive, 0.1f));
             }
         }
     }
 }
示例#2
0
 void Start()
 {
     rigid = GetComponent <Rigidbody>();
     anim  = GetComponent <Animator>();
     agent = GetComponent <NavMeshAgent>();
     agent.updateRotation = false;
     robotManager         = GetComponentInParent <RMManager>();
 }
示例#3
0
 // Use this for initialization
 void Start()
 {
     anim        = GetComponent <Animator>();
     rigid       = GetComponentInChildren <Rigidbody>();
     robotManger = GetComponentInParent <RMManager>();
 }
示例#4
0
 public void MAddLaborerToAvailableLaborer(RMManager controller)
 {
     multiplayer = true;
     MAvalableLaboreres.Enqueue(controller);
 }