// Use this for initialization void Start() { mNextShotTimeSeconds = Time.time + 5; // Wait 5 seconds before firing next shot // The droid will rise directly above its spawn location to a random height. Vector3 firstTargetLocation = new Vector3(transform.position.x, BASE_TARGET_LOCATION_HEIGHT + (Random.value * TARGET_LOCATION_HEIGHT_OFFSET), transform.position.z); SetTargetLocation(firstTargetLocation); mIsMovementActive = true; mPushable = GetComponent <Pushable>(); mPushable.Pushed += OnPushed; mLiftable = GetComponent <Liftable>(); mLiftable.Lifted += OnLifted; mLightningable = GetComponent <Lightningable>(); mLightningable.Lightninged += OnLightninged; mDestroyable = GetComponent <Destroyable>(); mDestroyable.Destroyed += Explode; mAudioSource = GetComponent <AudioSource>(); mAudioSource.clip = HoverLoopClip; mAudioSource.Play(); }
void Start() { mIsMovementActive = true; mPushable = GetComponent <Pushable>(); mPushable.Pushed += OnPushed; mLightningable = GetComponent <Lightningable>(); mLightningable.Lightninged += OnLightninged; }