private void RefillLight(GameObject player) { if (player.tag == "Player") { BuffableEntity buffs = player.GetComponent <BuffableEntity>(); PlayerController control = player.GetComponent <PlayerController>(); buffs.AddBuff(new TimedLightBuff(lightBuff.duration, lightBuff, player.gameObject)); control.ReFillLight(); } }
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)); } }
// Start is called before the first frame update void Start() { buffableEntity.AddBuff(speedBuff.InitializeBuff(buffableEntity.gameObject)); }