public static Object LoadMainSettings()
        {
            string settingsPath = System.String.Concat(EditorUtils.getMainRelativepath(), "2DLight/Core/Editor/Settings");

            UnityEngine.Object asset = AssetUtility.LoadAsset <DynamicLightSetting> (settingsPath, "Settings.asset");
            //AssetDatabase.LoadAssetAtPath(System.String.Concat(EditorUtils.getMainRelativepath(), "2DLight/Misc/Textures/2DDL_logo.png"), typeof(Texture2D));
            //UnityEngine.Object asset = AssetDatabase.LoadAssetAtPath<DynamicLightSetting>("Assets/2DDL/2DLight/Settings/Settings.asset");
            //Debug.Log (asset);

            if (asset == null)
            {
                Debug.Log("Create a new file Settings.asset");
                asset = AssetUtility.CreateAsset <DynamicLightSetting> (settingsPath, "Settings");
            }

            profile = new SerializedObject(asset);

            /*
             * //Automatic Layer Creation
             * if(AssetUtility.LoadPropertyAsBool("LayerCreationHasBeenPerformed", profile) == false){
             * TagLayerClass.findLayer(TagLayerClass.LayerName);
             * TagLayerClass.createLayer();
             * AssetUtility.SaveProperty("LayerCreationHasBeenPerformed", true, profile);
             *
             * //save layer mask//
             * AssetUtility.SaveProperty("layer",LayerMask.GetMask(TagLayerClass.LayerName), profile);
             * }
             */


            //Debug.Log("Profile loaded");
            return(asset);
        }
Beispiel #2
0
 static void reloadAsset()
 {
     if (_path == null)
     {
         _path = EditorUtils.getMainRelativepath();
     }
     tmpAsset = new SerializedObject(AssetUtility.LoadAsset <DynamicLightSetting>(_path + "2DLight/Core/Editor/Settings", "Settings.asset"));
     //Debug.Log ("reloadAsset");
 }
        static DynamicLightHierarchyIcon()
        {
            _icon = AssetDatabase.LoadAssetAtPath(EditorUtils.getMainRelativepath() + "2DLight/Misc/icon.png", typeof(Texture2D)) as Texture2D;

            if (_icon == null)
            {
                return;
            }

            EditorApplication.hierarchyWindowItemOnGUI += hierarchyItemOnGUI;
            EditorApplication.RepaintHierarchyWindow();
        }
Beispiel #4
0
        public static Font HeaderFont()
        {
            if (headerFont == null)
            {
                headerFont = (Font)AssetDatabase.LoadAssetAtPath(System.String.Concat(EditorUtils.getMainRelativepath(), "2DLight/Misc/Fonts/EXTRAVAGANZZA.ttf"), typeof(Font));
            }

            return(headerFont);
        }
Beispiel #5
0
        public static Texture2D HeaderTexture()
        {
            if (headerTexture == null)
            {
                headerTexture = (Texture2D)AssetDatabase.LoadAssetAtPath(System.String.Concat(EditorUtils.getMainRelativepath(), "2DLight/Misc/Textures/2DDL_logo.png"), typeof(Texture2D));
            }

            return(headerTexture);
        }