コード例 #1
0
        public float MaxSpeedBoost;      //the maximum amount we can speed up by

        /// Uses the status effect
        public override void StartStatusEffect(PlayerParameters player)
        {
            Debug.Log("<color=cyan>Using </color>" + StatusEffectName.ToString() + " on " + player.name + "!");

            if (SpeedBoost < MinSpeedBoost || SpeedBoost > MaxSpeedBoost || SpeedBoost == 0)
            {
                Debug.Log("<color=red><b>SpeedBoost is not within acceptable range. Setting to halfway point.</b></color>");
                SpeedBoost = (MinSpeedBoost + MaxSpeedBoost) / 2;
            }

            player.ApplyStatusEffect(this);
            player.GetComponent <PlayerMovement> ().SpeedUp(SpeedBoost, Duration);
        }
コード例 #2
0
        public float MaxTimeChange = 10.0f;  //the maximum amount we can speed up by

        /// Uses the status effect
        public override void StartStatusEffect(PlayerParameters player)
        {
            Debug.Log("<color=cyan>Using </color>" + StatusEffectName.ToString() + " on " + player.name + "!");

            if (TimeChange < MinTimeChange || TimeChange > MaxTimeChange)
            {
                Debug.Log("<color=red><b>TimeScale is not within acceptable range. Setting to halfway point.</b></color>");
                TimeChange = (MinTimeChange + MaxTimeChange) / 2;
            }

            player.ApplyStatusEffect(this);
            player.TimeScaleChange(TimeChange, Duration);
        }
コード例 #3
0
//		#region Enums
//		public enum ActiveEffects{
//			//Movement
//			SpeedBoost,
//			SpeedSlow,
//			//Jumping
//			GravityUp,
//			GravityDown,
//			//Time Scale
//			TimeSpeedUp,
//			TimeSlowdown,
//		}
//
//		public enum PassiveEffects{
//			SpeedUp,
//			SpeedDown,
//			//Features
//			DoubleJump,
//		}
//		#endregion Enums

        #region Functions
        /// Starts the status effect.
        public virtual void StartStatusEffect(PlayerParameters player)
        {
            player.ApplyStatusEffect(this);
        }