public static void PlayerJoin(int camp, int roomID, C_BattleMgr battleMgr) { if (camp == 1) { if (playerListCamp1.ContainsKey(roomID)) { playerListCamp1[roomID] = battleMgr; } else { playerListCamp1.Add(roomID, battleMgr); } } else if (camp == 2) { if (playerListCamp2.ContainsKey(roomID)) { playerListCamp2[roomID] = battleMgr; } else { playerListCamp2.Add(roomID, battleMgr); } } }
public void Init(C_BattleMgr mgr) { var nickName = (mgr.nickName.ToString().Split('#'))[0]; nickName = mgr.velocity.isLocalPlayer ? ("<color=#ffcf69>" + nickName + "</color>") : nickName; this.Init( nickName, mgr.kill.ToString(), mgr.dead.ToString(), mgr.assists.ToString(), mgr.score.ToString() ); }
public void AddAttackSource(int sourceID) { var source = Battle.GetPlayerInfoByRoomID(sourceID, attributes.camp); if (source != null && attributes.HP > 0) { if (!sourceList.ContainsKey(sourceID)) { sourceList.Add(sourceID, Battle.GetPlayerInfoByRoomID(sourceID, attributes.camp)); } this.lastHitPlayer = source; } }
public override void Init(GameObject obj) { _uiMgr = obj.GetComponent <C_UiEventMgr>(); _camera = obj.GetComponent <C_Camera>(); _velocity = obj.GetComponent <C_Velocity>(); _iKManager = obj.GetComponent <C_IKManager>(); _photonView = obj.GetComponent <PhotonView>(); _attributes = obj.GetComponent <C_Attributes>(); _weaponHandle = obj.GetComponent <C_WeaponHandle>(); _battleMgr = obj.GetComponent <C_BattleMgr>(); _audio = GetComponent <AudioSource>(); _weaponAttribute = GetComponent <WeaponAttribute>(); timer = new Timer(); }