Пример #1
0
 /// <summary>
 /// 释放队伍,本队锁定,本队英雄重新带队
 /// </summary>
 /// <param name="_team">要释放队伍的装载型队伍</param>
 public void GoOutTeam(TeamObj _team)
 {
     if (_team && _team.soldiertype == WorldObj.SoldierType.Tank && !_team.locking)
     {
         cityController.BuildNewTeam(_team.nationality, _team.soldiernumber, _team.hero, _team.driversoldiertype, null, _team.transform.position);
         _team.UpdateTeamHero("");
         _team.UpdateSoldierNumber(1000);
         _team.UpdateSliderMaxValue(1000);
         _team.UpdateSliderValue(1000);
         _team.UpdateDriverSoldierType(WorldObj.SoldierType.none);
         photonView.RPC("LockUnLockBuildingTeamRPC", PhotonTargets.All, newTeams.IndexOf(_team.gameObject), true);
         //如果该队伍是空军,则减低位置
         if (_team.features.Contains(WorldObj.TeamFeature.AirForce))
         {
             StopCoroutine(_team.coroutineFollow);
             StopCoroutine(_team.coroutineTurnToTarget);
             _team.transform.position -= new Vector3(0f, 2f, 0f);
         }
     }
 }
Пример #2
0
 /// <summary>
 /// 入队,本队伍解散,士兵归装载型队伍
 /// </summary>
 /// <param name="_team">要进入的装载型队伍</param>
 public void GoInTeam(TeamObj _team)
 {
     //如果是己方队伍并且是被建造中未解锁的装载型队伍,则入队(Tank队伍不能入队)
     if (_team.nationality == teamObj.nationality && _team.soldiertype == WorldObj.SoldierType.Tank && _team.locking &&
         teamObj.soldiertype != WorldObj.SoldierType.Tank)
     {
         _team.UpdateTeamHero(teamObj.hero);
         _team.UpdateSoldierNumber(teamObj.soldiernumber);
         _team.UpdateSliderMaxValue(teamObj.soldiernumber);
         _team.UpdateSliderValue(teamObj.soldiernumber);
         _team.UpdateDriverSoldierType(teamObj.soldiertype);
         teamObj.DestroySelf(0f);
         //同步解锁被造队伍模型
         photonView.RPC("LockUnLockBuildingTeamRPC", PhotonTargets.All, newTeams.IndexOf(_team.gameObject), false);
         //如果该队伍是空军,则提高位置
         if (_team.features.Contains(WorldObj.TeamFeature.AirForce))
         {
             _team.transform.position += new Vector3(0f, 2f, 0f);
         }
     }
 }