/** * Sets its value to that of its linked PlayMaker variable (if appropriate). */ public void Download() { if (link == VarLink.PlaymakerGlobalVariable && pmVar != "") { if (!PlayMakerIntegration.IsDefinePresent()) { return; } if (type == VariableType.Integer || type == VariableType.PopUp) { SetValue(PlayMakerIntegration.GetGlobalInt(pmVar)); } else if (type == VariableType.Boolean) { bool _val = PlayMakerIntegration.GetGlobalBool(pmVar); if (_val) { SetValue(1); } else { SetValue(0); } } else if (type == VariableType.String) { SetStringValue(PlayMakerIntegration.GetGlobalString(pmVar)); } else if (type == VariableType.Float) { SetFloatValue(PlayMakerIntegration.GetGlobalFloat(pmVar)); } else if (type == VariableType.Vector3) { SetVector3Value(PlayMakerIntegration.GetGlobalVector3(pmVar)); } } else if (link == VarLink.CustomScript) { KickStarter.eventManager.Call_OnDownloadVariable(this); } }