private void UpdateMovementValues(MovementMagicCircle mmc)
    {
        switch (mmc.GetMovement())
        {
        case MovementType.Control:
        {
            movementData.SetMaxForce(50);
            movementData.SetMinForce(0);
            break;
        }

        case MovementType.Path:
        {
            goto case MovementType.Control;
        }

        case MovementType.Push:
        {
            movementData.SetMaxForce(5);
            movementData.SetMinForce(-5);
            break;
        }

        default:
        {
            goto case MovementType.Push;
        }
        }
    }
Пример #2
0
 public void SetCurrentMovementController(MovementMagicCircle mmc)
 {
     // if( movementController != null )
     // {
     // movementController.GiveUpPsMoveControl();
     movementController = mmc;
     // }
 }
    public void OnMovementDragMagicChanged(bool value)
    {
        MovementMagicCircle mmc = (MovementMagicCircle)selectedSpellNode;

        if (mmc != null)
        {
            mmc.dragMagic = movementData.ShouldDragMagic();
        }
    }
    public void OnMovementAngleChange(float value)
    {
        movementData.OnAngleChanged();
        MovementMagicCircle mmc = (MovementMagicCircle)selectedSpellNode;

        if (mmc != null)
        {
            mmc.directionAngle.SetDefaultValue(movementData.GetAngle());
        }
    }
    public void OnMovementForceChange(float value)
    {
        movementData.OnForceChanged();
        MovementMagicCircle mmc = (MovementMagicCircle)selectedSpellNode;

        if (mmc != null)
        {
            mmc.force.SetDefaultValue(movementData.GetForce());
        }
    }
    public void OnMovementInitialVelocityChange(float value)
    {
        movementData.OnInitialVelocityChanged();
        MovementMagicCircle mmc = (MovementMagicCircle)selectedSpellNode;

        if (mmc != null)
        {
            mmc.initialVelocity.SetDefaultValue(movementData.GetInitialVelocity());
        }
    }
    public void OnMovementChanged(int value)
    {
        MovementMagicCircle mmc = (MovementMagicCircle)selectedSpellNode;

        if (mmc != null)
        {
            mmc.SetMovement(movementData.GetMovement());
            UpdateMovementValues(mmc);
        }
    }
    public void OnMovementUILoad()
    {
        // public UnityEngine.UI.Slider initialVelocity;
        // public UnityEngine.UI.InputField initialVelocityInput;
        // public UnityEngine.UI.Slider force;
        // public UnityEngine.UI.InputField forceInput;
        // public UnityEngine.UI.Slider angle;
        // public UnityEngine.UI.InputField angleInput;
        // public UnityEngine.UI.Toggle dragMagic;
        // public Dropdown movement;
        MovementMagicCircle mmc = (MovementMagicCircle)selectedSpellNode;

        if (mmc != null)
        {
            UpdateMovementValues(mmc);
            movementData.SetInitialVelocity(mmc.initialVelocity.Value());
            movementData.SetForce(mmc.force.Value());
            movementData.SetAngle(mmc.directionAngle.Value());
            movementData.SetMovement(mmc.GetMovement());
            movementData.dragMagic.isOn = mmc.dragMagic;
        }
    }
Пример #9
0
 public bool IsCurrentMoveController(MovementMagicCircle mmc)
 {
     return(mmc == movementController);
 }
Пример #10
0
    public void OnCreateMC()
    {
        if (spell == null)
        {
            CreateSpell();
        }
        if (rootMagicCircle == null || !rootMagicCircle.Contains((int)mcType))
        {
            if (mcType == MagicCircleType.None)
            {
                rootMagicCircle = null;
            }
            OnEmissionRateChanged(value1Slider.value);
            Transform pos = rootMagicCircle == null ? defaultMagicCircle.transform : rootMagicCircle.transform;
            // GameObject newObj = Instantiate( defaultMagicCircle, pos ) as GameObject;
            // newObj.name = mcType.ToString() + " Magic Circle";
            SpellNode newNode = spell.AddNode(mcType);
            newNode.name = mcType.ToString() + " Magic Circle";
            MagicCircle newMc;
            switch (mcType)
            {
            case MagicCircleType.Element:
                ElementMagicCircle tempMC = newNode as ElementMagicCircle;
                // tempMC.SetMcType( mcType );
                tempMC.SetElement((ElementType)subType);
                tempMC.emissionRate.SetDefaultValue(emissionRate);
                newMc = tempMC as MagicCircle;
                break;

            case MagicCircleType.Form:
                FormMagicCircle tempFormMC = newNode as FormMagicCircle;
                // tempMC.SetMcType( mcType );
                // tempMC.SetElement( (ElementType) subType );
                tempFormMC.SetForm((FormType)subType);
                tempFormMC.sizeMultiplier.SetDefaultValue(sizeMultiplier);
                newMc = tempFormMC as MagicCircle;
                break;

            case MagicCircleType.Movement:
                MovementMagicCircle tempMovementMC = newNode as MovementMagicCircle;
                // tempMC.SetMcType( mcType );
                // tempMC.SetElement( (ElementType) subType );
                tempMovementMC.SetMovement((MovementType)subType);
                tempMovementMC.force.SetDefaultValue(force);
                newMc = tempMovementMC as MagicCircle;
                break;

            default:
                newMc = newNode as MagicCircle;
                newMc.SetMcType(mcType);
                break;
            }
            if (rootMagicCircle == null)
            {
                rootMagicCircle = newMc;
            }
            else
            {
                // rootMagicCircle.AddMagicCircle( newMc );
            }
            selectedMagicCircle = newMc;
        }
    }