コード例 #1
0
	private static SceneManagerSettings Instance ()
	{
		if (instance == null)
		{
			instance = Resources.Load (SettingsAssetName) as SceneManagerSettings;
			if (instance == null)
			{
				instance = CreateInstance<SceneManagerSettings> ();
#if UNITY_EDITOR
				string properPath = Path.Combine (Application.dataPath, SettingsAssetPath);
				if (Directory.Exists (properPath) == false)
					AssetDatabase.CreateFolder ("Assets", SettingsAssetPath);

				string fullPath = Path.Combine (Path.Combine("Assets", SettingsAssetPath),
					SettingsAssetName + SettingsAssetExtension
				);
				AssetDatabase.CreateAsset (instance, fullPath);
#endif
			}
		}
		return instance;
	}
コード例 #2
0
    private static SceneManagerSettings Instance()
    {
        if (instance == null)
        {
            instance = Resources.Load(SettingsAssetName) as SceneManagerSettings;
            if (instance == null)
            {
                instance = CreateInstance <SceneManagerSettings> ();
#if UNITY_EDITOR
                string properPath = Path.Combine(Application.dataPath, SettingsAssetPath);
                if (Directory.Exists(properPath) == false)
                {
                    AssetDatabase.CreateFolder("Assets", SettingsAssetPath);
                }

                string fullPath = Path.Combine(Path.Combine("Assets", SettingsAssetPath),
                                               SettingsAssetName + SettingsAssetExtension
                                               );
                AssetDatabase.CreateAsset(instance, fullPath);
#endif
            }
        }
        return(instance);
    }