private void Awake() { buildCostText = transform.Find("Canvas").GetChild(0).GetChild(2).GetComponentInChildren <TMPro.TextMeshProUGUI>(); buildCostObject = buildCostText.transform.parent.gameObject;; buttonPress = transform.Find("Canvas").GetChild(0).GetChild(0).GetComponent <ButtonPress>(); buttonPressObject = buttonPress.gameObject; spamKeyMinigame = transform.Find("Canvas").GetChild(0).GetChild(1).GetComponent <SpamKeyMinigame>(); spamKeyBold = spamKeyMinigame.gameObject; photonView = GetComponent <PhotonView>(); }
private void Awake() { myGameObject = gameObject; animator = GetComponent <Animator>(); photonView = GetComponent <PhotonView>(); buildCostText = transform.Find("Canvas").GetChild(0).GetChild(2).GetComponentInChildren <TMPro.TextMeshProUGUI>(); buildCostObject = buildCostText.transform.parent.gameObject; buttonPress = transform.Find("Canvas").GetChild(0).GetChild(0).GetComponent <ButtonPress>(); buttonPressObject = buttonPress.gameObject; spamKeyMinigame = transform.Find("Canvas").GetChild(0).GetChild(1).GetComponent <SpamKeyMinigame>(); spamKeyBold = spamKeyMinigame.gameObject; NetworkManager.OnGameStart += OnGameStart; }