private static void LoadDataInExistingObject(GameObject existingGameObject, InspectorTransformData inspectorData) { existingGameObject.transform.position = inspectorData.position; existingGameObject.SetActive(true); if (inspectorData.ScriptSalvableData != null) { var dataType = Type.GetType(inspectorData.ScriptSalvableData[0]); TypeToDataModelMapping.LoadSalvableDataFromScript(dataType, existingGameObject, inspectorData.ScriptSalvableData); } }
public void ExecuteSaveEvent() { foreach (var item in _salvableScripts) { var componentWithDataToSave = _gameObject.GetComponent(item); if (componentWithDataToSave != null) { var scriptData = TypeToDataModelMapping.GetSalvableDataFromScript(componentWithDataToSave); StoreAllSalvableData(scriptData); } } }