void Awake() { unitId = GetComponent<Unit_ID>(); if (!isServer) { return; } }
void Awake() { unitId = GetComponent <Unit_ID>(); if (!isServer) { return; } }
public override void OnStartServer() { _destructible = GetComponent <Destructible>(); navAgent = GetComponent <NavMeshAgent>(); _unit_ID = GetComponent <Unit_ID>(); _destructible.CmdSetMaxLife(minionsInformations.baseLifePoints); _destructible.HandleDestroyed += OnDie; _destructible.HandleAlive += OnAlive; }
public static GameObject GetPlayerNumberNext(Unit_ID playerInit, int numberToIncrement) { // Avoid overlaping yourself numberToIncrement = Mathf.Clamp(numberToIncrement, 0, GameSharedData.NumberOfPlayer - 1); int pos = 0; // Find your position in the table foreach (var v in GetAllPlayers) { if (v.GetComponent<Unit_ID>().GetPlayerIndex() == playerInit.GetPlayerIndex()) { break; } pos++; } int playerId = (pos + numberToIncrement) % (GameSharedData.NumberOfPlayer); return GetAllPlayers[playerId]; }
public static GameObject GetLocalPlayer() { GameObject tofind; if (Camera.main.transform.position.x > 0 && Camera.main.transform.position.z > 0) { tofind = Unit_ID.FindPlayer(2); } else if (Camera.main.transform.position.x < 0 && Camera.main.transform.position.z > 0) { tofind = Unit_ID.FindPlayer(3); } else if (Camera.main.transform.position.x > 0 && Camera.main.transform.position.z < 0) { tofind = Unit_ID.FindPlayer(1); } else //if (Camera.main.transform.position.x < 0 && Camera.main.transform.position.y < 0) { tofind = Unit_ID.FindPlayer(4); } return(tofind); /* * if (localPlayer) * { * return localPlayer; * } * * foreach (GameObject player in GameSharedData.GetAllPlayers) * { * if (player.GetComponent<PlayerNetwork>().connectionId == LANLobbyNetworkManager.singleton.client.connection.connectionId) * { * localPlayer = player; * } * } * * return localPlayer;*/ }
public static GameObject GetPlayerNumberNext(Unit_ID playerInit, int numberToIncrement) { // Avoid overlaping yourself numberToIncrement = Mathf.Clamp(numberToIncrement, 0, GameSharedData.NumberOfPlayer - 1); int pos = 0; // Find your position in the table foreach (var v in GetAllPlayers) { if (v.GetComponent <Unit_ID>().GetPlayerIndex() == playerInit.GetPlayerIndex()) { break; } pos++; } int playerId = (pos + numberToIncrement) % (GameSharedData.NumberOfPlayer); return(GetAllPlayers[playerId]); }
void Awake() { _unit_ID = GetComponent <Unit_ID>(); minionSoundControler = GetComponent <SoundableMinion>(); }
void Awake () { DontDestroyOnLoad(gameObject); _unitID = GetComponent<Unit_ID>(); }
public void CmdSpawnUnit(MinionType _typeToSpawn) { Unit_ID.FindPlayer(_unit_ID.GetPlayerIndex()).GetComponent <SpawnerController>().spawnedCharacter = _typeToSpawn; }
void Start() { _unit_ID = GetComponent <Unit_ID>(); }
void Start() { _playerNetwork = GetComponent<PlayerNetwork>(); _unitID = GetComponent<Unit_ID>(); }
void Start() { _playerNetwork = GetComponent <PlayerNetwork>(); _unitID = GetComponent <Unit_ID>(); }
// Use this for initialization void OnEnable () { _unitId = GetComponent<Unit_ID>(); Invoke("FirstSpawn", spawnerInformations.TimeBeforeFirstLaunch + 1); }
public override void OnStartServer() { _destructible = GetComponent<Destructible>(); navAgent = GetComponent<NavMeshAgent>(); _unit_ID = GetComponent<Unit_ID>(); _destructible.CmdSetMaxLife(minionsInformations.baseLifePoints); _destructible.HandleDestroyed += OnDie; _destructible.HandleAlive += OnAlive; }
void Awake() { _unit_ID = GetComponent<Unit_ID>(); minionSoundControler = GetComponent<SoundableMinion>(); }
// Use this for initialization void OnEnable() { _unitId = GetComponent <Unit_ID>(); Invoke("FirstSpawn", spawnerInformations.TimeBeforeFirstLaunch + 1); }
void Awake() { DontDestroyOnLoad(gameObject); _unitID = GetComponent <Unit_ID>(); }
void Start() { _unit_ID = GetComponent<Unit_ID>(); }