public void cast() { GameObject voltage = GameObject.Instantiate(highVoltage, gameObject.transform.position + transform.forward, gameObject.transform.rotation); HighVoltageLogic voltageLogic = voltage.GetComponent <HighVoltageLogic>(); voltageLogic.SetOwner(gameObject); }
public override void cast(string smName) { SpellModificator sm = gameObject.GetComponent <SpellCreating> ().getModIfExists(smName); Vector3 spellSpawnPos = gameObject.transform.position + transform.forward; GameObject voltage = GameObject.Instantiate(highVoltage, spellSpawnPos, gameObject.transform.rotation); HighVoltageLogic voltageLogic = voltage.GetComponent <HighVoltageLogic>(); if (sm != null && sm is RepeatModificator) { float wait = ((RepeatModificator)sm).wait; StartCoroutine(repeatCast(wait, spellSpawnPos, gameObject.transform.rotation)); } else { voltageLogic.ApplyModificator(sm); } voltageLogic.SetOwner(gameObject); }