Ejemplo n.º 1
0
    public void EquipSpell(RuntimeSpellItem s)
    {
        currentSpell = s;

        UI.QuickSlot uiSlot = UI.QuickSlot.singleton;
        Item         i      = ResourcesManager.singleton.GetItem(s.instance.item_id, ItemType.spell);

        uiSlot.UpdateSlot(UI.QSlotType.spell, i.icon); //pass icon
    }
Ejemplo n.º 2
0
    public RuntimeSpellItem SpellToRuntimeSpell(Spell s, bool isLeft = false)
    {
        GameObject       go   = new GameObject();
        RuntimeSpellItem inst = go.AddComponent <RuntimeSpellItem>();

        inst.instance = new Spell();
        StaticFunctions.DeepCopySpell(s, inst.instance);
        go.name = s.item_id;


        r_spells.Add(inst);
        return(inst);
    }
Ejemplo n.º 3
0
    public void CreateSpellParticle(RuntimeSpellItem inst, bool isLeft = false, bool parentUnderRoot = false)
    {
        if (inst.currentParticle == null)
        {
            inst.currentParticle = Instantiate(inst.instance.particlePrefab) 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.localRotation = Quaternion.identity;
            inst.currentParticle.transform.localPosition = Vector3.zero;
        }
        else
        {
            inst.currentParticle.transform.parent        = transform;
            inst.currentParticle.transform.localRotation = Quaternion.identity;
            inst.currentParticle.transform.localPosition = new Vector3(0, 1.5f, .9f);
        }
    }