private void Awake() { actionManager = GetComponent <ActionManager>(); _EffectEvent = GetComponentInChildren <RFX4_EffectEvent>(); swordMesh = GetComponentInChildren <UpdateSwordMesh>(); shieldMesh = GetComponentInChildren <UpdateShieldMesh>(); }
public void RangeAttack() { selectTarget(); if (selectUnit != null) { transform.GetChild(0).GetComponent <BoxCollider>().isTrigger = true; RFX4_EffectEvent ev = transform.GetChild(0).GetComponent <RFX4_EffectEvent>(); ev.OverrideAttachPointToTarget = selectUnit.transform.GetChild(1); ev.ActivateEffect(); //Vector3 SpawnSpellLoc = transform.position; //GameObject clone = Instantiate(rangeSpellPrefab, SpawnSpellLoc, Quaternion.identity); //clone.transform.GetComponent<RangeSpell>().Target = selectUnit; } }
public static RFX4_EffectEvent GetSpell(GameObject player, string spellName) { RFX4_EffectEvent spell = player.GetComponent <RFX4_EffectEvent>(); SpellProfile spellProfile; spellDictionary.TryGetValue(spellName, out spellProfile); if (spellProfile == null) { return(null); } if (spellProfile.CharacterEffect != null) { spell.CharacterEffect = spellProfile.CharacterEffect; spell.CharacterAttachPoint = GameObject.FindGameObjectWithTag(spellProfile.CharacterEffectAttachPoint).transform; spell.CharacterEffect_DestroyTime = spellProfile.CharacterEffectDestroyTime; } if (spellProfile.CharacterEffect2 != null) { spell.CharacterEffect2 = spellProfile.CharacterEffect2; spell.CharacterAttachPoint2 = GameObject.FindGameObjectWithTag(spellProfile.CharacterEffectAttachPoint2).transform; spell.CharacterEffect2_DestroyTime = spellProfile.CharacterEffectDestroyTime2; } if (spellProfile.MainEffect != null) { spell.MainEffect = spellProfile.MainEffect; spell.AttachPoint = GameObject.FindGameObjectWithTag(spellProfile.EffectAttachPoint).transform; spell.Effect_DestroyTime = spellProfile.EffectDestroyTime; } if (spellProfile.AdditionalEffect != null) { spell.AdditionalEffect = spellProfile.AdditionalEffect; spell.AdditionalEffectAttachPoint = GameObject.FindGameObjectWithTag(spellProfile.AdditionalEffectAttachPoint).transform; spell.AdditionalEffect_DestroyTime = spellProfile.AdditionalEffectDestroyTime; } return(spell); }
void DoSpell(string spellname) { if (GameController.Player.ManaCost(GameController.CurrentSpell.Cost)) { RFX4_EffectEvent effect = SpellStore.GetSpell(gameObject, spellname); SpellInfo info = SpellStore.GetInfo(spellname); _effect.CharacterEffect = effect.CharacterEffect; _effect.CharacterAttachPoint = effect.CharacterAttachPoint; _effect.CharacterAttachPoint2 = effect.CharacterAttachPoint2; _effect.CharacterEffect_DestroyTime = effect.CharacterEffect_DestroyTime; _effect.CharacterEffect2_DestroyTime = effect.CharacterEffect2_DestroyTime; _effect.MainEffect = effect.MainEffect; _effect.AttachPoint = effect.AttachPoint; _effect.AdditionalEffect = effect.AdditionalEffect; _effect.AdditionalEffectAttachPoint = effect.AdditionalEffectAttachPoint; _effect.AdditionalEffect_DestroyTime = effect.AdditionalEffect_DestroyTime; animator.SetTrigger(info.Animation); } else { } }
void Start() { _effect = GetComponent <RFX4_EffectEvent>(); animator = GetComponent <Animator>(); }