// Use this for initialization void Start() { animator = GetComponent <Animator>(); controller = GetComponent <CharacterController>(); // Battle magicSpawnPosition = GameObject.Find("MagicSpawn").GetComponent <Transform>(); // Chat chatSystem = GameObject.FindObjectOfType <ChatSystem>(); chatIdentifier = GameObject.FindObjectOfType <ChatIdentifier>(); }
// Use this for initialization void Start() { animator = GetComponent <Animator>(); controller = GetComponent <CharacterController>(); magicSpawnPosition = GameObject.Find("ExcaliburSawn").GetComponent <Transform>(); //if(GameObject.Find("NaokoStaff_Player")){ // Debug.Log("find naoko"); yuriPushBackScript = GameObject.Find("BattleManager").GetComponent <YuriPushBack>(); //} // Chat chatSystem = GameObject.FindObjectOfType <ChatSystem>(); chatIdentifier = GameObject.FindObjectOfType <ChatIdentifier>(); }
//private List<PlayerController> cachedPlayers; void Start() { networkClient = NetworkManager.singleton.client; chatPanelIdentifier = GameObject.FindObjectOfType <ChatIdentifier>(); contentPanel = chatPanelIdentifier.GetComponentInChildren <ContentSizeFitter>(); canvasGroup = GetComponent <CanvasGroup>(); NetworkServer.RegisterHandler(messageChannel, ReceivedMessage); chatMessages.Callback += OnChatMessagesUpdated; messagesOnUI = new List <UIChatMessage>(); ForceCloseChat(); //uncomment this only if you are trying to maintain local cache of players. Doing this requires a bit of extra work and creating a custom //NetworkManager class. If you do not want to do this, the chat system will still work. //cachedPlayers = new List<PlayerController>(GameObject.FindObjectsOfType<PlayerController>()); }
private const uint TERRORIST_INDEX = 3; // the channel index for terrorists void Start() { if (!isLocalPlayer) { this.enabled = false; } chatSystem = GameObject.FindObjectOfType <ChatSystem>(); chatIdentifier = GameObject.FindObjectOfType <ChatIdentifier>(); teamIdentifier = GameObject.FindObjectOfType <TeamIdentifier>(); nameSetter = GameObject.Find("Player Name Setter").GetComponent <InputField>(); nameSetter.onEndEdit.AddListener(value => { name = value; }); }