데이터 저장 방식 변경(애셋 사용x)

데이터 저장 및 로드에 암호화 복호화 적용
앨범, 프로필 관련 수정 사항 적용
This commit is contained in:
Ino 2025-12-04 16:00:36 +09:00
parent b7497cd2a4
commit d2212749af
20 changed files with 102 additions and 4405 deletions

View File

@ -1,27 +1,12 @@
using GUPS.AntiCheat.Protected;
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using TigerForge;
using GUPS.AntiCheat.Protected;
using Newtonsoft.Json;
using UnityEngine;
public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
{
EasyFileSave _EasyFile;
EasyFileSave m_EasyFile
{
get
{
if (_EasyFile == null)
{
_EasyFile = new EasyFileSave();
m_EasyFile.Load("shegotwet");
}
return _EasyFile;
}
}
public SaveData m_SaveData;
IEnumerator Start()
@ -45,7 +30,7 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
public void Load()
{
m_SaveData = (SaveData)m_EasyFile.GetDeserialized("SaveData", typeof(SaveData));
m_SaveData = CryptoUtil.Load<SaveData>("SaveData");
if (m_SaveData == null)
{
m_SaveData = new SaveData
@ -61,9 +46,10 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
SelectGirlID = 1,
LastDoY = 0,
AttendanceDoY = 0,
GirlUnLockIndex = 1,
MiniGameHP = table_GlobalValue.Ins.Get_Int("MiniGame_TotalEnterMoney")
};
Open_Album(table_album.Ins.Get_DataList()[0]);
}
}
@ -71,10 +57,7 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
public void Save()
{
if (m_SaveData != null)
{
m_EasyFile.AddSerialized("SaveData", m_SaveData);
m_EasyFile.Save("shegotwet");
}
CryptoUtil.Save(m_SaveData, "SaveData");
}
public void Set_Option(eOption option)
@ -247,8 +230,13 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
Save();
}
public void Open_Image() { ++m_SaveData.GirlUnLockIndex; }
public int Get_UnLockIndex() { return m_SaveData.GirlUnLockIndex; }
public void Open_Album(albumtabledata data)
{
if (!m_SaveData.dic_ablumopen.ContainsKey(data.n_GirlID))
m_SaveData.dic_ablumopen.Add(data.n_GirlID, new List<int>());
if (!m_SaveData.dic_ablumopen[data.n_GirlID].Contains(data.n_Index))
m_SaveData.dic_ablumopen[data.n_GirlID].Add(data.n_Index);
}
public int Get_SelectGirlID() { return m_SaveData.SelectGirlID; }
public void Set_SelectGirlID(int id)
{
@ -268,16 +256,14 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
}
return true;
}
public bool IsOpenAlbum(albumtabledata data)
{
return m_SaveData.dic_ablumopen.ContainsKey(data.n_GirlID) &&
m_SaveData.dic_ablumopen[data.n_GirlID].Contains(data.n_Index);
}
public int Get_ImageCount(int girlid)
{
var lst = table_album.Ins.Get_DataList(girlid);
var count = 0;
for (int i = 0; i < lst.Count; i++)
{
if (lst[i].n_Index <= Get_UnLockIndex())
++count;
}
return count;
return m_SaveData.dic_ablumopen.ContainsKey(girlid) ? m_SaveData.dic_ablumopen[girlid].Count : 0;
}
public void Set_ShopReward(shoptabledata data)
@ -425,7 +411,6 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
ProtectedInt32 _LastDoY; public int LastDoY { get { return _LastDoY; } set { _LastDoY = value; _LastDoY.Obfuscate(); } }
ProtectedInt32 _WeekOfYear; public int WeekOfYear { get { return _WeekOfYear; } set { _WeekOfYear = value; _WeekOfYear.Obfuscate(); } }
ProtectedInt32 _GirlSelectIndex; public int SelectGirlID { get { return _GirlSelectIndex; } set { _GirlSelectIndex = value; _GirlSelectIndex.Obfuscate(); } }
ProtectedInt32 _GirlUnLockIndex; public int GirlUnLockIndex { get { return _GirlUnLockIndex; } set { _GirlUnLockIndex = value; _GirlUnLockIndex.Obfuscate(); } }
ProtectedInt32 _AttendanceDoY; public int AttendanceDoY { get { return _AttendanceDoY; } set { _AttendanceDoY = value; _AttendanceDoY.Obfuscate(); } }
ProtectedInt32 _Attendance; public int Attendance { get { return _Attendance; } set { _Attendance = value; _Attendance.Obfuscate(); } }
@ -453,6 +438,7 @@ public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
ProtectedBool _BuyShopDisableOne1; public bool BuyShopDisableOne1 { get { return _BuyShopDisableOne1; } set { _BuyShopDisableOne1 = value; _BuyShopDisableOne1.Obfuscate(); } }
ProtectedBool _BuyShopDisableOne2; public bool BuyShopDisableOne2 { get { return _BuyShopDisableOne2; } set { _BuyShopDisableOne2 = value; _BuyShopDisableOne2.Obfuscate(); } }
public Dictionary<int, List<int>> dic_ablumopen = new Dictionary<int, List<int>>();
public List<ShopADSaveData> list_ShopLimit = new List<ShopADSaveData>();
public List<ChatSaveData> list_ChatSaveData = new List<ChatSaveData>();
}

View File

@ -31,20 +31,20 @@ public class AlbumCard : CardBase
public override void Set_UI()
{
gos[0].SetActive(m_Data.n_Index == SaveMgr.Ins.Get_UnLockIndex() + 1 && m_Data.n_Price > 0);
gos[0].SetActive(!SaveMgr.Ins.IsOpenAlbum(m_Data));
t_price.text = m_Data.n_Price.ToString();
//if (i_girl.enabled) i_girl.material = IsObtain() ? null : mat_blur;
gos[1].SetActive(!IsObtain());
}
public bool IsObtain() { return m_Data.n_Index <= SaveMgr.Ins.Get_UnLockIndex(); }
public bool IsObtain() { return SaveMgr.Ins.IsOpenAlbum(m_Data); }
public void OnClick_Buy()
{
if (SaveMgr.Ins.Check_Money(eMoney.AlbumOpen, m_Data.n_Price))
{
SaveMgr.Ins.Add_Money(eMoney.AlbumOpen, -m_Data.n_Price);
SaveMgr.Ins.Open_Image();
SaveMgr.Ins.Open_Album(m_Data);
SaveMgr.Ins.Save();
LobbyUI.Ins.m_LobbyCenterProfileUI.Set(false);

View File

@ -101,7 +101,7 @@ public class ProfileCard : MonoBehaviour
{
if (CanOpen())
{ // 열 수 있음
SaveMgr.Ins.Open_Image(); // 최초 한 장 공짜 지급
SaveMgr.Ins.Open_Album(table_album.Ins.Get_DataList()[0]); // 최초 한 장 공짜 지급
SaveMgr.Ins.Save();
Set_UI();

View File

@ -0,0 +1,76 @@
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using Newtonsoft.Json;
using UnityEngine;
public static class CryptoUtil
{
private static readonly string Key = "7gT9KfL2xQ1bN4pV6sH8jD3zW0cR5mYq"; // 32바이트
private static readonly string IV = "aB3dE6gH9jK2mP5Q"; // 16바이트
public static string Encrypt(string plainText)
{
using (Aes aes = Aes.Create())
{
aes.Key = Encoding.UTF8.GetBytes(Key);
aes.IV = Encoding.UTF8.GetBytes(IV);
using (var ms = new MemoryStream())
using (var cs = new CryptoStream(ms, aes.CreateEncryptor(), CryptoStreamMode.Write))
using (var sw = new StreamWriter(cs))
{
sw.Write(plainText);
sw.Close();
return Convert.ToBase64String(ms.ToArray());
}
}
}
public static string Decrypt(string cipherText)
{
byte[] buffer = Convert.FromBase64String(cipherText);
using (Aes aes = Aes.Create())
{
aes.Key = Encoding.UTF8.GetBytes(Key);
aes.IV = Encoding.UTF8.GetBytes(IV);
using (var ms = new MemoryStream(buffer))
using (var cs = new CryptoStream(ms, aes.CreateDecryptor(), CryptoStreamMode.Read))
using (var sr = new StreamReader(cs))
{
return sr.ReadToEnd();
}
}
}
public static void Save(object data, string filename)
{
string json = JsonConvert.SerializeObject(data);
// 암호화
string encrypted = Encrypt(json);
string path = Path.Combine(Application.persistentDataPath, filename);
File.WriteAllText(path, encrypted);
//Debug.Log("Saved to: " + path);
}
public static T Load<T>(string filename)
{
string path = Path.Combine(Application.persistentDataPath, filename);
if (File.Exists(path) == false)
return default;
string encrypted = File.ReadAllText(path);
// 복호화
string json = Decrypt(encrypted);
return JsonConvert.DeserializeObject<T>(json);
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: ef855febcbbf51c45bdd8ee568c300d9

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 01ffeed7f274cbf4f841fd7e061ef6bc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 56ac68a733c3d1b45ad8ebbf2c8df088
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: da326e740f7dac54683976f28bba2bed
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,283 +0,0 @@
using System.Collections.Generic;
using UnityEngine;
using TigerForge;
namespace TigerForge
{
public class Demo : MonoBehaviour
{
// Instance of Easy File Save
EasyFileSave myFile;
// Item class
[System.Serializable]
public class Item
{
public string name = "";
public int quantity = 0;
}
// Variables for this Demo.
string character;
string nickname;
int age;
float strenght;
bool has_sword;
bool has_bow;
int[] skills;
List<string> equipment;
Vector3 initialLocation;
Dictionary<string, int> coins;
List<Item> items;
void Start()
{
// Start a new instance of Easy File Save. The file name is not specified, so a default name will be used.
myFile = new EasyFileSave();
myFile.suppressWarning = false;
// If this file already exists for some reason, I delete it.
myFile.Delete();
Debug.Log(">> HELLO! I'M READY!" + "\n");
}
void Update()
{
// When [S] key is pressed: SAVE.
if (Input.GetKeyUp(KeyCode.S))
{
Debug.Log(">> I'M GOING TO SAVE SOME DATA!" + "\n");
// Some values.
equipment = new List<string>();
equipment.Add("Hammer");
equipment.Add("Knife");
equipment.Add("Rope");
initialLocation = new Vector3(101.5f, -30.4f, 22f);
coins = new Dictionary<string, int>();
coins.Add("Copper", 1200);
coins.Add("Silver", 450);
coins.Add("Gold", 300);
// Simple data.
character = "Conan";
age = 30;
strenght = 300.5f;
has_sword = true;
has_bow = false;
skills = new int[] { 6, 10, 22, 46, 69 };
myFile.Add("name", character);
myFile.Add("age", age);
myFile.Add("strenght", strenght);
myFile.Add("has_sword", has_sword);
myFile.Add("has_bow", has_bow);
myFile.Add("skills_id", skills);
// GameObject data.
myFile.Add("equipment", equipment);
myFile.Add("coins", coins);
myFile.Add("initialLocation", initialLocation);
myFile.Add("player", gameObject.transform);
// Class data (serialization).
items = new List<Item>();
items.Add(new Item { name = "Gold", quantity = 15000 });
items.Add(new Item { name = "Darts", quantity = 24 });
items.Add(new Item { name = "Potions", quantity = 10 });
myFile.AddSerialized("items", items);
// Custom Extension for managing BoxCollider
myFile.AddCustom("collider", gameObject.GetComponent<BoxCollider>(), "BoxCollider");
// Save all the collected data.
// At the end of the process, stored data is cleared to free memory.
myFile.Save();
Debug.Log(">> Data saved in: " + myFile.GetFileName() + "\n");
ShowData();
}
// When [L] key is pressed: LOAD.
if (Input.GetKeyUp(KeyCode.L))
{
// Load data from file.
if (myFile.Load())
{
Debug.Log(">> I'M GOING TO USE LOADED DATA!" + "\n");
// Simple data.
character = myFile.GetString("name");
age = myFile.GetInt("age");
strenght = myFile.GetFloat("strenght");
has_sword = myFile.GetBool("has_sword");
has_bow = myFile.GetBool("has_bow");
skills = myFile.GetArray<int>("skills_id");
// In this case, if 'nickname' key doesn't exist, 'user_1234' string is used.
nickname = myFile.GetString("nickname", "user_1234");
// GameObject data.
equipment = myFile.GetList<string>("equipment");
coins = myFile.GetDictionary<string, int>("coins");
initialLocation = myFile.GetUnityVector3("initialLocation");
var tr = myFile.GetUnityTransform("player");
gameObject.transform.position = tr.position;
gameObject.transform.rotation = tr.rotation;
gameObject.transform.localScale = tr.localScale;
// Class data (serialization).
items = (List<Item>)myFile.GetDeserialized("items", typeof(List<Item>));
// Custom Extension for managing BoxCollider.
var bc = myFile.GetCustom("collider", "BoxCollider");
var thisBoxColllider = gameObject.GetComponent<BoxCollider>();
thisBoxColllider.center = new Vector3 { x = bc["centerX"].ToFloat(), y = bc["centerY"].ToFloat(), z = bc["centerZ"].ToFloat() };
thisBoxColllider.isTrigger = bc["isTrigger"].ToBool();
// Loaded data has been used as needed.
// Stored data is manually cleared to free memory.
myFile.Dispose();
Debug.Log(">> Data loaded from: " + myFile.GetFileName() + "\n");
ShowData();
}
}
// When [A] key is pressed: APPEND.
if (Input.GetKeyUp(KeyCode.A))
{
// Simple data.
myFile.Add("nickname", "The Warrior");
myFile.Add("age", 32);
// Append this data to the current file content.
// 'nickname' key is new, so its value is added to the file.
// 'age' key already exists, so its current value is updated with this new one.
myFile.Append();
Debug.Log(">> New data added to: " + myFile.GetFileName() + "\n");
Debug.Log(">> Age value updated to 32." + "\n");
Debug.Log(">> Added nickname." + "\n");
}
// When [Del] key is pressed: FILE DELETE.
if (Input.GetKeyUp(KeyCode.Delete))
{
// Delete this file.
// This method clears stored data as well.
myFile.Delete();
Debug.Log(">> The file has been deleted." + "\n");
}
// When [T] key is pressed: SAVING AND LOADING DATA TEST.
if (Input.GetKeyUp(KeyCode.T))
{
// Perform a test of writing and loading data.
// -------------------------------------------
myFile.Delete();
// Add some values to the internal storage for saving and loading test.
equipment = new List<string>();
equipment.Add("Hammer");
equipment.Add("Knife");
equipment.Add("Rope");
initialLocation = new Vector3(101.5f, -30.4f, 22f);
character = "Conan";
age = 30;
strenght = 300.5f;
has_sword = true;
has_bow = false;
items = new List<Item>();
items.Add(new Item { name = "Gold", quantity = 15000 });
items.Add(new Item { name = "Darts", quantity = 24 });
items.Add(new Item { name = "Potions", quantity = 10 });
myFile.Add("name", character);
myFile.Add("age", age);
myFile.Add("strenght", strenght);
myFile.Add("has_sword", has_sword);
myFile.Add("has_bow", has_bow);
myFile.Add("equipment", equipment);
myFile.Add("initialLocation", initialLocation);
myFile.Add("player", gameObject.transform);
myFile.AddSerialized("items", items);
myFile.AddCustom("collider", gameObject.GetComponent<BoxCollider>(), "BoxCollider");
// Test
if (myFile.TestDataSaveLoad())
{
Debug.Log("<color=green>GOOD!</color>\n");
}
else
{
Debug.Log("<color=red>OPS! SOMETHING WENT WRONG!</color>\n");
}
}
}
private void ShowData()
{
Debug.Log("Name: " + character + "\n");
Debug.Log("Nickname: " + nickname + "\n");
Debug.Log("Age: " + age + "\n");
Debug.Log("Stregth: " + strenght + "\n");
Debug.Log("Has a sword: " + has_sword + "\n");
Debug.Log("Has a Bow: " + has_bow + "\n");
Debug.Log("Spawn location: x = " + initialLocation.x + ", y = " + initialLocation.y + ", z = " + initialLocation.z + "\n");
Debug.Log("GameObject position: x = " + gameObject.transform.position.x + ", y = " + gameObject.transform.position.y + ", z = " + gameObject.transform.position.z + "\n");
Debug.Log("GameObject rotation: x = " + gameObject.transform.rotation.x + ", y = " + gameObject.transform.rotation.y + ", z = " + gameObject.transform.rotation.z + "\n");
Debug.Log("GameObject scale: x = " + gameObject.transform.localScale.x + ", y = " + gameObject.transform.localScale.y + ", z = " + gameObject.transform.localScale.z + "\n");
foreach (var n in skills) Debug.Log("Skill ID: " + n + "\n");
foreach (var item in equipment) Debug.Log("Equipment: " + item + "\n");
foreach (KeyValuePair<string, int> item in coins) Debug.Log("Coin - Type: " + item.Key + " Quantity: " + item.Value + "\n");
foreach (var item in items) Debug.Log("Item - Name: " + item.name + " Quantity: " + item.quantity + "\n");
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 5296b1f6b230a0748a634b61dc8016f3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,693 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &515071295
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 515071297}
- component: {fileID: 515071296}
- component: {fileID: 515071298}
m_Layer: 0
m_Name: DEMO
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &515071296
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 515071295}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5296b1f6b230a0748a634b61dc8016f3, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &515071297
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 515071295}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &515071298
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 515071295}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 1, y: 2, z: 3}
--- !u!1 &517188200
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 517188203}
- component: {fileID: 517188202}
- component: {fileID: 517188201}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &517188201
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 517188200}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &517188202
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 517188200}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &517188203
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 517188200}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &566797187
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 566797188}
- component: {fileID: 566797190}
- component: {fileID: 566797189}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &566797188
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 566797187}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1993110673}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &566797189
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 566797187}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.28627452, g: 0.28627452, b: 0.28627452, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &566797190
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 566797187}
m_CullTransparentMesh: 0
--- !u!1 &975714498
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 975714500}
- component: {fileID: 975714499}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &975714499
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 975714498}
m_Enabled: 1
serializedVersion: 9
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &975714500
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 975714498}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &1691826865
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1691826866}
- component: {fileID: 1691826868}
- component: {fileID: 1691826867}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1691826866
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1691826865}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1993110673}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 15, y: -15}
m_SizeDelta: {x: -30, y: -30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1691826867
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1691826865}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 20
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: 'INSTRUCTIONS
Press the keys in the given order. Look at the Console for messages.
1. Press [S] : save some data.
2. Press [L] : load data.
3. Press [A] : append data.
4. Press [L] : load data for checking appended data.
5. Press [DEL] : file delete.
6. Press [T] : file reading / writing test.'
--- !u!222 &1691826868
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1691826865}
m_CullTransparentMesh: 0
--- !u!1 &1993110669
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1993110673}
- component: {fileID: 1993110672}
- component: {fileID: 1993110671}
- component: {fileID: 1993110670}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1993110670
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1993110669}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &1993110671
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1993110669}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!223 &1993110672
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1993110669}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &1993110673
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1993110669}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 566797188}
- {fileID: 1691826866}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &2028864016
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2028864019}
- component: {fileID: 2028864018}
- component: {fileID: 2028864017}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &2028864017
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2028864016}
m_Enabled: 1
--- !u!20 &2028864018
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2028864016}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &2028864019
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2028864016}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: c724f19b6c2c7cd429daa2c2258fdfe0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: eabf4ebc67ab92740b9739e522fd27fc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,116 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class EasyFileSaveExtension
{
// ----------------------------------------
// Add new extension inside this function.
// ----------------------------------------
public void Start()
{
// AddExtension method required parameters:
// - Name of this extension
// - CallBack function to execute when this extension save data
// - An array of unique keys, where each key corresponds to each saved value
AddExtension(
"BoxCollider",
BoxColliderExtension,
new string[] { "centerX", "centerY", "centerZ", "sizeX", "sizeY", "sizeZ", "enabled", "isTrigger", "contactOffset" }
);
}
// ----------------------------------------
// Add callBack functions here.
// ----------------------------------------
// This extension allow Easy File Save to easily save BoxCollider data.
void BoxColliderExtension()
{
// The boxCollider object data received by the AddCustom() method.
var data = GetData("BoxCollider");
// Casting of the object data to BoxCollider.
BoxCollider bc = (BoxCollider)data;
SetParameters(
"BoxCollider",
bc.center.x,
bc.center.y,
bc.center.z,
bc.size.x,
bc.size.y,
bc.size.z,
bc.enabled,
bc.isTrigger,
bc.contactOffset
);
}
// ******************************************************
// DON'T MODIFY ANYTHING UNDER THIS COMMENT:
// ******************************************************
#region " EXTENSIONS ENGINE "
public Dictionary<string, UnityAction> extensions = new Dictionary<string, UnityAction>();
public Dictionary<string, object> data = new Dictionary<string, object>();
public Dictionary<string, List<object>> pars = new Dictionary<string, List<object>>();
public Dictionary<string, List<string>> mapping = new Dictionary<string, List<string>>();
/// <summary>
/// Add a new extension to the Easy File Save system
/// </summary>
private void AddExtension(string name, UnityAction callBack, string[] map)
{
if (!extensions.ContainsKey(name))
{
extensions.Add(name, callBack);
data.Add(name, null);
pars.Add(name, null);
mapping.Add(name, new List<string>(map));
}
else
{
Debug.LogWarning("An extension with name '" + name + "' already exists.");
}
}
/// <summary>
/// Get the object data sent to this callback.
/// </summary>
private object GetData(string extensionName)
{
if (data.ContainsKey(extensionName)) return data[extensionName]; else return null;
}
/// <summary>
/// Collect the object data to save.
/// </summary>
private void SetParameters(string extensionName, params object[] parameters)
{
pars[extensionName] = new List<object>(parameters);
}
#endregion
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 3ef45ac7f06d2e74ca134ddb3d99bfbb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 71d55db41ccbd50488de878f61bab099
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: