Ejemplo n.º 1
0
    //public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers/taper_help.png"); }

    public override bool Inspector()
    {
        MegaSqueeze mod = (MegaSqueeze)target;

        EditorGUIUtility.LookLikeControls();
        mod.amount       = EditorGUILayout.FloatField("Amount", mod.amount);
        mod.crv          = EditorGUILayout.FloatField("Crv", mod.crv);
        mod.radialamount = EditorGUILayout.FloatField("Radial Amount", mod.radialamount);
        mod.radialcrv    = EditorGUILayout.FloatField("Radial Crv", mod.radialcrv);
        mod.doRegion     = EditorGUILayout.Toggle("Do Region", mod.doRegion);
        mod.from         = EditorGUILayout.FloatField("From", mod.from);
        mod.to           = EditorGUILayout.FloatField("To", mod.to);
        return(false);
    }
Ejemplo n.º 2
0
    //public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers\\taper_help.png"); }

    public override bool Inspector()
    {
        MegaSqueeze mod = (MegaSqueeze)target;

#if !UNITY_5 && !UNITY_2017 && !UNITY_2018 && !UNITY_2019 && !UNITY_2020
        EditorGUIUtility.LookLikeControls();
#endif
        mod.axis         = (MegaAxis)EditorGUILayout.EnumPopup("Axis", mod.axis);
        mod.amount       = EditorGUILayout.FloatField("Amount", mod.amount);
        mod.crv          = EditorGUILayout.FloatField("Crv", mod.crv);
        mod.radialamount = EditorGUILayout.FloatField("Radial Amount", mod.radialamount);
        mod.radialcrv    = EditorGUILayout.FloatField("Radial Crv", mod.radialcrv);
        mod.doRegion     = EditorGUILayout.Toggle("Do Region", mod.doRegion);
        mod.from         = EditorGUILayout.FloatField("From", mod.from);
        mod.to           = EditorGUILayout.FloatField("To", mod.to);
        return(false);
    }
Ejemplo n.º 3
0
    void Update()
    {
        float t =  120 * Time.deltaTime * timescale * stageTime;
        // Find the stretch msph
        if ( !msph )
        {
            msph = GetComponent<MegaSpherify>();
        }

        if ( msph )
        {

            if (per >= 0){
                swap = false;
                stageTime = 0.7f;
            }

            if(per <=-30){
                swap = true;
                stageTime = 0.3f;
            }

            if(swap){
                per = per + t;

            }
            if(!swap){
                per = per - t;
                }

                //delay update

            msph.percent = per;

            //Debug.Log(t);
        }
        //		Debug.Log(amt);
        // For Squeeze

        if ( !msqz )
        {
            msqz = GetComponent<MegaSqueeze>();

        }

        diff = uprev - defControl.def;

        if ( msqz )
        {

        //if (defControl.deprMM >= 20){
            if(diff != 0){

            amt = amt + diff * coefficientForSqueeze; //was 0.02f
            gRot = gRot - diff * gRotInc;

            uprev = defControl.def;

            transform.position = transform.position - new Vector3(0.0f*diff, -0.02f*diff, -0.03f*diff);

                }
            //else
            //amt = 0;
            //}

        //transform.position = transform.position + new Vector3(0.002*diff, 0.001*diff, 0.002*diff);

            msqz.amount = amt;
            //msqz.gizmoRot.Set(gRot.x,gRot.y,gRot.z);

        }
    }