override public float Run()
        {
            if (!string.IsNullOrEmpty(menuName) && !string.IsNullOrEmpty(elementName))
            {
                MenuElement menuElement = PlayerMenus.GetElementWithName(menuName, elementName);
                if (menuElement is MenuInput)
                {
                    MenuInput menuInput = (MenuInput)menuElement;
                    if (setMenuInputBoxSource == SetMenuInputBoxSource.EnteredHere)
                    {
                        menuInput.SetLabel(newLabel);
                    }
                    else if (setMenuInputBoxSource == SetMenuInputBoxSource.FromGlobalVariable)
                    {
                        menuInput.SetLabel(GlobalVariables.GetStringValue(varID));
                    }
                }
                else
                {
                    ACDebug.LogWarning("Cannot find Element '" + elementName + "' within Menu '" + menuName + "'");
                }
            }

            return(0f);
        }
Beispiel #2
0
        override public float Run()
        {
            if (_parameter == null)
            {
                ACDebug.LogWarning("Cannot set parameter value since it cannot be found!");
                return(0f);
            }

            if (setParamMethod == SetParamMethod.CopiedFromGlobalVariable)
            {
                GVar gVar = GlobalVariables.GetVariable(globalVariableID);
                if (gVar != null)
                {
                    if (_parameter.parameterType == ParameterType.Boolean ||
                        _parameter.parameterType == ParameterType.Integer)
                    {
                        _parameter.intValue = gVar.val;
                    }
                    else if (_parameter.parameterType == ParameterType.Float)
                    {
                        _parameter.floatValue = gVar.floatVal;
                    }
                    else if (_parameter.parameterType == ParameterType.String)
                    {
                        _parameter.stringValue = GlobalVariables.GetStringValue(globalVariableID, true, Options.GetLanguage());
                    }
                }
            }
            else if (setParamMethod == SetParamMethod.EnteredHere)
            {
                if (_parameter.parameterType == ParameterType.Boolean ||
                    _parameter.parameterType == ParameterType.Integer ||
                    _parameter.parameterType == ParameterType.GlobalVariable ||
                    _parameter.parameterType == ParameterType.LocalVariable ||
                    _parameter.parameterType == ParameterType.InventoryItem)
                {
                    _parameter.intValue = intValue;
                }
                else if (_parameter.parameterType == ParameterType.Float)
                {
                    _parameter.floatValue = floatValue;
                }
                else if (_parameter.parameterType == ParameterType.String)
                {
                    _parameter.stringValue = stringValue;
                }
                else if (_parameter.parameterType == ParameterType.GameObject)
                {
                    _parameter.gameObject = gameobjectValue;
                    _parameter.intValue   = gameObjectConstantID;
                }
                else if (_parameter.parameterType == ParameterType.UnityObject)
                {
                    _parameter.objectValue = unityObjectValue;
                }
            }

            return(0f);
        }
Beispiel #3
0
        override public float Run()
        {
            if (menuName != "" && elementName != "")
            {
                MenuElement menuElement = PlayerMenus.GetElementWithName(menuName, elementName);
                if (menuElement is MenuInput)
                {
                    MenuInput menuInput = (MenuInput)menuElement;
                    if (setMenuInputBoxSource == SetMenuInputBoxSource.EnteredHere)
                    {
                        menuInput.SetLabel(newLabel);
                    }
                    else if (setMenuInputBoxSource == SetMenuInputBoxSource.FromGlobalVariable)
                    {
                        menuInput.SetLabel(GlobalVariables.GetStringValue(varID));
                    }
                }
            }

            return(0f);
        }
        override public float Run()
        {
            if (_parameter == null)
            {
                ACDebug.LogWarning("Cannot set parameter value since it cannot be found!");
                return(0f);
            }

            if (setParamMethod == SetParamMethod.CopiedFromGlobalVariable)
            {
                GVar gVar = GlobalVariables.GetVariable(globalVariableID);
                if (gVar != null)
                {
                    if (_parameter.parameterType == ParameterType.Boolean ||
                        _parameter.parameterType == ParameterType.Integer)
                    {
                        _parameter.intValue = gVar.val;
                    }
                    else if (_parameter.parameterType == ParameterType.Float)
                    {
                        _parameter.floatValue = gVar.floatVal;
                    }
                    else if (_parameter.parameterType == ParameterType.Vector3)
                    {
                        _parameter.vector3Value = gVar.vector3Val;
                    }
                    else if (_parameter.parameterType == ParameterType.String)
                    {
                        _parameter.stringValue = GlobalVariables.GetStringValue(globalVariableID, true, Options.GetLanguage());
                    }
                }
            }
            else if (setParamMethod == SetParamMethod.EnteredHere)
            {
                if (_parameter.parameterType == ParameterType.Boolean ||
                    _parameter.parameterType == ParameterType.Integer ||
                    _parameter.parameterType == ParameterType.GlobalVariable ||
                    _parameter.parameterType == ParameterType.LocalVariable ||
                    _parameter.parameterType == ParameterType.InventoryItem)
                {
                    _parameter.intValue = intValue;
                }
                else if (_parameter.parameterType == ParameterType.Float)
                {
                    _parameter.floatValue = floatValue;
                }
                else if (_parameter.parameterType == ParameterType.String)
                {
                    _parameter.stringValue = stringValue;
                }
                else if (_parameter.parameterType == ParameterType.GameObject)
                {
                    _parameter.gameObject = gameobjectValue;
                    _parameter.intValue   = gameObjectConstantID;
                }
                else if (_parameter.parameterType == ParameterType.UnityObject)
                {
                    _parameter.objectValue = unityObjectValue;
                }
                else if (_parameter.parameterType == ParameterType.Vector3)
                {
                    _parameter.vector3Value = vector3Value;
                }
            }
            else if (setParamMethod == SetParamMethod.Random)
            {
                if (_parameter.parameterType == ParameterType.Boolean)
                {
                    _parameter.intValue = Random.Range(0, 2);
                }
                else if (_parameter.parameterType == ParameterType.Integer)
                {
                    _parameter.intValue = Random.Range(intValue, intValueMax + 1);
                }
                else if (_parameter.parameterType == ParameterType.Float)
                {
                    _parameter.floatValue = Random.Range(floatValue, floatValueMax);
                }
                else
                {
                    ACDebug.LogWarning("Parameters of type '" + _parameter.parameterType + "' cannot be set randomly.");
                }
            }
            else if (setParamMethod == SetParamMethod.CopiedFromParameter)
            {
                if (_parameterToCopy == null)
                {
                    ACDebug.LogWarning("Cannot copy parameter value since it cannot be found!");
                    return(0f);
                }

                _parameter.CopyValues(_parameterToCopy);
            }

            return(0f);
        }