Esempio n. 1
0
        static void CreateArchitectLinker()
        {
            ArchitectLinker linker = ScriptableObject.CreateInstance <ArchitectLinker>();
            string          path   = AssetDatabaseUtility.GenerateUniqueAssetPath("Linker");

            AssetDatabase.CreateAsset(linker, path);
        }
Esempio n. 2
0
        static void CreateUICreationSkinPrefabs()
        {
            UIFactory factory = ScriptableObject.CreateInstance <UIFactory>();
            string    path    = AssetDatabaseUtility.GenerateUniqueAssetPath("UIFactory");

            AssetDatabase.CreateAsset(factory, path);
        }
Esempio n. 3
0
 static void LoadMap()
 {
     if (linker == null)
     {
         Debug.Log("Yo doit select un Linker");
     }
     else
     {
         string     path = AssetDatabaseUtility.GetSelectedAssetPath();
         GameObject map  = new GameObject("Map");
         WorldOpener.OpenFile(linker, path, map.transform);
     }
 }
Esempio n. 4
0
        public static void SetScriptIcon(this MonoBehaviour behaviour, Texture2D icon)
        {
#if UNITY_EDITOR
            var currentIconPath = UnityEditor.EditorPrefs.GetString(behaviour.GetType().AssemblyQualifiedName + "Icon", "");
            var iconPath        = AssetDatabaseUtility.GetAssetPath(icon);

            if (currentIconPath != iconPath)
            {
                var script = UnityEditor.MonoScript.FromMonoBehaviour(behaviour);
                typeof(UnityEditor.EditorGUIUtility).GetMethod("SetIconForObject", ReflectionUtility.AllFlags).Invoke(null, new object[] { script, icon });
                typeof(UnityEditor.EditorUtility).GetMethod("ForceReloadInspectors", ReflectionUtility.AllFlags).Invoke(null, null);
                typeof(UnityEditor.MonoImporter).GetMethod("CopyMonoScriptIconToImporters", ReflectionUtility.AllFlags).Invoke(null, new object[] { script });
                UnityEditor.EditorPrefs.SetString(behaviour.GetType().AssemblyQualifiedName + "Icon", iconPath);
            }
#endif
        }
Esempio n. 5
0
 static bool SelectLinkerValidation()
 {
     return(Selection.activeObject != null && AssetDatabaseUtility.GetSelectedAssetExtention().Equals(".asset"));
 }
Esempio n. 6
0
 static bool LoadMapValidation()
 {
     return(Selection.activeObject != null && AssetDatabaseUtility.GetSelectedAssetExtention().Equals(".arc"));
 }