public void Start() { Input.gyro.enabled = true; cameraState = CameraState.IDLE; cameraAudio = GetComponent <CameraAudio>(); playedSwoosh = false; }
private void Awake() { this.rigidbody = GetComponent <Rigidbody>(); if (rigidbody == null) { rigidbody = gameObject.AddComponent <Rigidbody>(); } rigidbody.isKinematic = true; launchSFX = GetComponent <AudioSource>(); Audio = MainCameraOverride.Instance.GetComponent <CameraAudio>();// }
// Use this for initialization public override void Start() { target = GameObject.FindGameObjectWithTag("Player").transform; base.Start(); IsHoming = false; //If we're not a homing missile, we go the max speed if (Random.Range(0.0f, 1.0f) <= HomingChance) { IsHoming = true; } else { SetVelocity(SpeedMax); } Audio = FindObjectOfType <CameraAudio>(); /* * sounds = GetComponents<AudioSource>(); * hit1 = sounds[0]; * hit2 = sounds[1]; */ }