void Awake()
 {
     gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>();
     shootBall      = GameObject.FindObjectOfType <ShootBalloon>();
     ballDetector   = GameObject.FindObjectOfType <BallDetector>();
     attackUI       = GameObject.FindObjectOfType <AttackUIActions>();
     spawnManager   = GameObject.FindObjectOfType <SpawnManager>();
     spawnManager.GenerateRandomShootPosition();
     whistleSource = GetComponent <AudioSource>();
 }
Exemple #2
0
 private void Awake()
 {
     ballRigidBody    = GameObject.FindGameObjectWithTag("Ball").GetComponent <Rigidbody>();
     objectsTransform = (Replay[])FindObjectsOfType(typeof(Replay));
     attackUI         = GameObject.FindObjectOfType <AttackUIActions>();
     hands            = GameObject.FindGameObjectsWithTag("goalHand");
     foreach (GameObject hand in hands)
     {
         handsCollider.Add(hand.GetComponent <Collider>());
     }
 }