public void EquipSpell(RuntimeSpellItems spell) { currentSpell = spell; UI.QuickSlot uiSlot = UI.QuickSlot.singleton; uiSlot.UpdateSlot(UI.QSlotType.spell, spell.instance.icon); }
public RuntimeSpellItems SpellToRuntimeSpell(Spell s, bool isLeft = false) { GameObject go = new GameObject(); RuntimeSpellItems inst = go.AddComponent <RuntimeSpellItems>(); inst.instance = new Spell(); StaticFunctions.DeepCopySpell(s, inst.instance); go.name = s.itemName; r_spells.Add(inst); return(inst); }
public void CreateSpellParticle(RuntimeSpellItems inst, bool isLeft = false, bool parentUnderRoot = false) { if (inst.currentParticle == null) { inst.currentParticle = Instantiate(inst.instance.particle_prefab) as GameObject; inst.p_hook = inst.currentParticle.GetComponentInChildren <ParticleHook>(); inst.p_hook.Init(); } if (!parentUnderRoot) { Transform p = states.anim.GetBoneTransform((isLeft) ? HumanBodyBones.LeftHand : HumanBodyBones.RightHand); inst.currentParticle.transform.parent = p; inst.currentParticle.transform.localPosition = Vector3.zero; inst.currentParticle.transform.localRotation = Quaternion.identity; } else { inst.currentParticle.transform.parent = transform; inst.currentParticle.transform.localPosition = new Vector3(0f, 1f, .9f); inst.currentParticle.transform.localRotation = Quaternion.identity; } //inst.currentParticle.SetActive(false); }