private void SetupVFX() { SwordSwingVFX.Stop(); SwordSwingVFX.transform.localScale = Vector3.one * CurrentAttacks[AttackIndex].Radius * (CurrentAttacks[AttackIndex].AngleOffset < 0 ? -1f : 1f); SwordSwingVFX.transform.localRotation = (Quaternion.Euler(0, (CurrentAttacks[AttackIndex].AngleOffset < 0 ? 180 : 0), 90)); ParticleSystem.MainModule main = SwordSwingVFX.main; main.simulationSpeed = VFXSimulationSpeed; //Cached our sword mat, if anything start bugging out, replace swordswingmat with GetComponent swordSwingMat = CurrentAttacks[AttackIndex].VFXSwingMaterial; SwordSwingVFX.GetComponent <ParticleSystemRenderer>().material.SetFloat("_IntensityBlend", currentAttackGrade == RhythmGrade.Miss ? 0 : 1); Debug.Log("Grade is: " + swordSwingMat.GetFloat("_IntensityBlend")); }
public override void Initialize(object owner) { base.Initialize(owner); swordSwingMat = SwordSwingVFX.GetComponent <ParticleSystemRenderer>().material; }