Beispiel #1
0
        /**
         * Sets the value of its linked Options Data or PlayMaker variable to its value (if appropriate).
         */
        public void Upload()
        {
            if (link == VarLink.PlaymakerGlobalVariable && pmVar != "")
            {
                if (!PlayMakerIntegration.IsDefinePresent())
                {
                    return;
                }

                if (type == VariableType.Integer || type == VariableType.PopUp)
                {
                    PlayMakerIntegration.SetGlobalInt(pmVar, val);
                }
                else if (type == VariableType.Boolean)
                {
                    if (val == 1)
                    {
                        PlayMakerIntegration.SetGlobalBool(pmVar, true);
                    }
                    else
                    {
                        PlayMakerIntegration.SetGlobalBool(pmVar, false);
                    }
                }
                else if (type == VariableType.String)
                {
                    PlayMakerIntegration.SetGlobalString(pmVar, textVal);
                }
                else if (type == VariableType.Float)
                {
                    PlayMakerIntegration.SetGlobalFloat(pmVar, floatVal);
                }
                else if (type == VariableType.Vector3)
                {
                    PlayMakerIntegration.SetGlobalVector3(pmVar, vector3Val);
                }
            }
            else if (link == VarLink.OptionsData)
            {
                Options.SavePrefs();
            }
            else if (link == VarLink.CustomScript)
            {
                KickStarter.eventManager.Call_OnUploadVariable(this);
            }
        }
Beispiel #2
0
        /**
         * Sets the value of its linked Options Data or PlayMaker variable to its value (if appropriate).
         */
        public void Upload()
        {
            if (link == VarLink.PlaymakerGlobalVariable && pmVar != "")
            {
                if (!PlayMakerIntegration.IsDefinePresent())
                {
                    return;
                }

                if (type == VariableType.Integer || type == VariableType.PopUp)
                {
                    PlayMakerIntegration.SetGlobalInt(pmVar, val);
                }
                else if (type == VariableType.Boolean)
                {
                    if (val == 1)
                    {
                        PlayMakerIntegration.SetGlobalBool(pmVar, true);
                    }
                    else
                    {
                        PlayMakerIntegration.SetGlobalBool(pmVar, false);
                    }
                }
                else if (type == VariableType.String)
                {
                    PlayMakerIntegration.SetGlobalString(pmVar, textVal);
                }
                else if (type == VariableType.Float)
                {
                    PlayMakerIntegration.SetGlobalFloat(pmVar, floatVal);
                }
            }
            else if (link == VarLink.OptionsData)
            {
                Options.SavePrefs();
            }
        }