Esempio n. 1
0
        /// <summary>
        /// Starts an instance of rumbleIntensity at the given position.
        /// </summary>
        /// <returns>The spawned rumbleIntensity.</returns>
        /// <param name="position">Position to spawn the rumbleIntensity object.</param>
        /// <param name="rumbleInfo">RumbleIntensity info.</param>
        public RumbleSource StartRumble(Vector3 position, RumbleAsset rumbleAsset, float radius)
        {
            var rumble = this.SpawnRumble(rumbleAsset, radius);
            RegisterRumbleSource(rumble);
            rumble.transform.position = position;

            return rumble;
        }
Esempio n. 2
0
        private RumbleSource SpawnRumble(RumbleAsset rumbleAsset, float radius)
        {
            var rumbleObject = new GameObject(string.Concat("[RumbleIntensity] ", rumbleAsset.name));
            var rumble = rumbleObject.AddComponent<RumbleSource>();
            rumble.Initialize(rumbleAsset, radius);

            return rumble;
        }
Esempio n. 3
0
 public void Initialize(RumbleAsset rumbleAsset, float radius)
 {
     this.timeElapsed  = 0.0f;
     this.rumbleAsset  = rumbleAsset;
     this.circleBounds = new CircleBounds(this.transform.position, radius);
 }