public override void Reset() { array1 = null; array2 = null; SequenceEqual = null; SequenceNotEqual = null; }
public override void Reset() { gameObject = null; fsmName = ""; variableName = null; storeValue = null; copyValues = true; }
public override void Reset() { gameObject = null; array = null; withTag = "Untagged"; layerMask = null; invertMask = null; }
public override void Reset() { stringToSplit = null; separators = null; trimStrings = false; trimChars = null; stringArray = null; }
public override void Reset() { array = null; index = null; everyFrame = false; storeValue = null; indexOutOfRange = null; }
public override void Reset() { array = null; storeValue =null; index = null; everyFrame = false; Repeat = true; }
public override void Reset() { gameObject = null; materialIndex = 0; material = null; shaderKeywords = null; fail = null; }
public override void Reset () { arraySource = null; arrayTarget = null; indexToTransfer = null; copyType = ArrayTransferType.Copy; pasteType = ArrayPasteType.AsLastItem; }
public override void Reset() { array = null; value = null; index = null; isContained = null; isContainedEvent = null; isNotContainedEvent = null; }
public override void Reset() { array = null; startIndex = null; endIndex = null; currentIndex = null; loopEvent = null; finishedEvent = null; result = null; }
public static FsmArray LoadArray(ref FsmArray array,string filename,ES2Settings setting){ // FsmArray array=new FsmArray(); VariableType t=array.ElementType; switch(t){ case VariableType.Bool:{ bool[] bs=ES2.LoadArray<bool>(filename, setting); // array.Values=(object[])bs; // array.Values=bs; array.Resize(bs.Length); for(int i=0;i<bs.Length;i++){ array.Set(i,(object)bs[i]); } break; } case VariableType.Int:{ int[] bs=ES2.LoadArray<int>(filename, setting); // array.intValues=ints; array.Resize(bs.Length); for(int i=0;i<bs.Length;i++){ array.Set(i,(object)bs[i]); } break; } case VariableType.Float:{ float[]bs=ES2.LoadArray<float>(filename, setting); array.Resize(bs.Length); for(int i=0;i<bs.Length;i++){ array.Set(i,(object)bs[i]); } break; } case VariableType.String:{ string[]bs=ES2.LoadArray<string>(filename, setting); array.Resize(bs.Length); for(int i=0;i<bs.Length;i++){ array.Set(i,(object)bs[i]); } break; } default:{ break; } } return array; }
public static void SaveArray(FsmArray array,string filename,ES2Settings setting){ VariableType t= array.ElementType; object[] os; switch(t){ case VariableType.Bool:{ os=array.Values; bool[] bs=new bool[os.Length]; for(int i=0;i<bs.Length;i++){ bs[i]=(bool)os[i]; } ES2.Save(bs, filename, setting); break; } case VariableType.Int:{ os=array.Values; int[] ins=new int[os.Length]; for(int i=0;i<ins.Length;i++){ ins[i]=(int)os[i]; } ES2.Save(ins, filename, setting); break; } case VariableType.Float:{ os=array.Values; float[] fs=new float[os.Length]; for(int i=0;i<fs.Length;i++){ fs[i]=(float)os[i]; } ES2.Save(fs, filename, setting); break; } case VariableType.String:{ os=array.Values; string[] ss=new string[os.Length]; for(int i=0;i<ss.Length;i++){ ss[i]=(string)os[i]; } ES2.Save(ss, filename, setting); break; } default:{ break; } } }
public override void Reset() { gameObjects = null; delay = 0; }
public override void Reset() { array = null; fsmTemplateControl = new FsmTemplateControl(); runFsm = null; }
public override void OnReset() { directoryPath = ""; directories = null; }
public override void Reset() { array = null; variables = new FsmVar[2]; }
public override void Reset() { appID = null; maxDepots = null; depotIds = null; }
public override void OnReset() { filenames = null; }
public override void Reset() { array = null; storeValue =null; everyFrame = false; }
public override void Reset() { withNameContaining = new FsmString[1]; storeCount = null; storeResults = null; }
public override void Reset() { array = null; sceneName = null; }
public override void Reset() { base.Reset(); contactCount = 0; contacts = null; }
void OnEnable() { now = System.DateTime.Now; //Debug.Log(now); if (!PlayerPrefs.HasKey("DateTimeRanking")) // First time booting game { if (PlayerPrefs.HasKey("Username")) // Only reset if username has been set { PlayerPrefs.SetString("DateTimeRanking", now.ToBinary().ToString()); // first time player boots up game, the timer begins Reset(); Debug.Log("Resetting because player prefs not established"); } } else { long temp = System.Convert.ToInt64(PlayerPrefs.GetString("DateTimeRanking")); // grabs saved date time from player prefs System.DateTime oldDate = System.DateTime.FromBinary(temp); //Debug.Log("oldDate :" + oldDate); System.TimeSpan difference = now.Subtract(oldDate); // gets difference between saved time and current time double hours = difference.TotalHours; //print("Difference: " + difference); //print("hours: " + hours); if (hours > 168) // over 1 week since reset { PlayerPrefs.SetString("DateTimeRanking", now.ToBinary().ToString()); Reset(); Debug.Log("Reset because time out"); } else { PullFromPrefs(); Debug.Log("Pulling from Prefs"); } } // grabs past data by either reseting or pulling from player prefs /*if (!PlayerPrefs.HasKey("PlayerName0")) * { * Reset(); * } * else * { * PullFromPrefs(); * }*/ int player_index = -1; // copies player name array so the index of the player can be found for (int i = 0; i <= 8; i++) { // if the name is the players username, then the player's score will go here if (FsmVariables.GlobalVariables.GetFsmArray("PlayerNames").Get(i).ToString() == PlayerPrefs.GetString("Username")) { player_index = i; } else { FsmArray score = FsmVariables.GlobalVariables.GetFsmArray("PlayerScores"); int new_score = int.Parse(score.Get(i).ToString()) + Random.Range(0, 2); score.Set(i, new_score); } } FsmVariables.GlobalVariables.FindFsmArray("PlayerScores").Set(player_index, PlayerPrefs.GetInt("Level")); FsmVariables.GlobalVariables.FindFsmArray("PlayerAvatars").Set(player_index, FsmVariables.GlobalVariables.FindFsmArray("AvatarsList").Get(FsmVariables.GlobalVariables.FindFsmInt("CurrentAvatar").Value)); // sort lists Sort(); // save player prefs for names, avatars, and scores based on sorted list. sets correct animation for (int i = 0; i <= 8; i++) { // sets animation based on where player is ranked if (FsmVariables.GlobalVariables.GetFsmArray("PlayerNames").Get(i).ToString() == PlayerPrefs.GetString("Username")) { transform.parent.GetComponent <Animator>().SetInteger("ranking", i + 1); } PlayerPrefs.SetString("PlayerName" + i, FsmVariables.GlobalVariables.GetFsmArray("PlayerNames").Get(i).ToString()); PlayerPrefs.SetInt("PlayerScore" + i, int.Parse(FsmVariables.GlobalVariables.GetFsmArray("PlayerScores").Get(i).ToString())); GameObject avatar = (GameObject)FsmVariables.GlobalVariables.FindFsmArray("PlayerAvatars").Get(i); PlayerPrefs.SetInt("PlayerAvatar" + i, int.Parse(Regex.Match(avatar.name, @"\d+").Value) - 1); } }
public override void Reset() { userNameHistory = null; steamID = null; }
public override void Reset() { channels = null; }
public override void Reset() { array = null; index = null; indexOutOfRangeEvent = null; }
public override void Reset() { array = null; length = null; everyFrame = false; }
public override void Reset() { base.Reset(); rootGameObjects = null; everyFrame = false; }
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 (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; } 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); }
public override void Reset() { array = null; }
public override void Reset() { assetPath = null; storeAssets = null; }
public override void OnReset() { filePath = "SaveFile.es3"; keys = null; }
public override void Reset() { array = null; value = null; ifEmpty = true; }
public override void Reset() { friends = null; }
public override void OnReset() { keys = null; }
public override void Reset() { array = null; activate = null; resetOnExit = false; }
public override void Reset() { fromGameObject = null; fromPosition = new FsmVector3 { UseVariable = true }; direction = Vector3.forward; radius = 1f; space = Space.Self; distance = 100; storeHitObjects = null; everyFrame = false; layerMask = new FsmInt[0]; invertMask = false; debugColor = Color.yellow; debug = false; hitEvent = null; noHitEvent = null; }
public override void Reset() { eventTarget = new FsmEventTarget(); eventTarget.target = FsmEventTarget.EventTarget.BroadcastAll; content = null; prefab = null; destroyEvent = null; updateEvent = null; everyFrame = false; }
public override void Reset() { array = null; storeValue = null; everyFrame = false; }
public override void Reset () { base.Reset (); source=null; value=null; }
public override void Reset() { friendsRoomStatus = null; }
public override void Reset() { array = null; resetValue = new FsmVar() {useVariable = true}; }
public override void Reset() { friendsInRoomStatus = null; inRoomFriends = null; inLobbyFriends = null; }
public override void Reset() { gameObject = null; fsmName = ""; storeValue = null; }
public override void Reset() { array = null; startIndex = new FsmInt {UseVariable=true}; shufflingRange = new FsmInt {UseVariable=true}; }
public override void Reset() { withTag = "Untagged"; store = null; TagDoesntExistEvent = null; }
public override void Reset() { array = null; value = null; }
public override void Reset() { steamIDList = null; }
public override void OnReset() { filenames = null; searchPattern = ""; }
public override void Reset() { loadValue = null; base.Reset (); // Ensure that base.Reset() is called when done. }
public override void Reset() { fromGameObject = null; fromPosition = new FsmVector3 { UseVariable = true }; direction = new FsmVector3 { UseVariable = true }; space = Space.Self; distance = 100; hitEvent = null; storeDidHit = null; storeHitObjects = null; storeHitPoint = null; storeHitNormal = null; storeHitDistance = null; repeatInterval = 1; layerMask = new FsmInt[0]; invertMask = false; debugColor = Color.yellow; debug = false; }
public override void Reset() { base.Reset(); matchCount = 0; matches = null; }