public void CreateGamePlayers() { GameObject gamePlayer = null; Transform tf = null; UIGamePlayer script = null; for (int i = 0; i < RoomModel.MAX_GAME_PLAYER_COUNT; i++) { gamePlayer = Instantiate(gamePlayerPrefab, Vector3.zero, Quaternion.identity); tf = gamePlayer.transform; tf.SetParent(gamePlayersParent.transform); tf.localPosition = positions[i]; tf.localScale = new Vector2(2, 2); script = gamePlayer.GetComponent <UIGamePlayer>(); script.ChairIndex = i; script.view = this; SetTimelineUI(script); gamePlayer.SetActive(false); this.gamePlayers[i] = script; } }
protected new void Start() { base.Start(); uIGamePlayer = FindObjectOfType <UIGamePlayer>(); uIGamePlayer.SetConfigEnemy(health, enemyName, true); }
public void OnUpateUI(GamePlayerModel model) { UIGamePlayer component = GetGamePlayersByChairIndex(model.chairIndex); if (component != null) { component.UpdateGamePlayer(model); } }
public void ShowOwnCards(int chairIndex) { UIGamePlayer component = GetGamePlayersByChairIndex(chairIndex); if (component != null) { component.ShowOwnCard(); component.ShowDelarMark(); } }
public UIGamePlayer GetGamePlayersByChairIndex(int chairIndex) { UIGamePlayer gamePlayer = null; if (chairIndex >= 0 && chairIndex <= this.gamePlayers.Length - 1) { gamePlayer = this.gamePlayers[chairIndex]; } return(gamePlayer); }
private void SetTimelineUI(UIGamePlayer script) { script.SetTimeLine(timelineAnimationControllers[0]); }