public void CastSpell() { if (currentCooldown <= 0.0f) { MouseController mouse = GetComponent <MouseController>(); if (mouse) { mouse.AlignRotation(); } Spell cntSpell = spellPossession[currentSpellNum].spell; photonView.RPC("InstantiateSpell", PhotonTargets.All, currentSpellNum); currentCooldown = cntSpell.cooldownTime; } }
void castCurrentSpell() { if (currentCooldown <= 0.0f) { MouseController mouse = GetComponent <MouseController>(); if (mouse) { mouse.AlignRotation(); } Spell cntSpell = spellPossession[currentSpellNum].spell; GameObject cntPrefab = prefabs[cntSpell.prefabType]; Vector3 instantiatePos = (transform.position + new Vector3(0.0f, spellHeight, 0.0f)) + transform.forward; Instantiate(cntPrefab, instantiatePos, transform.rotation); currentCooldown = cntSpell.cooldownTime; } }