예제 #1
0
        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);
            }
        }
예제 #2
0
 public void ExecuteSaveEvent()
 {
     foreach (var item in _salvableScripts)
     {
         var componentWithDataToSave = _gameObject.GetComponent(item);
         if (componentWithDataToSave != null)
         {
             var scriptData = TypeToDataModelMapping.GetSalvableDataFromScript(componentWithDataToSave);
             StoreAllSalvableData(scriptData);
         }
     }
 }