示例#1
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}";
            }
        }
    }
    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);
    }
示例#3
0
    public ModuleLogicValueAnimatorData(ModuleLogicValueAnimatorData modulesValueAnimatorData)
    {
        id       = modulesValueAnimatorData.id;
        parentId = modulesValueAnimatorData.parentId;

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

        duration              = modulesValueAnimatorData.duration;
        loop                  = modulesValueAnimatorData.loop;
        playAtStart           = modulesValueAnimatorData.playAtStart;
        value                 = modulesValueAnimatorData.value;
        serializableCurve     = new SerializableCurve(modulesValueAnimatorData.serializableCurve);
        sandboxValueReference = new SandboxValueReference(modulesValueAnimatorData.sandboxValueReference);
    }
示例#4
0
 internal SandboxValueReference(SandboxValueReference sandboxValueReference)
 {
     this.moduleID = sandboxValueReference.moduleID;
     this.valueID  = sandboxValueReference.valueID;
 }