public BotListViewItem(string name, int index, AddBotConfig add, BotConfig cfg) : base(name) { lock (this) { var bot = BotFactory.Instance.CreateBotRunner(cfg, add, name); this.Client = bot.Client; this.Runner = bot; this.Events = new StringBuilder(); this.Runner.Client.IsAutoUpdateBattle = true; if (cfg.NoBattleView == false) { this.BattleView = new BotGamePanelContainer(bot); this.BattleView.AutoUpdateBattleClient = false; this.BattleView.Init(this.Client); this.BattleView.Dock = DockStyle.Fill; } this.Tag = bot; var colums = bot.Columns; for (int i = 1; i < colums.Length; i++) { this.SubItems.Add(colums[i]); } } }
public void LoadInterface() { gpc = FindObjectOfType <GamePanelContainer>(); PhotonPlayer[] photonPlayers = PhotonNetwork.playerList; for (int i = 0; i < photonPlayers.Length; i++) { gpc.PlayerJoinedInterface(photonPlayers[i]); } }
private void Awake() { gameObject.AddComponent <PlayerControlsKeyBoard>(); photonViewer = GetComponent <PhotonView>(); Keys = GetComponent <PlayerControls>(); currentCharacter = GetComponent <Character>(); healthController = GetComponent <Health>(); playerController = GetComponent <PlayerController>(); animator = GetComponent <Animator>(); myColor = new Color((float)photonViewer.owner.CustomProperties["pColorR"], (float)photonViewer.owner.CustomProperties["pColorG"], (float)photonViewer.owner.CustomProperties["pColorB"]); netPlayer = photonViewer.owner; gpc = FindObjectOfType <GamePanelContainer>(); gpc.playerPanels.Find(x => x.photonPlayer == netPlayer).playerBase = this; gpc.playerPanels.Find(x => x.photonPlayer == netPlayer).UpdateUI(); playerBody = transform.Find("pivot").gameObject; GameManager.Instance.Players.Add(this); if (PhotonNetwork.isMasterClient) { ScoreManager.Instance.AddPlayer(netPlayer, this); } attackParticles = Instantiate(attackParticles, playerBody.transform, false); swingObject = Instantiate(swingObject, playerBody.transform, false); blockObject = Instantiate(blockObject, playerBody.transform, false); PlayerHitParticle = Instantiate(PlayerHitParticle, playerBody.transform, false); HitParticleSystem = PlayerHitParticle.GetComponent <ParticleSystem>(); if (PlayerHealParticle != null) { PlayerHealParticle = Instantiate(PlayerHealParticle, playerBody.transform, false); HealParticleSystem = PlayerHealParticle.GetComponent <ParticleSystem>(); } PlayerNameObject = Instantiate(PlayerNameObject); PlayerNameObject.GetComponent <PlayerName>().SetTarget(this, myColor); }