9/19/2023 0 Comments Generateguid coreclasses![]() ![]() StartCoroutine(fadeInOutSaveGame. Yield return new WaitForSeconds(timeToStartSaving) ![]() Public IEnumerator AuatomaticSaveWithTime() ![]() ObjectsToSave.Add(objectsWithGenerateGuid.gameObject) If (objectsWithGenerateGuid.Count > 0 & objectsToSave.Count = 0)įor (int i = 0 i < objectsWithGenerateGuid.Count i++) Var objectsWithGenerateGuid = GameObject.FindObjectsOfType().ToList() Var z = y.Where(component => component is IStateQuery).ToList() ĭictionary zz = z.ToDictionary(sq => (sq as IStateQuery).UniqueId.ToString(), sq => sq as IStateQuery) įoreach (KeyToValue keyvalue in loadedComponents) Var y = objectToSetState.GetComponents() If (uniqueIdToObject.ContainsKey(saveObject.gameObjectUniqueID)) SaveGame saveGame = JsonUtility.FromJson(saveString) įoreach (var saveObject in saveGame.saveObjects) SaveString = SaveSystem.Load(Folder, FileName) ToDictionary(o => o.GetComponent().uniqueGuidID, o => o) Var objectsToLoad = UpdateObjectsToSave() ĭictionary uniqueIdToObject = objectsToLoad Public void Load(string Folder, string FileName) String json = JsonUtility.ToJson(saveGame) Var stateQuer圜omponent = x.Where(component => component is IStateQuery).ToList() ĬomponentsState.Add(new KeyToValue(w.UniqueId.ToString(), w.GetState())) This very detailed answer to a similar question on stack overflow explains why GUIDs arent random, but are highly structured, statistically unique values. Var objectsToSave = UpdateObjectsToSave() Public void Save(string Folder, string FileName) Public FadeInOutSaveGameText fadeInOutSaveGame Then use it like this in the Save and Load methods : using System In the TestState script I'm using the IStateQuery : public class StateTest : MonoBehaviour, IStateQuery Start is called before the first frame update Another issue is that the GuidHelpers.isValid() does not validate Guids the same way as the Guid.isValid does (issue 201 in the SPFx Repo). For instance the GuidHelpers.generateGuid() returns a string. M_state = JsonUtility.FromJson(jsonString) It has a set of similar function to generate and validate Guids, but it does not work with Guid objects, it uses strings instead. Public class StateTest : MonoBehaviour, IStateQuery I wonder why not use the same new instance technic in both cases, why or what the tool for creating guide number 5 is for ? using System Public class GenerateGuid : MonoBehaviour This is when creating a new instance : using System So I wonder what is the difference between creating a new guid instance or selecting in visual studio tools > create guide. The problem is that on each object I want to add to this state script format I need manually to generate a new GUID copy it and paste it to the code and it's a bit annoying. The guide is not the same as in the screenshot it's just for example. In my state script I select Tools > Create GUID > New GUID > Copy ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |