public override void Reset()
        {
            gameObject = null;
            reference = null;

            variable = null;
        }
 public override void Reset()
 {
     gameObject = null;
     reference = null;
     variable = null;
     everyFrame = false;
 }
 public override void Reset()
 {
     customPropertyKey = "My Property";
     customPropertyValue = null;
     successEvent = null;
     failureEvent = null;
 }
Exemplo n.º 4
0
 public override void Reset()
 {
     this.gameObject = null;
     this.reference = null;
     this.variable = null;
     this.everyFrame = false;
 }
Exemplo n.º 5
0
 public override void Reset()
 {
     gameObject = null;
     reference = null;
     variable = null;
     forceResizeIdNeeded = false;
     everyFrame = false;
 }
 public override void Reset()
 {
     gameObject = null;
     reference = null;
     key = null;
     //setValueIfKeyExists = null;
     variable = null;
 }
 public override void Reset()
 {
     array = null;
     storeValue =null;
     index = null;
     everyFrame = false;
     Repeat = true;
 }
 public override void Reset()
 {
     behaviour = null;
     methodName = null;
     parameters = null;
     storeResult = null;
     everyFrame = false;
 }
 public override void Reset()
 {
     gameObject = null;
         reference = null;
         variable = null;
         failureEvent = null;
         index = null;
 }
Exemplo n.º 10
0
 public override void Reset()
 {
     gameObject = null;
     reference = null;
     variable = null;
     convertIntToByte = false;
     index = null;
 }
Exemplo n.º 11
0
 public override void Reset()
 {
     this.gameObject = null;
     this.key = null;
     this.KeyFoundEvent = null;
     this.KeyNotFoundEvent = null;
     this.result = null;
 }
Exemplo n.º 12
0
 public override void Reset()
 {
     array = null;
     index = null;
     everyFrame = false;
     storeValue = null;
     indexOutOfRange = null;
 }
Exemplo n.º 13
0
        public override void Reset()
        {
            objectId = new FsmString {UseVariable=true};
            propertyKey = null;
            value = null;

            successEvent = null;
            errorEvent = null;
        }
Exemplo n.º 14
0
 public override void Reset()
 {
     gameObject = null;
     reference = null;
     key = null;
     //setValueIfKeyExists = null;
     convertIntToByte = false;
     variable = null;
 }
Exemplo n.º 15
0
 public override void Reset()
 {
     gameObject = null;
     reference = null;
     containsValue = null;
     valueFoundEvent = null;
     valueNotFoundEvent= null;
     variable = null;
 }
Exemplo n.º 16
0
        public override void Reset()
        {
            atIndex = null;
            gameObject = null;

            failureEvent = null;

            result = null;
        }
Exemplo n.º 17
0
		public override void Reset()
		{
			gameObject = null;

			failureEvent = null;
			
			randomItem = null;
			randomIndex = null;
		}
Exemplo n.º 18
0
	// ONLY WORKS IF THE FSMVAR POINTS TO A REGULAR FSM VARIABLE
	public static void RefreshValueFromFsmVar(Fsm fromFsm,FsmVar fsmVar)
	{
		if (fromFsm==null)
		{
			return;
		}
		if (fsmVar==null)
		{
			return;
		}
		
		if (!fsmVar.useVariable)
		{
			return;
		}
		
		switch (fsmVar.Type)
		{
		case VariableType.Int:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmInt(fsmVar.variableName) );
			break;
		case VariableType.Float:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmFloat(fsmVar.variableName));
			break;
		case VariableType.Bool:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmBool(fsmVar.variableName));
			break;
		case VariableType.Color:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmColor(fsmVar.variableName));
			break;
		case VariableType.Quaternion:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmQuaternion(fsmVar.variableName));
			break;
		case VariableType.Rect:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmRect(fsmVar.variableName));
			break;
		case VariableType.Vector2:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmVector2(fsmVar.variableName));
			break;
		case VariableType.Vector3:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmVector3(fsmVar.variableName));
			break;
		case VariableType.Texture:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmVector3(fsmVar.variableName));
			break;
		case VariableType.Material:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmMaterial(fsmVar.variableName));
			break;
		case VariableType.String:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmString(fsmVar.variableName));
			break;
		case VariableType.GameObject:
			fsmVar.GetValueFrom( (NamedVariable)fromFsm.Variables.GetFsmGameObject(fsmVar.variableName));
			break;
		}
	}
Exemplo n.º 19
0
		public override void Reset()
		{
			gameObject = null;
			reference = null;
			variable = null;
			
			isContained = null;
			isContainedEvent = null;
			isNotContainedEvent = null;
		}
        public override void Reset()
        {
            gameObject = null;
            reference = null;
            key = null;
            variable = null;

            successEvent = null;
            keyExistsAlreadyEvent = null;
        }
Exemplo n.º 21
0
        public override void Reset()
        {
            array = null;
            value = null;

            index = null;

            isContained = null;
            isContainedEvent = null;
            isNotContainedEvent = null;
        }
Exemplo n.º 22
0
        public override void Reset()
        {
            gameObject = null;
            reference = null;

            baseIndex = null;
            increment = null;

            result = null;
            resultIndex = null;
        }
		public override void Reset()
		{
		
			gameObject = null;
			reference = null;
	
			failureEvent = null;
			
			result = null;
			
		}
		public override void Reset()
		{
			assetPath = null;
			storeAsset = new FsmVar();
			storeAsset.Type = VariableType.Texture;

			success = null;
			isDone = null;
			progress = null;
			doneEvent = null;
			failureEvent = null;
		}
Exemplo n.º 25
0
		public override void Reset()
		{
			gameObject = null;
			reference = null;
			startIndex = null;
			count = null;
			itemFound = null;
			itemNotFound = null;
			
			variable = null;
			
		}
		public override void Reset()
		{		
			array = null;
			startIndex = null;
			endIndex = null;

			currentIndex = null;

			loopEvent = null;
			finishedEvent = null;
			
			result = null;
		}
Exemplo n.º 27
0
		public override void Reset()
		{
			
			gameObject = null;
			key = null;
			
			KeyFoundEvent = null;
			KeyNotFoundEvent = null;
			
			result = null;
			
			
		}
Exemplo n.º 28
0
		public override void Reset()
		{
		
			gameObject = null;
			reference = null;
			startIndex = null;
			endIndex = null;
			
			loopEvent = null;
			finishedEvent = null;
	
			failureEvent = null;
			
			result = null;
			
		}
		/// <summary>
		/// Display an _selectionIndex the fsm variable from a list of variables ( from an fsm likely).
		/// This is to paliate for the PlayMaker 1.8 that deprecated the api call VariableEditor.FsmVarPopup()
		/// </summary>
		/// <returns>The fsm variable GU.</returns>
		/// <param name="fieldLabel">Field label.</param>
		/// <param name="fsmVariables">Fsm variables.</param>
		/// <param name="selection">Selection.</param>
		/// <param name="GuiChanged">GUI changed flag</param>
		public static FsmVar EditorGUILayout_FsmVarPopup(string fieldLabel,NamedVariable[] namedVariables,FsmVar selection,out bool GuiChanged)
		{
			GuiChanged = false;

			if (namedVariables==null)
			{
				Debug.LogWarning("EditorGUILayout_FsmVarPopup: namedVariables is null");
				return null;
			}



			int _selectionIndex = 0;

			string[] _variableChoices = new string[namedVariables.Length+1];
			_variableChoices[0] = "None";
			for(int i=0;i<namedVariables.Length;i++)
			{
				if (string.Equals(selection.variableName,namedVariables[i].Name))
				{
					_selectionIndex = i+1;
				}
				_variableChoices[i+1] = namedVariables[i].Name;
			}
			
			if (_variableChoices.Length!=0)
			{

				int _choiceIndex =  EditorGUILayout.Popup(fieldLabel,_selectionIndex,_variableChoices);
				if (_choiceIndex != _selectionIndex)
				{
					GuiChanged = true;

					if (_choiceIndex==0)
					{
						return new FsmVar();
					}else{
						FsmVar _newSelection = new FsmVar(namedVariables[_choiceIndex-1]);
						_newSelection.useVariable = true;
						return _newSelection;
					}

				}
			}

			return selection;
		}
Exemplo n.º 30
0
    // ONLY WORKS IF THE FSMVAR POINTS TO A REGULAR FSM VARIABLE
    public static void RefreshValueFromFsmVar(Fsm fromFsm, FsmVar fsmVar)
    {
        if (fromFsm == null)
        {
            return;
        }
        if (fsmVar == null)
        {
            return;
        }

        if (!fsmVar.useVariable)
        {
            return;
        }

        switch (fsmVar.Type)
        {
        case VariableType.Int:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmInt(fsmVar.variableName));
            break;

        case VariableType.Float:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmFloat(fsmVar.variableName));
            break;

        case VariableType.Bool:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmBool(fsmVar.variableName));
            break;

        case VariableType.Color:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmColor(fsmVar.variableName));
            break;

        case VariableType.Quaternion:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmQuaternion(fsmVar.variableName));
            break;

        case VariableType.Rect:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmRect(fsmVar.variableName));
            break;

        case VariableType.Vector2:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmVector2(fsmVar.variableName));
            break;

        case VariableType.Vector3:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmVector3(fsmVar.variableName));
            break;

        case VariableType.Texture:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmVector3(fsmVar.variableName));
            break;

        case VariableType.Material:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmMaterial(fsmVar.variableName));
            break;

        case VariableType.String:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmString(fsmVar.variableName));
            break;

        case VariableType.GameObject:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmGameObject(fsmVar.variableName));
            break;

                #if PLAYMAKER_1_8
        case VariableType.Enum:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmEnum(fsmVar.variableName));
            break;

        case VariableType.Array:
            fsmVar.GetValueFrom((NamedVariable)fromFsm.Variables.GetFsmArray(fsmVar.variableName));
            break;
                #endif
        }
    }
Exemplo n.º 31
0
 public override void Reset()
 {
     this.gameObject = null;
     this.fsmName    = string.Empty;
     this.setValue   = new FsmVar();
 }
Exemplo n.º 32
0
 public override void Reset()
 {
     assetPath       = null;
     storeAsset      = new FsmVar();
     storeAsset.Type = VariableType.Texture;
 }
Exemplo n.º 33
0
 public override void Reset()
 {
     gameObject = null;
     fsmName    = "";
     setValue   = new FsmVar();
 }
Exemplo n.º 34
0
        public override void OnEnter()
        {
            string file = saveFile.Value + "?tag=" + prefixTag;

            for (int i = 0; i < tags.Length; i++)
            {
                if (!tags[i].IsNone || !tags[i].Value.Equals(""))
                {
                    string tag    = tags[i].Value;
                    FsmVar fsmVar = values[i];

                    string _fullFile = file;
                    if (!tags[i].IsNone)
                    {
                        _fullFile = _fullFile + tag;
                    }

                    switch (fsmVar.Type)
                    {
                    case VariableType.Int:
                        PlayMakerUtils.ApplyValueToFsmVar(this.Fsm, fsmVar, ES2.Load <int>(_fullFile));
                        break;

                    case VariableType.Float:
                        PlayMakerUtils.ApplyValueToFsmVar(this.Fsm, fsmVar, ES2.Load <float>(_fullFile));
                        break;

                    case VariableType.Bool:
                        PlayMakerUtils.ApplyValueToFsmVar(this.Fsm, fsmVar, ES2.Load <bool>(_fullFile));
                        break;

                    case VariableType.Color:
                        PlayMakerUtils.ApplyValueToFsmVar(this.Fsm, fsmVar, ES2.Load <Color>(_fullFile));
                        break;

                    case VariableType.Quaternion:
                        PlayMakerUtils.ApplyValueToFsmVar(this.Fsm, fsmVar, ES2.Load <Quaternion>(_fullFile));
                        break;

                    case VariableType.Rect:
                        PlayMakerUtils.ApplyValueToFsmVar(this.Fsm, fsmVar, ES2.Load <Rect>(_fullFile));
                        break;

                    case VariableType.Vector2:
                        PlayMakerUtils.ApplyValueToFsmVar(this.Fsm, fsmVar, ES2.Load <Vector2>(_fullFile));
                        break;

                    case VariableType.Vector3:
                        PlayMakerUtils.ApplyValueToFsmVar(this.Fsm, fsmVar, ES2.Load <Vector3>(_fullFile));
                        break;

                    case VariableType.String:
                        PlayMakerUtils.ApplyValueToFsmVar(this.Fsm, fsmVar, ES2.Load <string>(_fullFile));
                        break;

                    default:
                        LogError("PlayerPrefsx does not support saving " + fsmVar.Type);
                        break;
                    }
                }
            }

            Finish();
        }
Exemplo n.º 35
0
 public override void Reset()
 {
     this.gameObject = null;
     this.reference  = null;
     this.variable   = null;
 }
Exemplo n.º 36
0
 public override void Reset()
 {
     gameObject = null;
     fsmName    = "";
     storeValue = null;
 }
Exemplo n.º 37
0
 public override void Reset()
 {
     array   = null;
     value   = null;
     ifEmpty = true;
 }
Exemplo n.º 38
0
 public override void OnReset()
 {
     key          = "key";
     value        = null;
     defaultValue = null;
 }
Exemplo n.º 39
0
 public override void OnReset()
 {
     value = null;
 }
Exemplo n.º 40
0
    public static bool ApplyValueToFsmVar(Fsm fromFsm, FsmVar fsmVar, object value)
    {
        if (fromFsm == null)
        {
            return(false);
        }
        if (fsmVar == null)
        {
            return(false);
        }


        if (value == null)
        {
            if (fsmVar.Type == VariableType.Bool)
            {
                FsmBool _target = fromFsm.Variables.GetFsmBool(fsmVar.variableName);
                _target.Value = false;
            }
            else if (fsmVar.Type == VariableType.Color)
            {
                FsmColor _target = fromFsm.Variables.GetFsmColor(fsmVar.variableName);
                _target.Value = Color.black;
            }
            else if (fsmVar.Type == VariableType.Int)
            {
                FsmInt _target = fromFsm.Variables.GetFsmInt(fsmVar.variableName);
                _target.Value = 0;
            }
            else if (fsmVar.Type == VariableType.Float)
            {
                FsmFloat _target = fromFsm.Variables.GetFsmFloat(fsmVar.variableName);
                _target.Value = 0f;
            }
            else if (fsmVar.Type == VariableType.GameObject)
            {
                FsmGameObject _target = fromFsm.Variables.GetFsmGameObject(fsmVar.variableName);
                _target.Value = null;
            }
            else if (fsmVar.Type == VariableType.Material)
            {
                FsmMaterial _target = fromFsm.Variables.GetFsmMaterial(fsmVar.variableName);
                _target.Value = null;
            }
            else if (fsmVar.Type == VariableType.Object)
            {
                FsmObject _target = fromFsm.Variables.GetFsmObject(fsmVar.variableName);
                _target.Value = null;
            }
            else if (fsmVar.Type == VariableType.Quaternion)
            {
                FsmQuaternion _target = fromFsm.Variables.GetFsmQuaternion(fsmVar.variableName);
                _target.Value = Quaternion.identity;
            }
            else if (fsmVar.Type == VariableType.Rect)
            {
                FsmRect _target = fromFsm.Variables.GetFsmRect(fsmVar.variableName);
                _target.Value = new Rect(0, 0, 0, 0);
            }
            else if (fsmVar.Type == VariableType.String)
            {
                FsmString _target = fromFsm.Variables.GetFsmString(fsmVar.variableName);
                _target.Value = "";
            }
            else if (fsmVar.Type == VariableType.String)
            {
                FsmTexture _target = fromFsm.Variables.GetFsmTexture(fsmVar.variableName);
                _target.Value = null;
            }
            else if (fsmVar.Type == VariableType.Vector2)
            {
                FsmVector2 _target = fromFsm.Variables.GetFsmVector2(fsmVar.variableName);
                _target.Value = Vector2.zero;
            }
            else if (fsmVar.Type == VariableType.Vector3)
            {
                FsmVector3 _target = fromFsm.Variables.GetFsmVector3(fsmVar.variableName);
                _target.Value = Vector3.zero;
            }
                        #if PLAYMAKER_1_8
            else if (fsmVar.Type == VariableType.Enum)
            {
                FsmEnum _target = fromFsm.Variables.GetFsmEnum(fsmVar.variableName);
                _target.ResetValue();
            }
            else if (fsmVar.Type == VariableType.Array)
            {
                FsmArray _target = fromFsm.Variables.GetFsmArray(fsmVar.variableName);
                _target.Reset();
            }
                        #endif
            return(true);
        }

        System.Type valueType = value.GetType();

        //Debug.Log("valueType  "+valueType);

        System.Type storageType = null;

        //	Debug.Log("fsmVar type "+fsmVar.Type);

        switch (fsmVar.Type)
        {
        case VariableType.Int:
            storageType = typeof(int);
            break;

        case VariableType.Float:
            storageType = typeof(float);
            break;

        case VariableType.Bool:
            storageType = typeof(bool);
            break;

        case VariableType.Color:
            storageType = typeof(Color);
            break;

        case VariableType.GameObject:
            storageType = typeof(GameObject);
            break;

        case VariableType.Quaternion:
            storageType = typeof(Quaternion);
            break;

        case VariableType.Rect:
            storageType = typeof(Rect);
            break;

        case VariableType.String:
            storageType = typeof(string);
            break;

        case VariableType.Texture:
            storageType = typeof(Texture2D);
            break;

        case VariableType.Vector2:
            storageType = typeof(Vector2);
            break;

        case VariableType.Vector3:
            storageType = typeof(Vector3);
            break;

        case VariableType.Object:
            storageType = typeof(Object);
            break;

        case VariableType.Material:
            storageType = typeof(Material);
            break;

                #if PLAYMAKER_1_8
        case VariableType.Enum:
            storageType = typeof(System.Enum);
            break;

        case VariableType.Array:
            storageType = typeof(System.Array);
            break;
                #endif
        }

        bool ok = true;
        if (!storageType.Equals(valueType))
        {
            ok = false;
            if (storageType.Equals(typeof(Object)))             // we are ok
            {
                ok = true;
            }
                        #if PLAYMAKER_1_8
            if (storageType.Equals(typeof(System.Enum)))             // we are ok
            {
                ok = true;
            }
                        #endif
            if (!ok)
            {
                                #if UNITY_WEBGL
                // proceduralMaterial not supported
                                #else
                if (valueType.Equals(typeof(ProceduralMaterial)))                 // we are ok
                {
                    ok = true;
                }
                                #endif
                if (valueType.Equals(typeof(double)))                 // we are ok
                {
                    ok = true;
                }
                if (valueType.Equals(typeof(System.Int64)))                 // we are ok
                {
                    ok = true;
                }
                if (valueType.Equals(typeof(System.Byte)))                 // we are ok
                {
                    ok = true;
                }
            }
        }


        if (!ok)
        {
            Debug.LogError("The fsmVar value <" + storageType + "> doesn't match the value <" + valueType + "> on state" + fromFsm.ActiveStateName + " on fsm:" + fromFsm.Name + " on GameObject:" + fromFsm.GameObjectName);
            return(false);
        }


        if (valueType == typeof(bool))
        {
            FsmBool _target = fromFsm.Variables.GetFsmBool(fsmVar.variableName);
            _target.Value = (bool)value;
        }
        else if (valueType == typeof(Color))
        {
            FsmColor _target = fromFsm.Variables.GetFsmColor(fsmVar.variableName);
            _target.Value = (Color)value;
        }
        else if (valueType == typeof(int))
        {
            FsmInt _target = fromFsm.Variables.GetFsmInt(fsmVar.variableName);
            _target.Value = System.Convert.ToInt32(value);
        }
        else if (valueType == typeof(byte))
        {
            FsmInt _target = fromFsm.Variables.GetFsmInt(fsmVar.variableName);
            _target.Value = System.Convert.ToInt32(value);
        }
        else if (valueType == typeof(System.Int64))
        {
            if (fsmVar.Type == VariableType.Int)
            {
                FsmInt _target = fromFsm.Variables.GetFsmInt(fsmVar.variableName);
                _target.Value = System.Convert.ToInt32(value);
            }
            else if (fsmVar.Type == VariableType.Float)
            {
                FsmFloat _target = fromFsm.Variables.GetFsmFloat(fsmVar.variableName);
                _target.Value = System.Convert.ToSingle(value);
            }
        }
        else if (valueType == typeof(float))
        {
            FsmFloat _target = fromFsm.Variables.GetFsmFloat(fsmVar.variableName);
            _target.Value = (float)value;
        }
        else if (valueType == typeof(double))
        {
            FsmFloat _target = fromFsm.Variables.GetFsmFloat(fsmVar.variableName);
            _target.Value = System.Convert.ToSingle(value);
        }
        else if (valueType == typeof(GameObject))
        {
            FsmGameObject _target = fromFsm.Variables.GetFsmGameObject(fsmVar.variableName);
            _target.Value = (GameObject)value;
        }
        else if (valueType == typeof(Material))
        {
            FsmMaterial _target = fromFsm.Variables.GetFsmMaterial(fsmVar.variableName);
            _target.Value = (Material)value;

                #if UNITY_WEBGL
            // proceduralMaterial not supported
                #else
        }
        else if (valueType == typeof(ProceduralMaterial))
        {
            FsmMaterial _target = fromFsm.Variables.GetFsmMaterial(fsmVar.variableName);
            _target.Value = (ProceduralMaterial)value;
                #endif
        }
        else if (valueType == typeof(Object) || storageType == typeof(Object))
        {
            FsmObject _target = fromFsm.Variables.GetFsmObject(fsmVar.variableName);
            _target.Value = (Object)value;
        }
        else if (valueType == typeof(Quaternion))
        {
            FsmQuaternion _target = fromFsm.Variables.GetFsmQuaternion(fsmVar.variableName);
            _target.Value = (Quaternion)value;
        }
        else if (valueType == typeof(Rect))
        {
            FsmRect _target = fromFsm.Variables.GetFsmRect(fsmVar.variableName);
            _target.Value = (Rect)value;
        }
        else if (valueType == typeof(string))
        {
            FsmString _target = fromFsm.Variables.GetFsmString(fsmVar.variableName);
            _target.Value = (string)value;
        }
        else if (valueType == typeof(Texture2D))
        {
            FsmTexture _target = fromFsm.Variables.GetFsmTexture(fsmVar.variableName);
            _target.Value = (Texture2D)value;
        }
        else if (valueType == typeof(Vector2))
        {
            FsmVector2 _target = fromFsm.Variables.GetFsmVector2(fsmVar.variableName);
            _target.Value = (Vector2)value;
        }
        else if (valueType == typeof(Vector3))
        {
            FsmVector3 _target = fromFsm.Variables.GetFsmVector3(fsmVar.variableName);
            _target.Value = (Vector3)value;

                #if PLAYMAKER_1_8
        }
        else if (valueType.BaseType == typeof(System.Enum))
        {
            FsmEnum _target = fromFsm.Variables.GetFsmEnum(fsmVar.variableName);
            _target.Value = (System.Enum)value;
                #endif
        }
        else
        {
            Debug.LogWarning("?!?!" + valueType);
            //  don't know, should I put in FsmObject?
        }


        return(true);
    }
Exemplo n.º 41
0
    public static object GetValueFromFsmVar(Fsm fromFsm, FsmVar fsmVar)
    {
        if (fromFsm == null)
        {
            return(null);
        }
        if (fsmVar == null)
        {
            return(null);
        }

        if (fsmVar.useVariable)
        {
            string _name = fsmVar.variableName;

            switch (fsmVar.Type)
            {
            case VariableType.Int:
                return(fromFsm.Variables.GetFsmInt(_name).Value);

            case VariableType.Float:
                return(fromFsm.Variables.GetFsmFloat(_name).Value);

            case VariableType.Bool:
                return(fromFsm.Variables.GetFsmBool(_name).Value);

            case VariableType.Color:
                return(fromFsm.Variables.GetFsmColor(_name).Value);

            case VariableType.Quaternion:
                return(fromFsm.Variables.GetFsmQuaternion(_name).Value);

            case VariableType.Rect:
                return(fromFsm.Variables.GetFsmRect(_name).Value);

            case VariableType.Vector2:
                return(fromFsm.Variables.GetFsmVector2(_name).Value);

            case VariableType.Vector3:
                return(fromFsm.Variables.GetFsmVector3(_name).Value);

            case VariableType.Texture:
                return(fromFsm.Variables.GetFsmTexture(_name).Value);

            case VariableType.Material:
                return(fromFsm.Variables.GetFsmMaterial(_name).Value);

            case VariableType.String:
                return(fromFsm.Variables.GetFsmString(_name).Value);

            case VariableType.GameObject:
                return(fromFsm.Variables.GetFsmGameObject(_name).Value);

            case VariableType.Object:
                return(fromFsm.Variables.GetFsmObject(_name).Value);

                        #if PLAYMAKER_1_8
            case VariableType.Enum:
                return(fromFsm.Variables.GetFsmEnum(_name).Value);

            case VariableType.Array:
                return(fromFsm.Variables.GetFsmArray(_name).Values);
                        #endif
            }
        }
        else
        {
            switch (fsmVar.Type)
            {
            case VariableType.Int:
                return(fsmVar.intValue);

            case VariableType.Float:
                return(fsmVar.floatValue);

            case VariableType.Bool:
                return(fsmVar.boolValue);

            case VariableType.Color:
                return(fsmVar.colorValue);

            case VariableType.Quaternion:
                return(fsmVar.quaternionValue);

            case VariableType.Rect:
                return(fsmVar.rectValue);

            case VariableType.Vector2:
                return(fsmVar.vector2Value);

            case VariableType.Vector3:
                return(fsmVar.vector3Value);

            case VariableType.Texture:
                return(fsmVar.textureValue);

            case VariableType.Material:
                return(fsmVar.materialValue);

            case VariableType.String:
                return(fsmVar.stringValue);

            case VariableType.GameObject:
                return(fsmVar.gameObjectValue);

            case VariableType.Object:
                return(fsmVar.objectReference);

                        #if PLAYMAKER_1_8
            case VariableType.Enum:
                return(fsmVar.EnumValue);

            case VariableType.Array:
                return(fsmVar.arrayValue);
                        #endif
            }
        }

        return(null);
    }
 public override void Reset()
 {
     gameObject = null;
     fsmName = "";
     value = null;
 }
Exemplo n.º 43
0
 public override void Reset()
 {
     array   = null;
     value   = null;
     atIndex = null;
 }