void Start() { vm = GameObject.Find("Managers").GetComponent <VariableManager> (); tm = GameObject.Find("Managers").GetComponent <TextManager> (); sbt = GameObject.Find("Managers").GetComponent <SetBowlingText> (); try{ bm = GameObject.Find("Bowling Manager").GetComponent <BowlingManager> (); vm.SetFastBowling(bm.GetFastBowling()); vm.SetSpinBowling(bm.GetSpinBowling()); vm.SetFastSpin(bm.GetFastSpinBowling()); if (bm.GetFastSpinBowling()) { vm.SetFastBowling(true); // for first over; } StartCoroutine(WaitAndSetText()); Destroy(GameObject.Find("Bowling Manager")); } catch (NullReferenceException e) { print("GameObject could not be found"); //GameObject.Find ("Managers").RemoveComponent (); } }
void Awake() { sbt = GameObject.Find("Managers").GetComponent <SetBowlingText> (); hapticFeedbackFlag = false; audio = GameObject.Find("Managers").GetComponent <AudioSource> (); launchPad = GameObject.Find("Launch Pad"); controller = GameObject.Find("Controller (right)"); vm = this.gameObject.GetComponent <VariableManager> (); ballCount = vm.GetBallCount(); bouncerCount = vm.GetBouncerCount(); tm = this.gameObject.GetComponent <TextManager> (); position = launchPad.transform.position; }