public void applyPassiveBuff()
 {
     if (buffSelector == buffs.speedBuff)
     {
         ScriptableSpeedBuff buff = (ScriptableSpeedBuff)ScriptableObject.CreateInstance(typeof(ScriptableSpeedBuff));
         buff.Duration      = Mathf.Infinity;
         buff.SpeedIncrease = 3;
         playerBuffs.AddBuff(buff.InitializeBuff(playerBuffs.gameObject));
     }
     else if (buffSelector == buffs.healthBuff)
     {
         ScriptableHealthBuff buff = (ScriptableHealthBuff)ScriptableObject.CreateInstance(typeof(ScriptableHealthBuff));
         buff.Duration       = Mathf.Infinity;
         buff.HealthIncrease = 10;
         playerBuffs.AddBuff(buff.InitializeBuff(playerBuffs.gameObject));
     }
     else if (buffSelector == buffs.shootBuff)
     {
         ScriptableShootSpeedBuff buff = (ScriptableShootSpeedBuff)ScriptableObject.CreateInstance(typeof(ScriptableShootSpeedBuff));
         buff.Duration           = Mathf.Infinity;
         buff.ShootSpeedIncrease = -0.9f;
         playerBuffs.AddBuff(buff.InitializeBuff(playerBuffs.gameObject));
     }
 }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     buffableEntity.AddBuff(speedBuff.InitializeBuff(buffableEntity.gameObject));
 }