// get refs at start private void Start() { commentator = _AudioMaster.inst.gameObject.transform.GetChild(1).GetComponent <Commentator>(); fire_particles = transform.Find("Particle_System_Fire").GetComponent <ParticleSystem>(); fire_particles.Play(); bomb = GetComponent <BombFlash>(); rb2 = GetComponent <Rigidbody2D>(); tr = GetComponent <TrailRenderer>(); trigger = GetComponent <CircleCollider2D>(); numbers = GameObject.FindGameObjectsWithTag("Numbers"); vis = transform.Find("Visual").gameObject; col = vis.GetComponent <CircleCollider2D>(); if (GameObject.FindGameObjectWithTag("MainCamera") != null) { cameraShake = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraShake>(); } start_pos = transform.position; orig_start_color = tr.startColor; orig_end_color = tr.endColor; timeToAnim = pauseAnimation; animRemaining = animTime; if (transform.Find("Zoom Collider") != null) { goalZoom = transform.Find("Zoom Collider").GetComponent <GoalZoom>(); } team_id = -1; if (Observer.Instance != null) { Observer.Instance.PickedUpBall(team_id); } }
IEnumerator WaitForZoomOut(GoalZoom goalZoom) { yield return(new WaitForSecondsRealtime(.5f)); goalZoom.ZoomOut(); }