private static void _EnsureInstance() { if (ms_instance == null) { if (EUtil.AssetExists(PATH)) { //Dbg.Log("EData.sctor: exist"); ms_instance = AssetDatabase.LoadAssetAtPath(PATH, typeof(EData)) as EData; Dbg.Assert(ms_instance != null, "EData.sctor: failed to load asset from path : {0}", PATH); } else { //Dbg.Log("EData.sctor: non-exist"); ms_instance = ScriptableObject.CreateInstance <EData>(); Dbg.Assert(ms_instance != null, "EData.sctor: failed to create asset"); AssetDatabase.CreateAsset(ms_instance, PATH); AssetDatabase.SaveAssets(); } } }