Пример #1
0
 internal override void Bind(SandboxValue sandboxValue)
 {
     base.valueReference = sandboxValue;
     _value = (bool)sandboxValue.get();
     wUITipable.Populate(sandboxValue.id, sandboxValue.description);
     Display();
 }
Пример #2
0
 internal override void Bind(SandboxValue sandboxValue)
 {
     base.valueReference = sandboxValue;
     curve = (SerializableCurve)sandboxValue.get();
     wUITipable.Populate(sandboxValue.id, sandboxValue.description);
     DisplayCurve();
 }
Пример #3
0
    internal override void Bind(SandboxValue sandboxValue)
    {
        base.valueReference = sandboxValue;
        // Defines the value on the end connection
        sandboxValueReference = (SandboxValueReference)sandboxValue.get();
        wUITipable.Populate(sandboxValue.id, sandboxValue.description);
        rootModule = (Module)sandboxValue.meta[0];
        types      = (List <Type>)sandboxValue.meta[1];

        if (sandboxValueReference.valueID == null)
        {
            _components.objectNameLabel.text = rootModule.connections.Count > 0 ? "EMPTY" : "THERE ARE NO CONNECTIONS";
        }
        else
        {
            SandboxValue connectionSandboxValue = null;
            foreach (Connection connection in rootModule.connections)
            {
                Module connectedModule = connection.GetOtherTo(rootModule);
                if (connectedModule.data.id == sandboxValueReference.moduleID)
                {
                    connectionSandboxValue = connectedModule.sandboxValuesById[sandboxValueReference.valueID];
                    break;
                }
            }
            if (sandboxValueReference.moduleID != 0 && connectionSandboxValue == null)
            {
                Debug.LogError($"Stale reference found for deleted module [ {sandboxValueReference.moduleID} ], can cause unwanted references to new objects, module ref needs to be cleared on connection break in root module...");
            }
            if (connectionSandboxValue != null)
            {
                _components.objectNameLabel.text = $"{connectionSandboxValue.module.data.name} : {connectionSandboxValue.id}";
            }
        }
    }
Пример #4
0
    internal override void Bind(SandboxValue sandboxValue)
    {
        base.valueReference = sandboxValue;
        float value = (float)sandboxValue.get();

        _round    = (bool)sandboxValue.meta[0];
        _minValue = (float)sandboxValue.meta[1];
        _maxValue = (float)sandboxValue.meta[2];

        float absoluteMin = Mathf.Abs(_minValue);
        float ratio       = 0f;

        if (_minValue == 0)
        {
            ratio = value / _maxValue;
        }
        else
        {
            ratio = value == 0 ? (absoluteMin / (absoluteMin + _maxValue)) : 0.5f + (value / (absoluteMin + _maxValue));
        }

        _components.wUISlider.Chart(ratio);


        _components.text.text = $"{value}";

        wUITipable.Populate(sandboxValue.id, sandboxValue.description);
    }
Пример #5
0
    internal override void Bind(SandboxValue sandboxValue)
    {
        base.valueReference = sandboxValue;
        color = (Color)sandboxValue.get();
        _components.colorDisplayImage.color = color;

        wUITipable.Populate(sandboxValue.id, sandboxValue.description);
    }
Пример #6
0
    internal override void Bind(SandboxValue sandboxValue)
    {
        base.valueReference = sandboxValue;
        index = ((int)sandboxValue.get());

        SetTexture(index);

        wUITipable.Populate(sandboxValue.id, sandboxValue.description);
    }
    private void AddValue(Module module, SandboxValue sandboxValue, Action <SandboxValue> callback)
    {
        GameObject             gameObject             = Instantiate(_prefabs.wUIMemberBrowserButton.gameObject, _components.buttonContainer, false);
        WUIMemberBrowserButton wUIMemberBrowserButton = gameObject.GetComponent <WUIMemberBrowserButton>();

        _components.buttons.Add(gameObject);
        wUIMemberBrowserButton.onClick += () => { Unstack(); callback.Invoke(sandboxValue); };
        wUIMemberBrowserButton.SetText(sandboxValue.id);
    }
Пример #8
0
 internal override void Bind(SandboxValue sandboxValue)
 {
     wUITipable.Populate(sandboxValue.id, sandboxValue.description);
     //_requireConfirmation = requireConfirmation;
     //_closeParentMenu = closeParentMenu;
     wUITipable.Populate(sandboxValue.id, sandboxValue.description);
     _components.text.text = sandboxValue.id;
     onClick += (Action)sandboxValue.meta[0];
     //OverrideColor(buttonValueColor);
 }
Пример #9
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);
    }
Пример #10
0
    protected override void RegisterSandboxValues()
    {
        base.RegisterSandboxValues();
        SandboxValue respawns = new SandboxValue
        {
            module       = this,
            id           = "Respawns",
            description  = "Determines if the object is to respawn.",
            wuiValueType = typeof(WUIBoolValue),
            get          = () => _data.respawns,
            set          = (object obj) =>
            {
                _data.respawns = (bool)obj;
                ApplyData();
            },
            meta = null
        };

        sandboxValuesById.Add(respawns.id, respawns);

        SandboxValue respawnDuration = new SandboxValue
        {
            module       = this,
            id           = "Respawn Duration",
            description  = "The duration along-which it takes for the object to spawn.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.respawnDuration,
            set          = (object obj) =>
            {
                _data.respawnDuration = (float)obj;
                ApplyData();
            },
            meta = null
        };

        sandboxValuesById.Add(respawnDuration.id, respawnDuration);

        SandboxValue initialSpawnDelay = new SandboxValue
        {
            module       = this,
            id           = "Initial Spawn Delay",
            description  = "The duration along-which the object will wait to first spawn.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.initialSpawnDelay,
            set          = (object obj) =>
            {
                _data.initialSpawnDelay = (float)obj;
                ApplyData();
            },
            meta = null
        };

        sandboxValuesById.Add(initialSpawnDelay.id, initialSpawnDelay);
    }
Пример #11
0
    protected override void RegisterSandboxValues()
    {
        SandboxValue skyColor = new SandboxValue
        {
            module       = this,
            id           = "Sky Color",
            description  = "The color of environments sky.",
            wuiValueType = typeof(WUIColorValue),
            get          = () => _data.skyColor.color,
            set          = (object obj) =>
            {
                _data.skyColor.color = (Color)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(skyColor.id, skyColor);

        SandboxValue fogColor = new SandboxValue
        {
            module       = this,
            id           = "Fog Color",
            description  = "The color of environments fog.",
            wuiValueType = typeof(WUIColorValue),
            get          = () => _data.fogColor.color,
            set          = (object obj) =>
            {
                _data.fogColor.color = (Color)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(fogColor.id, fogColor);

        SandboxValue fogDensity = new SandboxValue
        {
            module       = this,
            id           = "Fog Density",
            description  = "The density of environments fog.",
            wuiValueType = typeof(WUIRangeValue),
            get          = () => _data.fogDensity,
            set          = (object obj) =>
            {
                _data.fogDensity = (float)obj;
                ApplyData();
            },
            meta = new object[] { false, 0f, 1f }
        };

        sandboxValuesById.Add(fogDensity.id, fogDensity);
    }
Пример #12
0
 private void Play()
 {
     if (_sandboxValue == null)
     {
         _sandboxValue = GetSandboxValue();
         if (_sandboxValue == null)
         {
             return;
         }
     }
     _playing  = true;
     _progress = 0;
 }
Пример #13
0
    internal void Output(SandboxValue sandboxValue, string value)
    {
        Value aValue = _values.Find(e => e.sandboxValue == sandboxValue);

        if (aValue != null)
        {
            if (aValue.text == null)
            {
                return;
            }
            string valueString = aValue.stringFormat == string.Empty ? value : String.Format(aValue.stringFormat, value);
            aValue.text.text = valueString;
        }
    }
Пример #14
0
    internal override void Bind(SandboxValue sandboxValue)
    {
        base.valueReference = sandboxValue;
        wUITipable.Populate(sandboxValue.id, sandboxValue.description);

        List <string> tags = ((List <string>)sandboxValue.get());

        if (tags != null)
        {
            foreach (string tag in tags)
            {
                CreateTag(tag);
            }
        }
    }
Пример #15
0
    internal override void Bind(SandboxValue sandboxValue)
    {
        base.valueReference = sandboxValue;

        _names = Enum.GetNames((Type)sandboxValue.meta[0]);
        int[] values = (int[])Enum.GetValues((Type)sandboxValue.meta[0]);
        for (int i = 0; i < _names.Length; i++)
        {
            _nameValueMap.Add(values[i], _names[i]);
        }

        _value = (int)sandboxValue.get.Invoke();
        Set(_value);

        wUITipable.Populate(sandboxValue.id, sandboxValue.description);
    }
Пример #16
0
    internal override void Bind(SandboxValue sandboxValue)
    {
        base.valueReference = sandboxValue;
        int id = ((int)sandboxValue.get());

        if (id != -1)
        {
            SandboxObjectData sandboxObjectData = ModuleHead.GetSandboxObjectDataById(GameHead.instance.universeData, id);
            _components.objectNameLabel.text = sandboxObjectData.name;
        }
        else
        {
            _components.objectNameLabel.text = "EMPTY";
        }
        wUITipable.Populate(sandboxValue.id, sandboxValue.description);
    }
Пример #17
0
    protected override void RegisterSandboxValues()
    {
        base.RegisterSandboxValues();
        SandboxValue spawnedObject = new SandboxValue
        {
            module       = this,
            id           = "Spawned Object",
            description  = "The object that the spawner spawns.",
            wuiValueType = typeof(WUIObjectReferenceValue),
            get          = () => _data.spawnedObject,
            set          = (object obj) =>
            {
                _data.spawnedObject = (int)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(spawnedObject.id, spawnedObject);
    }
Пример #18
0
    protected override void RegisterSandboxValues()
    {
        base.RegisterSandboxValues();
        SandboxValue teamAScore = new SandboxValue
        {
            module       = this,
            id           = "Team A Score",
            description  = "The score of team A.",
            wuiValueType = typeof(WUIIntergerValue),
            get          = () => LinkHead.instance.values.teamAScore,
            set          = (object obj) =>
            {
                LinkHead.instance.values.teamAScore = (int)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(teamAScore.id, teamAScore);
    }
Пример #19
0
    internal T CreateValue <T>(SandboxValue sandboxValue) where T : WUIValue
    {
        if (sandboxValue.header != null && sandboxValue.header != string.Empty)
        {
            _components.values.Add(CreateHeader(sandboxValue.header));
        }


        WUIValue   prefab     = GetValuePrefab(sandboxValue.wuiValueType);
        GameObject gameObject = Instantiate(prefab.gameObject, _components.valueContainer, false);
        T          instance   = gameObject.GetComponent <T>();

        instance.wUIMenu = this;

        _components.values.Add(instance);
        if (sandboxValue.spaceAfter > 0)
        {
            _components.values.Add(CreateSpacer(sandboxValue.spaceAfter));
        }
        return(instance);
    }
Пример #20
0
    internal override void Bind(SandboxValue sandboxValue)
    {
        base.valueReference = sandboxValue;
        object vector = sandboxValue.get();

        if (vector is Vector3)
        {
            Vector3 vector3 = (Vector3)vector;
            _components.xInputField.text = vector3.x.ToString();
            _components.yInputField.text = vector3.y.ToString();
            _components.zInputField.text = vector3.z.ToString();
        }
        else if (vector is Vector2)
        {
            Vector2 vector2 = (Vector2)vector;
            _components.xInputField.text = vector2.x.ToString();
            _components.yInputField.text = vector2.y.ToString();
            _components.zInputField.gameObject.SetActive(false);
        }

        wUITipable.Populate(sandboxValue.id, sandboxValue.description);
    }
Пример #21
0
    protected override void RegisterSandboxValues()
    {
        base.RegisterSandboxValues();
        SandboxValue color = new SandboxValue
        {
            module       = this,
            id           = "Color",
            description  = "The color of the decal.",
            wuiValueType = typeof(WUIColorValue),
            get          = () => _data.color.color,
            set          = (object obj) =>
            {
                _data.color.color = (Color)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(color.id, color);

        SandboxValue texture = new SandboxValue
        {
            module       = this,
            id           = "Image",
            description  = "The image of the decal.",
            wuiValueType = typeof(WUITextureReferenceValue),
            get          = () => _data.decalTextureIndex,
            set          = (object obj) =>
            {
                _data.decalTextureIndex = (int)obj;
                ApplyData();
            },
            meta = new object[] { TextureSet.Decals }
        };

        sandboxValuesById.Add(texture.id, texture);
    }
Пример #22
0
    protected override void RegisterSandboxValues()
    {
        base.RegisterSandboxValues();
        SandboxValue color = new SandboxValue
        {
            module       = this,
            id           = "Color",
            description  = "The color of the tube.",
            wuiValueType = typeof(WUIColorValue),
            get          = () => _data.color.color,
            set          = (object obj) =>
            {
                _data.color.color = (Color)obj;
                ApplyData();
            },
            meta       = new object[] { },
            spaceAfter = 5f
        };

        sandboxValuesById.Add(color.id, color);

        SandboxValue topRadius = new SandboxValue
        {
            module       = this,
            id           = "Top Radius",
            description  = "The radius of the top of the cone.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.topRadius,
            set          = (object obj) =>
            {
                _data.topRadius = (float)obj;
                ApplyData();
            },
            meta   = new object[] { },
            header = "Shape Aspects"
        };

        sandboxValuesById.Add(topRadius.id, topRadius);

        SandboxValue bottomRadius = new SandboxValue
        {
            module       = this,
            id           = "Bottom Radius",
            description  = "The radius of the bottom of the cone.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.bottomRadius,
            set          = (object obj) =>
            {
                _data.bottomRadius = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(bottomRadius.id, bottomRadius);

        SandboxValue height = new SandboxValue
        {
            module       = this,
            id           = "Height",
            description  = "The height of the cone.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.height,
            set          = (object obj) =>
            {
                _data.height = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(height.id, height);

        SandboxValue segments = new SandboxValue
        {
            module       = this,
            id           = "Segments",
            description  = "The segments of the cone.",
            wuiValueType = typeof(WUIIntergerValue),
            get          = () => _data.segments,
            set          = (object obj) =>
            {
                _data.segments = (int)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(segments.id, segments);
    }
 private void OnSelectValue(SandboxValue sandboxValue)
 {
     _wUISandboxValueReference.Set(sandboxValue);
     Unstack();
 }
Пример #24
0
 internal void Set(SandboxValue sandboxValue)
 {
     _components.objectNameLabel.text = $"{sandboxValue.module.data.name} : {sandboxValue.id}";
     sandboxValueReference.moduleID   = sandboxValue.module.data.id;
     sandboxValueReference.valueID    = sandboxValue.id;
 }
Пример #25
0
    protected override void RegisterSandboxValues()
    {
        SandboxValue color = new SandboxValue
        {
            module       = this,
            id           = "Color",
            description  = "The color of the sun.",
            wuiValueType = typeof(WUIColorValue),
            get          = () => _data.color.color,
            set          = (object obj) =>
            {
                _data.color.color = (Color)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(color.id, color);

        SandboxValue shadowStrength = new SandboxValue
        {
            module       = this,
            id           = "Shadow Strength",
            description  = "The strength of the suns shadows.",
            wuiValueType = typeof(WUIRangeValue),
            get          = () => _data.shadowStrength,
            set          = (object obj) =>
            {
                _data.shadowStrength = (float)obj;
                ApplyData();
            },
            meta = new object[] { false, 0f, 1f }
        };

        sandboxValuesById.Add(shadowStrength.id, shadowStrength);

        SandboxValue testGradient = new SandboxValue
        {
            module       = this,
            id           = "Test Gradient",
            description  = "---",
            wuiValueType = typeof(WUIGradientValue),
            get          = () => _data.serializableGradient,
            set          = (object obj) =>
            {
                _data.serializableGradient = (SerializableGradient)obj;
                ApplyData();
            },
            meta = new object[] {}
        };

        sandboxValuesById.Add(testGradient.id, testGradient);

        SandboxValue testCurve = new SandboxValue
        {
            module       = this,
            id           = "Test Curve",
            description  = "---",
            wuiValueType = typeof(WUICurveValue),
            get          = () => _data.serializableCurve,
            set          = (object obj) =>
            {
                _data.serializableCurve = (SerializableCurve)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(testCurve.id, testCurve);
    }
Пример #26
0
    protected override void RegisterSandboxValues()
    {
        base.RegisterSandboxValues();


        SandboxValue duration = new SandboxValue
        {
            module       = this,
            id           = "Duration",
            description  = "The duration the effect will play if not looped.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.duration,
            set          = (object obj) =>
            {
                _data.duration = (float)obj;
                ApplyData();
            },
            header = "Emission Properties",
            meta   = new object[] { }
        };

        sandboxValuesById.Add(duration.id, duration);
        SandboxValue loop = new SandboxValue
        {
            module       = this,
            id           = "Loop",
            description  = "Determines if the particle effect loops playback.",
            wuiValueType = typeof(WUIBoolValue),
            get          = () => _data.loop,
            set          = (object obj) =>
            {
                _data.loop = (bool)obj;
                ApplyData();
            },
            spaceAfter = 5f,
            meta       = new object[] { }
        };

        sandboxValuesById.Add(loop.id, loop);
        SandboxValue simulationSpace = new SandboxValue
        {
            module       = this,
            id           = "Simulation Space",
            description  = "The space in-which the emission is simulated.",
            wuiValueType = typeof(WUIEnumValue),
            get          = () => _data.simulationSpace,
            set          = (object obj) =>
            {
                _data.simulationSpace = (SimulationSpace)obj;
                ApplyData();
            },
            meta = new object[] { typeof(SimulationSpace) }
        };

        sandboxValuesById.Add(simulationSpace.id, simulationSpace);


        SandboxValue shape = new SandboxValue
        {
            module       = this,
            id           = "Shape",
            description  = "The shape of the emission volume.",
            wuiValueType = typeof(WUIEnumValue),
            get          = () => _data.shape,
            set          = (object obj) =>
            {
                _data.shape = (ParticleSystemShape)obj;
                ApplyData();
            },
            meta = new object[] { typeof(ParticleSystemShape) }
        };

        sandboxValuesById.Add(shape.id, shape);
        SandboxValue shapeScale = new SandboxValue
        {
            module       = this,
            id           = "Shape Scale",
            description  = "The scale of the emission shape.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.shapeScale,
            set          = (object obj) =>
            {
                _data.shapeScale = (float)obj;
                ApplyData();
            },
            spaceAfter = 5f,
            meta       = new object[] { }
        };

        sandboxValuesById.Add(shapeScale.id, shapeScale);
        SandboxValue maxParticles = new SandboxValue
        {
            module       = this,
            id           = "Max Particles",
            description  = "The maximum amount of particles at any one time.",
            wuiValueType = typeof(WUIIntergerValue),
            get          = () => _data.maxParticles,
            set          = (object obj) =>
            {
                _data.maxParticles = (int)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(maxParticles.id, maxParticles);
        SandboxValue emissionRate = new SandboxValue
        {
            module       = this,
            id           = "Emission Rate",
            description  = "The rate at which particles emit.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.emissionRate,
            set          = (object obj) =>
            {
                _data.emissionRate = (float)obj;
                ApplyData();
            },
            spaceAfter = 10f,
            meta       = new object[] { }
        };

        sandboxValuesById.Add(emissionRate.id, emissionRate);


        SandboxValue texture = new SandboxValue
        {
            module       = this,
            id           = "Image",
            description  = "The image of each particle.",
            wuiValueType = typeof(WUITextureReferenceValue),
            get          = () => _data.effectTextureIndex,
            set          = (object obj) =>
            {
                _data.effectTextureIndex = (int)obj;
                ApplyData();
            },
            header = "Particle Properties",
            meta   = new object[] { TextureSet.Effects }
        };

        sandboxValuesById.Add(texture.id, texture);
        SandboxValue color = new SandboxValue
        {
            module       = this,
            id           = "Color Over Lifetime",
            description  = "The color of each particle over its liftime.",
            wuiValueType = typeof(WUIGradientValue),
            get          = () => _data.colorOverDuration,
            set          = (object obj) =>
            {
                _data.colorOverDuration = (SerializableGradient)obj;
                ApplyData();
            },
            spaceAfter = 5f,
            meta       = new object[] { }
        };

        sandboxValuesById.Add(color.id, color);

        SandboxValue sizeMultiplier = new SandboxValue
        {
            module       = this,
            id           = "Size Multiplier",
            description  = "The multiplication of size over life time.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.sizeMultiplier,
            set          = (object obj) =>
            {
                _data.sizeMultiplier = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(sizeMultiplier.id, sizeMultiplier);
        SandboxValue sizeOverLifetime = new SandboxValue
        {
            module       = this,
            id           = "Size Over Lifetime",
            description  = "The size of each particle over its liftime.",
            wuiValueType = typeof(WUICurveValue),
            get          = () => _data.sizeOverLifetime,
            set          = (object obj) =>
            {
                _data.sizeOverLifetime = (SerializableCurve)obj;
                ApplyData();
            },
            spaceAfter = 5f,
            meta       = new object[] { }
        };

        sandboxValuesById.Add(sizeOverLifetime.id, sizeOverLifetime);



        SandboxValue speed = new SandboxValue
        {
            module       = this,
            id           = "Speed",
            description  = "The speed applied to each particle.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.speed,
            set          = (object obj) =>
            {
                _data.speed = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(speed.id, speed);
        SandboxValue gravity = new SandboxValue
        {
            module       = this,
            id           = "Gravity",
            description  = "The gravity applied to each particle.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.gravity,
            set          = (object obj) =>
            {
                _data.gravity = (float)obj;
                ApplyData();
            },
            spaceAfter = 5f,
            meta       = new object[] { }
        };

        sandboxValuesById.Add(gravity.id, gravity);

        SandboxValue particleLifetimeMin = new SandboxValue
        {
            module       = this,
            id           = "Minimum Particle Lifetime",
            description  = "The minimum lifetime of each particle.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.particleLifetimeMin,
            set          = (object obj) =>
            {
                _data.particleLifetimeMin = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(particleLifetimeMin.id, particleLifetimeMin);
        SandboxValue particleLifetimeMax = new SandboxValue
        {
            module       = this,
            id           = "Maximum Particle Lifetime",
            description  = "The maximum lifetime of each particle.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.particleLifetimeMax,
            set          = (object obj) =>
            {
                _data.particleLifetimeMax = (float)obj;
                ApplyData();
            },
            spaceAfter = 5f,
            meta       = new object[] { }
        };

        sandboxValuesById.Add(particleLifetimeMax.id, particleLifetimeMax);

        SandboxValue rotationMin = new SandboxValue
        {
            module       = this,
            id           = "Minimum Rotation",
            description  = "The minimum rotation of each particle.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.rotationMin,
            set          = (object obj) =>
            {
                _data.rotationMin = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(rotationMin.id, rotationMin);
        SandboxValue rotationMax = new SandboxValue
        {
            module       = this,
            id           = "Maximum Rotation",
            description  = "The maximum rotation of each particle.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.rotationMax,
            set          = (object obj) =>
            {
                _data.rotationMax = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(rotationMax.id, rotationMax);
    }
Пример #27
0
    protected override void RegisterSandboxValues()
    {
        SandboxValue playAtStart = new SandboxValue
        {
            module       = this,
            id           = "Play At Start",
            description  = "Determines if the animation plays at start or not.",
            wuiValueType = typeof(WUIBoolValue),
            get          = () => _data.playAtStart,
            set          = (object obj) =>
            {
                _data.playAtStart = (bool)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(playAtStart.id, playAtStart);

        SandboxValue loop = new SandboxValue
        {
            module       = this,
            id           = "Loop",
            description  = "Determines if the animation loops or not.",
            wuiValueType = typeof(WUIBoolValue),
            get          = () => _data.loop,
            set          = (object obj) =>
            {
                _data.loop = (bool)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(loop.id, loop);

        SandboxValue duration = new SandboxValue
        {
            module       = this,
            id           = "Duration",
            description  = "The duration of the animation.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.duration,
            set          = (object obj) =>
            {
                _data.duration = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(duration.id, duration);

        SandboxValue sandboxValueReference = new SandboxValue
        {
            module       = this,
            id           = "Animated Value",
            description  = "The value that is to be animated.",
            wuiValueType = typeof(WUISandboxValueReference),
            get          = () => _data.sandboxValueReference,
            set          = (object obj) =>
            {
                _data.sandboxValueReference = (SandboxValueReference)obj;
                ApplyData();
            },
            meta = new object[] { this, new List <Type> {
                                      typeof(WUIRangeValue), typeof(WUIFloatValue), typeof(WUIIntergerValue)
                                  } }
        };

        sandboxValuesById.Add(sandboxValueReference.id, sandboxValueReference);

        SandboxValue value = new SandboxValue
        {
            module       = this,
            id           = "Scaled Value",
            description  = "The value scaled and applied to the animated value.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.value,
            set          = (object obj) =>
            {
                _data.value = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(value.id, value);

        SandboxValue scaleOverDuration = new SandboxValue
        {
            module       = this,
            id           = "Scale Over Animation",
            description  = "The scale of the value over the duration of the animation.",
            wuiValueType = typeof(WUICurveValue),
            get          = () => _data.serializableCurve,
            set          = (object obj) =>
            {
                _data.serializableCurve = (SerializableCurve)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(scaleOverDuration.id, scaleOverDuration);
    }
Пример #28
0
 internal override void Bind(SandboxValue sandboxValue)
 {
     base.valueReference         = sandboxValue;
     _components.inputField.text = (string)sandboxValue.get();
     wUITipable.Populate(sandboxValue.id, sandboxValue.description);
 }
Пример #29
0
 internal override void Bind(SandboxValue sandboxValue)
 {
 }
Пример #30
0
    protected override void RegisterSandboxValues()
    {
        base.RegisterSandboxValues();

        SandboxValue yawRate = new SandboxValue
        {
            module       = this,
            id           = "Yaw Rate",
            description  = "The rate at which the module rotates along the yaw component.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.yawRate,
            set          = (object obj) =>
            {
                _data.yawRate = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(yawRate.id, yawRate);

        SandboxValue yawMin = new SandboxValue
        {
            module       = this,
            id           = "Yaw Min",
            description  = "The minimum angle long the yaw component.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.yawMin,
            set          = (object obj) =>
            {
                _data.yawMin = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(yawMin.id, yawMin);
        SandboxValue yawMax = new SandboxValue
        {
            module       = this,
            id           = "Yaw Max",
            description  = "The maximum angle long the yaw component.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.yawMax,
            set          = (object obj) =>
            {
                _data.yawMax = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(yawMax.id, yawMax);

        SandboxValue pitchRate = new SandboxValue
        {
            module       = this,
            id           = "Pitch Rate",
            description  = "The rate at which the module rotates along the pitch component.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.pitchRate,
            set          = (object obj) =>
            {
                _data.pitchRate = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(pitchRate.id, pitchRate);
        SandboxValue pitchMin = new SandboxValue
        {
            module       = this,
            id           = "Pitch Min",
            description  = "The minimum angle long the pitch component.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.pitchMin,
            set          = (object obj) =>
            {
                _data.pitchMin = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(pitchMin.id, pitchMin);
        SandboxValue pitchMax = new SandboxValue
        {
            module       = this,
            id           = "Pitch Max",
            description  = "The maximum angle long the pitch component.",
            wuiValueType = typeof(WUIFloatValue),
            get          = () => _data.pitchMax,
            set          = (object obj) =>
            {
                _data.pitchMax = (float)obj;
                ApplyData();
            },
            meta = new object[] { }
        };

        sandboxValuesById.Add(pitchMax.id, pitchMax);
    }