Esempio n. 1
0
        protected override void GUIUpdate()
        {
            EditorGUI.BeginChangeCheck();
            {
                EditorGUILayout.BeginVertical();
                {
                    EditorGUI.BeginChangeCheck();
                    filterMode = (FilterMode)EditorGUILayout.EnumPopup(filterMode);
                    if (EditorGUI.EndChangeCheck())
                    {
                        texture.filterMode = filterMode;
                    }
                    gradient = (Gradient)gradientField.Invoke(null, new object[] { "", gradient, null });
                    if (oldGradient != null && !gradient.Compare(oldGradient))
                    {
                        needUpdate = true;
                    }
                    if (e.type == EventType.Repaint)
                    {
                        update = false;
                    }
                }
                EditorGUILayout.EndVertical();

                if (e.type == EventType.KeyDown)
                {
                    if (e.keyCode == KeyCode.Return || e.keyCode == KeyCode.KeypadEnter || e.keyCode == KeyCode.Escape)
                    {
                        e.Use();
                    }
                }

                EditorGUIUtility.labelWidth = 100;
                debug = EditorGUILayout.Toggle("debug", debug);
            }
            if (EditorGUI.EndChangeCheck())
            {
                SendUpdate("SamplerSettingsUpdate");
            }

            if (needUpdate && e.type != EventType.Layout)
            {
                GUI.changed = true;
                needUpdate  = false;

                //for an unknown reason, EditorWindow.SendEvent dooes not works with gradient field
                //so here is a workaround to update the main window:
                if (windowToUpdate != null)
                {
                    update = true;
                    windowToUpdate.Repaint();
                }
            }

            oldGradient = (SerializableGradient)gradient;
        }
Esempio n. 2
0
            // Can't save textures easily

            public EDSettings(BladeEdgeDetection edgeDetection)
            {
                this.edgeColorMode = edgeDetection.edgeColorMode;
                this.edgeColor     = edgeDetection.edgeColor;

                this.edgeColorGradient = new Gradient {
                    alphaKeys = edgeDetection.edgeColorGradient.alphaKeys,
                    colorKeys = edgeDetection.edgeColorGradient.colorKeys,
                    mode      = edgeDetection.edgeColorGradient.mode
                };
            }
Esempio n. 3
0
    internal override void Bind(SandboxValue sandboxValue)
    {
        base.valueReference             = sandboxValue;
        gradient                        = (SerializableGradient)sandboxValue.get();
        _components.gradientLeft.color  = gradient.left.color;
        _components.colorLeft.color     = gradient.left.color;
        _components.gradeintRight.color = gradient.right.color;
        _components.colorRight.color    = gradient.right.color;

        wUITipable.Populate(sandboxValue.id, sandboxValue.description);
    }
Esempio n. 4
0
 internal SerializableGradient(SerializableGradient serializableGradient)
 {
     if (serializableGradient == null)
     {
         left  = new SerializableColor(Color.white);
         right = new SerializableColor(Color.black);
         return;
     }
     left  = new SerializableColor(serializableGradient.left.color);
     right = new SerializableColor(serializableGradient.right.color);
 }
Esempio n. 5
0
 public PortalSave(Portal portal) : base(portal)
 {
     this.channel = portal.channel;
     this.changeActiveSceneOnTeleport = portal.changeActiveSceneOnTeleport;
     this.changeCameraEdgeDetection   = portal.changeCameraEdgeDetection;
     this.edgeColorMode          = (int)portal.edgeColorMode;
     this.edgeColor              = portal.edgeColor;
     this.edgeColorGradient      = portal.edgeColorGradient;
     this.renderRecursivePortals = portal.renderRecursivePortals;
     this.compositePortal        = portal.compositePortal;
     this.teleportingPlayer      = portal.teleportingPlayer;
     this.pauseRenderingOnly     = portal.pauseRenderingOnly;
     this.pauseRenderingAndLogic = portal.pauseRenderingAndLogic;
 }
Esempio n. 6
0
    public ModuleEnvironmentalSunData(ModuleEnvironmentalSunData environmentalSunData)
    {
        id       = environmentalSunData.id;
        parentId = environmentalSunData.parentId;

        name     = environmentalSunData.name;
        position = environmentalSunData.position;
        rotation = environmentalSunData.rotation;
        scale    = environmentalSunData.scale;
        tags     = environmentalSunData.tags;

        color                = environmentalSunData.color;
        shadowStrength       = environmentalSunData.shadowStrength;
        serializableGradient = new SerializableGradient(environmentalSunData.serializableGradient);
        serializableCurve    = new SerializableCurve(environmentalSunData.serializableCurve);
    }
 public BladeEdgeDetectionSave(BladeEdgeDetection edgeDetection) : base(edgeDetection)
 {
     this.debugMode          = edgeDetection.debugMode;
     this.doubleSidedEdges   = edgeDetection.doubleSidedEdges;
     this.checkPortalDepth   = edgeDetection.checkPortalDepth;
     this.depthSensitivity   = edgeDetection.depthSensitivity;
     this.normalSensitivity  = edgeDetection.normalSensitivity;
     this.sampleDistance     = edgeDetection.sampleDistance;
     this.weightedEdgeMode   = (int)edgeDetection.weightedEdgeMode;
     this.depthWeightEffect  = edgeDetection.depthWeightEffect;
     this.normalWeightEffect = edgeDetection.normalWeightEffect;
     this.edgeColorMode      = (int)edgeDetection.edgeColorMode;
     this.edgeColor          = edgeDetection.edgeColor;
     this.edgeColorGradient  = edgeDetection.edgeColorGradient;
     this.depthWeightMin     = edgeDetection.depthWeightMin;
     this.normalWeightMin    = edgeDetection.normalWeightMin;
 }
    public ModuleLogicColorAnimatorData(ModuleLogicColorAnimatorData moduleColorAnimatorData)
    {
        id       = moduleColorAnimatorData.id;
        parentId = moduleColorAnimatorData.parentId;

        name     = moduleColorAnimatorData.name;
        position = moduleColorAnimatorData.position;
        rotation = moduleColorAnimatorData.rotation;
        scale    = moduleColorAnimatorData.scale;
        tags     = moduleColorAnimatorData.tags;
        if (moduleColorAnimatorData.connections != null)
        {
            connections = new List <int>(moduleColorAnimatorData.connections);
        }

        duration              = moduleColorAnimatorData.duration;
        loop                  = moduleColorAnimatorData.loop;
        serializableGradient  = new SerializableGradient(moduleColorAnimatorData.serializableGradient);
        sandboxValueReference = new SandboxValueReference(moduleColorAnimatorData.sandboxValueReference);
    }
Esempio n. 9
0
    public ModuleArtParticleEffectData(ModuleArtParticleEffectData cosmeticParticleEffectData)
    {
        id       = cosmeticParticleEffectData.id;
        parentId = cosmeticParticleEffectData.parentId;

        name     = cosmeticParticleEffectData.name;
        position = cosmeticParticleEffectData.position;
        rotation = cosmeticParticleEffectData.rotation;
        scale    = cosmeticParticleEffectData.scale;
        tags     = cosmeticParticleEffectData.tags;

        shapeScale          = cosmeticParticleEffectData.shapeScale;
        sizeMultiplier      = cosmeticParticleEffectData.sizeMultiplier;
        colorOverDuration   = new SerializableGradient(cosmeticParticleEffectData.colorOverDuration);
        effectTextureIndex  = cosmeticParticleEffectData.effectTextureIndex;
        simulationSpace     = cosmeticParticleEffectData.simulationSpace;
        duration            = cosmeticParticleEffectData.duration;
        particleLifetimeMin = cosmeticParticleEffectData.particleLifetimeMin;
        particleLifetimeMax = cosmeticParticleEffectData.particleLifetimeMax;
        loop         = cosmeticParticleEffectData.loop;
        gravity      = cosmeticParticleEffectData.gravity;
        speed        = cosmeticParticleEffectData.speed;
        maxParticles = cosmeticParticleEffectData.maxParticles;
        emissionRate = cosmeticParticleEffectData.emissionRate;
        shape        = cosmeticParticleEffectData.shape;

        rotationMin = cosmeticParticleEffectData.rotationMin;
        rotationMax = cosmeticParticleEffectData.rotationMax;

        if (cosmeticParticleEffectData.sizeOverLifetime == null)
        {
            sizeOverLifetime = new SerializableCurve(Vector2.zero, Vector2.one * 0.25f, Vector2.one * 0.75f, Vector2.one);
        }
        else
        {
            sizeOverLifetime = cosmeticParticleEffectData.sizeOverLifetime;
        }
    }