Пример #1
0
    public void EquipMagicCaster(MagicCaster newCaster)
    {
        if (currentCaster != null)
        {
            Destroy(currentCaster.gameObject);
        }

        currentCaster = Instantiate(newCaster, weaponHold.position, weaponHold.rotation) as MagicCaster;
        currentCaster.transform.parent = weaponHold;
    }
Пример #2
0
        internal NiAVObject GetOverwriteMagicNode(MagicCaster caster)
        {
            if (!this.IsEnabled)
            {
                return(null);
            }

            if (caster == null)
            {
                return(null);
            }

            var actorCaster = caster.As <ActorMagicCaster>();

            if (actorCaster == null)
            {
                return(null);
            }

            var actor = actorCaster.Owner;

            if (actor == null || actor.FormId != this.LastTargetFormId)
            {
                return(null);
            }

            this.InitMagicNode();

            if (this.MagicNodes == null)
            {
                return(null);
            }

            switch (actorCaster.ActorCasterType)
            {
            case EquippedSpellSlots.LeftHand: return(this.MagicNodes[0]);

            case EquippedSpellSlots.RightHand: return(this.MagicNodes[1]);

            case EquippedSpellSlots.Other: return(this.MagicNodes[2]);
            }

            return(null);
        }