void LateUpdate() { if (_unit_ID.IsReady()) { initalize(); } }
void Update() { _smoke.SetActive(ISActive); switch (spawnedCharacter) { case MinionType.Ghost: _smoke.transform.position = _spawnPointGhost.transform.position; break; case MinionType.Warrior: _smoke.transform.position = _spawnPointWarrior.transform.position; break; case MinionType.Wizard: _smoke.transform.position = _spawnPointWizard.transform.position; break; default: break; } if (IsInit || !_unitId.IsReady()) { return; } IsInit = true; _spawnPointGhost.GetComponent <Renderer>().material.mainTexture = _texturesSpawnColorGhost[_unitId.GetPlayerIndex() - 1]; _spawnPointWarrior.GetComponent <Renderer>().material.mainTexture = _texturesSpawnColorWarrior[_unitId.GetPlayerIndex() - 1]; _spawnPointWizard.GetComponent <Renderer>().material.mainTexture = _texturesSpawnColorWizard[_unitId.GetPlayerIndex() - 1]; _portal.GetComponent <Renderer>().material.mainTexture = _texturesSpawnColorPortal[_unitId.GetPlayerIndex() - 1]; }
void Update() { if (IsInit || !unitID.IsReady()) { return; } IsInit = true; GameObject player = GameSharedData.GetLocalPlayer(); // don't do it for other players /* if (player.GetComponent<Unit_ID>().GetPlayerIndex() != GetComponent<Unit_ID>().GetPlayerIndex()) * { * enabled = false; * return; * }*/ Swipeable swipeable = GetComponent <Swipeable>(); swipeable.onSwipe = OnSwipe; swipeable.onTouched = OnTouched; }