public virtual void Initialize(SpawnComponent spawnComponent) { this.SpawnComponent = spawnComponent; this.AgentVisualSpawnComponent = this.Mission.GetMissionBehaviour <MultiplayerMissionAgentVisualSpawnComponent>(); this.GameMode = this.Mission.GetMissionBehaviour <MissionMultiplayerGameModeBase>(); this.MissionLobbyComponent = this.Mission.GetMissionBehaviour <MissionLobbyComponent>(); this.MissionLobbyEquipmentNetworkComponent = this.Mission.GetMissionBehaviour <MissionLobbyEquipmentNetworkComponent>(); this.MissionLobbyEquipmentNetworkComponent.OnEquipmentRefreshed += new MissionLobbyEquipmentNetworkComponent.OnRefreshEquipmentEventDelegate(this.OnPeerEquipmentUpdated); }
public override void OnRemoveBehaviour() { if (!GameNetwork.IsDedicatedServer) { MultiplayerMissionAgentVisualSpawnComponent missionBehaviour = Mission.Current.GetMissionBehaviour <MultiplayerMissionAgentVisualSpawnComponent>(); missionBehaviour.OnMyAgentVisualSpawned -= new Action(this.OpenLoadout); missionBehaviour.OnMyAgentSpawnedFromVisual -= new Action(this.CloseLoadout); missionBehaviour.OnMyAgentVisualRemoved -= new Action(this.CloseLoadout); } base.OnRemoveBehaviour(); }
public override void OnBehaviourInitialize() { base.OnBehaviourInitialize(); this._playerEquipments = new Dictionary <MissionPeer, Equipment>(); this._playerChests = new Dictionary <MissionPeer, MissionLobbyEquipmentChest>(); if (GameNetwork.IsDedicatedServer) { return; } MultiplayerMissionAgentVisualSpawnComponent missionBehaviour = Mission.Current.GetMissionBehaviour <MultiplayerMissionAgentVisualSpawnComponent>(); missionBehaviour.OnMyAgentVisualSpawned += new Action(this.OpenLoadout); missionBehaviour.OnMyAgentSpawnedFromVisual += new Action(this.CloseLoadout); missionBehaviour.OnMyAgentVisualRemoved += new Action(this.CloseLoadout); }