Initial commit

This commit is contained in:
HussienX72u
2026-07-21 08:56:10 +03:00
commit 4017028111
9410 changed files with 2150500 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2e8a8485b4f5f934585cd8c7d95bea64
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+28
View File
@@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ca089a66a5f23da42b228c8b6299a9d5, type: 3}
m_Name: CurrentBlocksMap
m_EditorClassIdentifier:
allNodes:
- blockData: {fileID: 11400000, guid: 2c3bcf71f1e39b74f9c7b0f2cfb63282, type: 2}
position: {x: -0.84, y: 0.1, z: -0}
rotation: {x: 0, y: 0, z: 0, w: 1}
- blockData: {fileID: 11400000, guid: da7213f08293477469e917a1983ebe26, type: 2}
position: {x: -0.07, y: 0.48, z: 2.33}
rotation: {x: 0, y: 0.70710677, z: 0, w: 0.70710677}
- blockData: {fileID: 11400000, guid: da7213f08293477469e917a1983ebe26, type: 2}
position: {x: -0.07, y: 0.48, z: -2.28}
rotation: {x: 0, y: 0.70710677, z: 0, w: 0.70710677}
rootNode:
blockData: {fileID: 11400000, guid: 2c3bcf71f1e39b74f9c7b0f2cfb63282, type: 2}
position: {x: -0.84, y: 0.1, z: -0}
rotation: {x: 0, y: 0, z: 0, w: 1}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2f40c8ab03535f04f967341d932f0c32
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
+28
View File
@@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ca089a66a5f23da42b228c8b6299a9d5, type: 3}
m_Name: NewBlocksMap
m_EditorClassIdentifier:
allNodes:
- blockData: {fileID: 11400000, guid: 2c3bcf71f1e39b74f9c7b0f2cfb63282, type: 2}
position: {x: -0.84, y: 0.1, z: -0}
rotation: {x: 0, y: 0, z: 0, w: 1}
- blockData: {fileID: 11400000, guid: da7213f08293477469e917a1983ebe26, type: 2}
position: {x: -0.07, y: 0.48, z: 2.33}
rotation: {x: 0, y: 0.70710677, z: 0, w: 0.70710677}
- blockData: {fileID: 11400000, guid: da7213f08293477469e917a1983ebe26, type: 2}
position: {x: -0.07, y: 0.48, z: -2.28}
rotation: {x: 0, y: 0.70710677, z: 0, w: 0.70710677}
rootNode:
blockData: {fileID: 11400000, guid: 2c3bcf71f1e39b74f9c7b0f2cfb63282, type: 2}
position: {x: -0.84, y: 0.1, z: -0}
rotation: {x: 0, y: 0, z: 0, w: 1}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0ced5d277e1d43c40ba60c28dddde902
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 317585e2de1c4e945958203a05bc9c80
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fde3d897c3a1bc245826eb76644d5ac5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,19 @@
-----------------------
| DESCRIPTION |
-----------------------
CGHierarchyIcons is a simple package used to show an icon at the right or left of GameObjects in the HierarchyView.
It is composed of a simple script that is added to GameObjects and through an editor script you can select the icon and add an optional tooltip.
You can select as icon all the textures Unity can reference, including yours in the ProjectView.
-----------------------
| NOTES |
-----------------------
- The properties of the HierarchyIcon script are only compiled in the Unity Editor.
- After you build your project, all instances of the HierarchyIcon attached to game objects are destroyed from the scenes since they are useless on build.
-----------------------
| LINKS |
-----------------------
- How to Use: https://youtu.be/mjXW5EIvO6U
- Unity Forum Thread: https://forum.unity.com/threads/released-free-hierarchy-icon.521145/
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e572d0beafbbc114d95c10afc11057ec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+9
View File
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 7812f55d89e530c4abba636cdfae8e03
folderAsset: yes
timeCreated: 1518156898
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 86c83c65fcdbfc144893224d7677edba
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,45 @@
using UnityEngine;
namespace CGHierarchyIconsEditor
{
internal static class TextureHelper
{
public static readonly Texture2D NO_ICON = Load(NoIconBytes);
public static readonly Texture2D BUTTON_ON = Load(ButtonOnBytes);
public static readonly Texture2D CLEAR_SEARCH = Load(ClearSearchBytes);
public static readonly Texture2D REMOVE_ICON = Load(RemoveIconBytes);
static Texture2D Load(byte[] bytes)
{
Texture2D texture = new Texture2D(1, 1, TextureFormat.ARGB32, false);
texture.hideFlags = HideFlags.HideAndDontSave;
texture.LoadImage(bytes, true);
return texture;
}
#region TEXTURE BYTES
static byte[] ButtonOnBytes
{
get { return new byte[] {137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 2, 0, 0, 0, 2, 8, 2, 0, 0, 0, 253, 212, 154, 115, 0, 0, 0, 19, 73, 68, 65, 84, 8, 29, 99, 180, 171, 125, 206, 192, 192, 192, 4, 196, 64, 0, 0, 19, 25, 1, 166, 188, 203, 191, 138, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130}; }
}
static byte[] NoIconBytes
{
get { return new byte[] {137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 2, 24, 73, 68, 65, 84, 56, 17, 133, 147, 93, 104, 141, 97, 28, 192, 127, 59, 239, 206, 216, 230, 107, 67, 171, 83, 139, 19, 133, 104, 156, 181, 220, 156, 88, 67, 169, 133, 41, 69, 73, 228, 163, 220, 184, 65, 41, 110, 92, 184, 90, 114, 225, 198, 40, 23, 148, 90, 185, 83, 106, 74, 145, 152, 175, 204, 87, 81, 83, 98, 109, 62, 98, 148, 89, 107, 200, 248, 61, 239, 57, 111, 142, 83, 242, 175, 223, 251, 127, 190, 254, 159, 207, 251, 84, 164, 248, 91, 158, 57, 221, 47, 159, 229, 158, 44, 149, 211, 50, 93, 206, 75, 185, 148, 219, 151, 239, 255, 119, 94, 238, 160, 66, 139, 195, 178, 76, 170, 101, 159, 76, 147, 127, 74, 106, 194, 173, 18, 42, 127, 193, 150, 163, 112, 112, 6, 212, 189, 133, 181, 153, 130, 163, 70, 143, 181, 74, 85, 185, 167, 40, 114, 37, 164, 81, 164, 122, 29, 228, 179, 208, 92, 239, 225, 73, 80, 27, 106, 159, 11, 7, 174, 65, 102, 141, 14, 247, 66, 207, 93, 215, 18, 82, 33, 231, 18, 194, 124, 228, 24, 156, 92, 13, 187, 103, 195, 156, 22, 200, 217, 204, 190, 46, 56, 158, 134, 38, 143, 155, 220, 31, 41, 239, 65, 40, 56, 186, 9, 87, 59, 225, 220, 84, 152, 117, 65, 227, 121, 176, 224, 132, 151, 243, 18, 94, 252, 128, 49, 33, 1, 83, 142, 41, 102, 81, 101, 161, 57, 13, 107, 38, 67, 125, 155, 117, 215, 216, 196, 44, 180, 180, 67, 71, 4, 13, 66, 41, 149, 73, 50, 122, 15, 142, 190, 171, 30, 21, 215, 198, 212, 55, 138, 227, 7, 234, 0, 71, 36, 116, 242, 74, 152, 40, 137, 3, 131, 50, 83, 222, 172, 52, 187, 14, 7, 193, 58, 72, 200, 112, 68, 174, 203, 99, 185, 40, 165, 146, 10, 145, 37, 99, 147, 242, 227, 133, 43, 179, 249, 44, 18, 171, 136, 3, 216, 130, 56, 104, 168, 50, 4, 108, 144, 240, 143, 196, 18, 45, 86, 213, 106, 176, 81, 7, 195, 48, 124, 8, 78, 121, 178, 117, 20, 62, 230, 97, 207, 79, 104, 247, 38, 150, 27, 253, 235, 54, 232, 90, 8, 155, 27, 97, 73, 15, 60, 213, 116, 52, 21, 92, 73, 109, 157, 77, 91, 5, 27, 94, 65, 90, 7, 155, 238, 23, 116, 243, 86, 216, 101, 9, 243, 219, 96, 125, 175, 149, 237, 128, 51, 154, 52, 77, 209, 137, 144, 74, 126, 34, 179, 72, 223, 134, 39, 94, 114, 88, 218, 185, 194, 102, 235, 104, 252, 44, 108, 247, 167, 138, 250, 225, 189, 27, 175, 63, 65, 191, 181, 77, 56, 142, 194, 193, 232, 155, 159, 15, 54, 110, 0, 134, 46, 67, 111, 31, 12, 104, 144, 187, 228, 184, 27, 238, 100, 125, 144, 157, 208, 125, 203, 199, 233, 185, 119, 190, 214, 161, 65, 24, 124, 8, 207, 157, 127, 209, 60, 150, 228, 106, 13, 26, 95, 115, 120, 64, 161, 97, 33, 72, 156, 169, 58, 217, 11, 103, 195, 94, 208, 252, 6, 80, 219, 116, 25, 64, 124, 234, 141, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130}; }
}
static byte[] ClearSearchBytes
{
get { return new byte[] {137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 13, 0, 0, 0, 13, 8, 6, 0, 0, 0, 114, 235, 228, 124, 0, 0, 1, 47, 73, 68, 65, 84, 40, 21, 117, 82, 65, 106, 131, 80, 16, 213, 6, 68, 76, 64, 107, 19, 8, 93, 202, 63, 64, 54, 122, 0, 169, 123, 215, 61, 64, 47, 208, 43, 148, 120, 6, 247, 186, 17, 247, 133, 8, 57, 129, 71, 8, 89, 184, 10, 72, 136, 171, 46, 74, 193, 190, 247, 243, 5, 73, 226, 192, 115, 254, 188, 121, 51, 127, 230, 163, 174, 93, 77, 192, 61, 3, 142, 138, 31, 185, 14, 228, 5, 56, 60, 225, 35, 194, 48, 124, 45, 138, 66, 239, 251, 190, 157, 2, 243, 212, 81, 15, 104, 62, 136, 0, 226, 197, 64, 224, 172, 13, 160, 0, 38, 152, 167, 14, 103, 159, 68, 4, 98, 3, 239, 218, 182, 189, 133, 103, 98, 108, 129, 226, 93, 165, 139, 56, 158, 52, 16, 63, 101, 89, 238, 45, 203, 250, 2, 49, 20, 6, 140, 201, 51, 175, 164, 210, 201, 155, 64, 114, 36, 179, 174, 235, 119, 8, 119, 44, 164, 103, 76, 94, 229, 57, 81, 196, 170, 113, 145, 44, 76, 146, 228, 147, 5, 244, 163, 2, 230, 238, 139, 216, 1, 38, 88, 144, 231, 249, 135, 186, 81, 190, 214, 195, 155, 174, 122, 77, 24, 134, 241, 173, 70, 178, 233, 25, 179, 17, 243, 119, 55, 129, 147, 175, 119, 179, 131, 220, 241, 246, 245, 216, 192, 207, 178, 204, 71, 151, 85, 85, 85, 111, 240, 195, 210, 236, 44, 119, 84, 252, 138, 58, 234, 103, 248, 152, 109, 219, 46, 49, 198, 60, 142, 227, 95, 196, 252, 157, 214, 35, 44, 61, 207, 251, 195, 142, 78, 154, 166, 86, 211, 52, 39, 29, 73, 154, 7, 188, 0, 14, 131, 9, 235, 192, 159, 129, 227, 63, 69, 197, 241, 197, 126, 216, 78, 194, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130}; }
}
static byte[] RemoveIconBytes
{
get { return new byte[] {137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 9, 0, 0, 0, 9, 8, 6, 0, 0, 0, 224, 145, 6, 16, 0, 0, 0, 111, 73, 68, 65, 84, 24, 25, 93, 143, 209, 13, 128, 48, 8, 68, 169, 113, 60, 117, 11, 117, 36, 63, 220, 162, 14, 229, 26, 189, 87, 133, 52, 92, 114, 133, 192, 11, 208, 114, 153, 85, 51, 187, 229, 71, 206, 90, 85, 168, 179, 158, 141, 228, 239, 142, 96, 7, 84, 47, 64, 40, 131, 1, 208, 116, 40, 131, 76, 46, 20, 209, 244, 133, 120, 185, 13, 224, 140, 138, 146, 17, 98, 197, 46, 51, 97, 145, 15, 185, 203, 33, 7, 184, 13, 17, 3, 228, 166, 12, 0, 33, 255, 204, 11, 196, 10, 159, 64, 115, 84, 7, 27, 132, 23, 20, 126, 163, 174, 246, 6, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130}; }
}
#endregion
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 3aaac47a537340843a1d85cf4774c7dd
timeCreated: 1519027026
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,12 @@
{
"name": "HierarchyIconsEditor",
"references": [
"HierarchyIcons"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: effacf331d64ef64c83f1b4e2312f212
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fc907af72a34a6741809816222a956fa
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,113 @@
using HierarchyIcons;
using UnityEngine;
using UnityEditor;
namespace CGHierarchyIconsEditor
{
[CanEditMultipleObjects]
[CustomEditor(typeof(HierarchyIcon))]
public class HierarchyIconEditor : Editor
{
SerializedProperty m_iconProperty;
SerializedProperty m_tooltipProperty;
SerializedProperty m_positionProperty;
SerializedProperty m_directionProperty;
HierarchyIcon m_hierarchyIcon;
const float ICON_BUTTON_SIZE = 28;
void OnEnable()
{
m_iconProperty = serializedObject.FindProperty("icon");
m_tooltipProperty = serializedObject.FindProperty("tooltip");
m_positionProperty = serializedObject.FindProperty("position");
m_directionProperty = serializedObject.FindProperty("direction");
m_hierarchyIcon = target as HierarchyIcon;
}
public override void OnInspectorGUI()
{
#region DRAW SCRIPT HEADER
GUI.enabled = false;
DrawPropertiesExcluding(
serializedObject,
m_iconProperty.name,
m_tooltipProperty.name,
m_positionProperty.name,
m_directionProperty.name
);
GUI.enabled = true;
#endregion
// Update the serializedProperty - always do this in the beginning of OnInspectorGUI.
serializedObject.Update();
#region PICK ICON BUTTON
EditorGUILayout.BeginHorizontal();
{
EditorGUILayout.PrefixLabel("Icon");
Rect btnRect = EditorGUILayout.GetControlRect(GUILayout.Width(ICON_BUTTON_SIZE), GUILayout.Height(ICON_BUTTON_SIZE));
GUIContent btnContent = new GUIContent();
// if selected multiple game objects show a _ character
if (m_iconProperty.hasMultipleDifferentValues)
{
btnContent.text = "_";
btnContent.tooltip = "Different values on selection";
}
else
{
// show the selected icon
btnContent.image = m_hierarchyIcon.icon;
}
if (GUI.Button(btnRect, btnContent))
PopupWindow.Show(btnRect, new PickIconWindow(m_iconProperty));
}
EditorGUILayout.EndHorizontal();
#endregion
#region POSITION
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(m_positionProperty);
if (EditorGUI.EndChangeCheck())
{
// repaint the hierarchy
EditorApplication.RepaintHierarchyWindow();
}
#endregion
#region DIRECTION
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(m_directionProperty);
if (EditorGUI.EndChangeCheck())
{
// repaint the hierarchy
EditorApplication.RepaintHierarchyWindow();
}
#endregion
#region TOOLTIP
EditorGUILayout.PropertyField(m_tooltipProperty);
#endregion
// Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI.
serializedObject.ApplyModifiedProperties();
// space at the bottom
GUILayout.Space(5);
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c0f001d5f6bf9374fb393d140eef3727
timeCreated: 1519023853
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ef1be50a405732a42b3a48997126cd0b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using HierarchyIcons;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
using UnityEngine.SceneManagement;
// https://forum.unity.com/threads/excluding-certain-monobehaviour-classes-from-build.568090/#post-3779695
public class DestroyInstancesOnBuild : MonoBehaviour
{
[PostProcessScene]
public static void DeleteObjects()
{
if (BuildPipeline.isBuildingPlayer)
{
Type type = typeof(HierarchyIcon);
Debug.Log("Destroying all instances of '" + type.Name + "' from scenes on build!");
foreach (Component obj in FindObjectsOfTypeAll(type, true))
DestroyImmediate(obj);
}
}
static List<Component> FindObjectsOfTypeAll(Type type, bool findInactive = false)
{
List<Component> results = new List<Component>();
for (int i = 0; i < SceneManager.sceneCount; i++)
{
Scene scene = SceneManager.GetSceneAt(i);
if (scene.isLoaded)
{
GameObject[] allGameObjects = scene.GetRootGameObjects();
for (int j = 0; j < allGameObjects.Length; j++)
{
GameObject go = allGameObjects[j];
results.AddRange(go.GetComponentsInChildren(type, findInactive));
}
}
}
return results;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e80715f9811a6ab449fc1b6403f5bf27
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,50 @@
using HierarchyIcons;
using UnityEngine;
using UnityEditor;
namespace CGHierarchyIconsEditor
{
[InitializeOnLoad]
public class ShowIconOnHierarchyView
{
const float MAX_ICON_SIZE = 16;
static ShowIconOnHierarchyView()
{
EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowItemCallback;
}
static void HierarchyWindowItemCallback(int instanceID, Rect selectionRect)
{
GameObject gameObject = EditorUtility.InstanceIDToObject(instanceID) as GameObject;
if (gameObject == null)
return;
HierarchyIcon[] hierarchyIcons = gameObject.GetComponents<HierarchyIcon>();
foreach (HierarchyIcon hierarchyIcon in hierarchyIcons)
{
Texture2D icon = hierarchyIcon.icon ? hierarchyIcon.icon : TextureHelper.NO_ICON;
float width = Mathf.Min(icon.width, MAX_ICON_SIZE);
float height = Mathf.Min(icon.height, MAX_ICON_SIZE);
// get the starting x position based on the direction
float x = selectionRect.x;
if (hierarchyIcon.direction == HierarchyIcon.Direction.LeftToRight)
x += hierarchyIcon.position * MAX_ICON_SIZE;
else
x += (selectionRect.width - width) - hierarchyIcon.position * MAX_ICON_SIZE;
// draw the icon
Rect rect = new Rect(x, selectionRect.y, width, height);
GUI.DrawTexture(rect, icon);
// set link cursor
EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link);
// and draw a button for change the icon and display the tooltip
if (GUI.Button(rect, new GUIContent(string.Empty, hierarchyIcon.tooltip), EditorStyles.label))
PopupWindow.Show(rect, new PickIconWindow(hierarchyIcon));
}
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f9de4623bd5b3274985a8f32e6007ff9
timeCreated: 1516518841
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7c4d577218251034d86165460c287b49
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,312 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Reflection;
using System;
using HierarchyIcons;
namespace CGHierarchyIconsEditor
{
internal class PickIconWindow : PopupWindowContent
{
readonly SerializedProperty m_iconProperty;
Vector2 m_scrollPosition;
int m_myUndoGroup;
static GUIContent[] s_IconContents;
static readonly GUIStyle BUTTON_STYLE;
static string s_searchWord = "";
static bool s_loadAllIcons;
const int BUTTON_STYLE_PADDING = 2;
const float BUTTON_SIZE = 16 + BUTTON_STYLE_PADDING * 2;
const float COLUMNS = 12;
const int HEADER_HEIGHT = 22;
const int BODY_HEIGHT = 200;
const int BOTTOM_HEIGHT = 26;
static PickIconWindow()
{
BUTTON_STYLE = new GUIStyle
{
fixedWidth = BUTTON_SIZE,
fixedHeight = BUTTON_SIZE,
alignment = TextAnchor.MiddleCenter,
onNormal = {background = TextureHelper.BUTTON_ON},
padding = new RectOffset(
BUTTON_STYLE_PADDING,
BUTTON_STYLE_PADDING,
BUTTON_STYLE_PADDING,
BUTTON_STYLE_PADDING
)
};
}
public PickIconWindow(HierarchyIcon hierarchyIcon) : this(new SerializedObject(hierarchyIcon).FindProperty("icon"))
{
if (m_iconProperty == null)
Debug.LogError("'icon' property not found in the HierarchyIcon script.");
}
public PickIconWindow(SerializedProperty target)
{
LoadIcons(false);
m_iconProperty = target;
m_myUndoGroup = -1;
}
public override void OnGUI(Rect rect)
{
if (m_iconProperty == null) return;
// body - scroll view with a selection grid
{
float rows = Mathf.Ceil(s_IconContents.Length / COLUMNS);
float height = rows * BUTTON_SIZE;
// calculate rects
Rect rectScrollViewPosition = rect;
rectScrollViewPosition.y = HEADER_HEIGHT;
rectScrollViewPosition.height -= HEADER_HEIGHT + BOTTOM_HEIGHT;
Rect rectScrollView = new Rect(0, 0, rect.width - BUTTON_SIZE, height);
m_scrollPosition = GUI.BeginScrollView(rectScrollViewPosition, m_scrollPosition, rectScrollView, false, true);
{
const float X = 3;
Rect rectButtons = new Rect(X, 1, BUTTON_SIZE, BUTTON_SIZE);
int counter = 0; // used in the case we are searching
for (int i = 0; i < s_IconContents.Length; i++)
{
GUIContent content = s_IconContents[i];
if (!ContainsSearchWord(content.tooltip))
continue;
bool selected = (content.image == m_iconProperty.objectReferenceValue);
EditorGUI.BeginChangeCheck();
GUI.Toggle(rectButtons, selected, content, BUTTON_STYLE);
if (EditorGUI.EndChangeCheck())
AssignIconAndRecordUndo(i);
rectButtons.x += BUTTON_SIZE;
if ((counter + 1) % COLUMNS == 0)
{
rectButtons.y += BUTTON_SIZE;
rectButtons.x = X;
}
counter++;
}
}
GUI.EndScrollView();
}
// header
{
// search
{
GUI.Label(new Rect(3, 3, 50, 17), "Search:");
Rect rectCloseSearch = new Rect(167, 4, 16, 16);
// the button for clicking
if (GUI.Button(rectCloseSearch, "", EditorStyles.label))
s_searchWord = "";
s_searchWord = GUI.TextField(new Rect(53, 3, 130, 17), s_searchWord, EditorStyles.helpBox);
// the button graphic on top of the text field
if (s_searchWord != "")
GUI.Label(rectCloseSearch, new GUIContent(TextureHelper.CLEAR_SEARCH, "Clear Search"));
}
// none button
{
if (!m_iconProperty.objectReferenceValue) // disable the button if no icon
GUI.enabled = false;
GUIContent noneIconContent = new GUIContent("None", TextureHelper.REMOVE_ICON, "Remove Icon");
float width = EditorStyles.label.CalcSize(noneIconContent).x + 5;
if (GUI.Button(new Rect(rect.width - width, 4, width, HEADER_HEIGHT), noneIconContent, EditorStyles.label))
{
AssignIconAndRecordUndo(-1);
//editorWindow.Close();
}
GUI.enabled = true;
}
// horizontal line
DrawLineH(0, HEADER_HEIGHT, rect.width, Color.gray);
}
Event e = Event.current;
// other icon
{
// horizontal line
DrawLineH(0, rect.height - BOTTOM_HEIGHT, rect.width, Color.gray);
const float MARGIN_LEFT_AND_RIGHT = 50;
const float MARGIN_TOP_AND_BOTTOM = 3;
Rect rectButton = new Rect(
MARGIN_LEFT_AND_RIGHT,
rect.height - BOTTOM_HEIGHT + MARGIN_TOP_AND_BOTTOM,
rect.width - MARGIN_LEFT_AND_RIGHT * 2,
BOTTOM_HEIGHT - MARGIN_TOP_AND_BOTTOM * 2);
int controlID = GUIUtility.GetControlID("rectButtonOtherIcon***".GetHashCode(), FocusType.Keyboard, rectButton);
if (GUI.Button(rectButton, "Other..."))
{
GUIUtility.keyboardControl = controlID;
EditorGUIUtility.ShowObjectPicker<Texture2D>(m_iconProperty.objectReferenceValue, false, string.Empty, controlID);
}
// handle object picker commands
if (e.type == EventType.ExecuteCommand)
{
string commandName = e.commandName;
if (EditorGUIUtility.GetObjectPickerControlID() == controlID && GUIUtility.keyboardControl == controlID)
{
GUI.changed = true;
e.Use();
if (commandName == "ObjectSelectorUpdated")
{
Texture2D icon = EditorGUIUtility.GetObjectPickerObject() as Texture2D;
AssignIconAndRecordUndo(icon);
}
}
}
// toggle load all icons
{
const float W = 40, H = 17;
Rect r = new Rect(rect.width - W, rect.height - H - 3, W, H);
EditorGUI.BeginChangeCheck();
{
s_loadAllIcons = GUI.Toggle(r, s_loadAllIcons, new GUIContent("All", "Show all unity textures. Including yours in the project view."));
}
if (EditorGUI.EndChangeCheck())
LoadIcons(true);
}
}
// cancel with escape
if (e.type == EventType.KeyDown && e.keyCode == KeyCode.Escape)
editorWindow.Close();
}
static bool ContainsSearchWord(string name)
{
string searchWordLower = s_searchWord.Trim().ToLower();
if (name.ToLower().Contains(searchWordLower))
return true;
return false;
}
public static void DrawRect(Rect r, Color c)
{
GUI.color = c;
GUI.DrawTexture(r, EditorGUIUtility.whiteTexture);
GUI.color = Color.white;
}
public static void DrawLineH(float x, float y, float width, Color c)
{
DrawRect(new Rect(x, y, width, 1), c);
}
public override Vector2 GetWindowSize()
{
return new Vector2(
BUTTON_SIZE * COLUMNS + BUTTON_SIZE,
HEADER_HEIGHT + BODY_HEIGHT + BOTTOM_HEIGHT
);
}
void AssignIconAndRecordUndo(Texture2D newIcon)
{
if (m_iconProperty.objectReferenceValue != newIcon)
{
if (m_myUndoGroup == -1)
{
Undo.IncrementCurrentGroup();
m_myUndoGroup = Undo.GetCurrentGroup();
}
m_iconProperty.objectReferenceValue = newIcon;
m_iconProperty.serializedObject.ApplyModifiedProperties();
// repaint the hierarchy
EditorApplication.RepaintHierarchyWindow();
}
}
void AssignIconAndRecordUndo(int newBuiltinIconIndex)
{
AssignIconAndRecordUndo(GetIcon(newBuiltinIconIndex));
}
public override void OnClose()
{
Undo.CollapseUndoOperations(m_myUndoGroup);
}
static Texture2D GetIcon(int index)
{
LoadIcons(false);
if (index >= 0 && index < s_IconContents.Length)
return (Texture2D) s_IconContents[index].image;
return null;
}
static void LoadIcons(bool showAllChanged)
{
if (s_IconContents == null || showAllChanged)
{
LoadAssetPreviews();
List<GUIContent> listIcons = new List<GUIContent>();
// find all unity textures
Texture[] textures = Resources.FindObjectsOfTypeAll<Texture>();
Array.Sort(textures, (pA, pB) => string.Compare(pA.name, pB.name, StringComparison.OrdinalIgnoreCase));
string ICON_TEXT = "icon";
foreach (Texture texture in textures)
{
string name = texture.name;
if (name == string.Empty) continue;
if (!s_loadAllIcons && !name.ToLower().Contains(ICON_TEXT)) continue;
listIcons.Add(new GUIContent(texture, name));
}
s_IconContents = listIcons.ToArray();
}
}
/// <summary>
/// Load all assets preview so that we can find it
/// </summary>
static void LoadAssetPreviews()
{
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
{
if (!assembly.FullName.StartsWith("UnityEngine")) // load only unity engine assemblies
continue;
foreach (Type type in assembly.GetTypes())
AssetPreview.GetMiniTypeThumbnail(type);
}
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: dbacac9f543a9704c88d5ca00050213c
timeCreated: 1519023455
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4e38abdbfdb1be74c88ea70653eb3286
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,24 @@
using UnityEngine;
namespace HierarchyIcons
{
public class HierarchyIcon : MonoBehaviour
{
#if UNITY_EDITOR
public Texture2D icon;
[Range(-3, 5)]
public int position;
public Direction direction = Direction.RightToLeft;
[TextArea]
public string tooltip;
public enum Direction
{
RightToLeft,
LeftToRight
}
#endif
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0fc219dcbba90e84b86e2ecf840e0266
timeCreated: 1518156898
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,3 @@
{
"name": "HierarchyIcons"
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3b7e88b2a461ae24d8dee6925373e924
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 131a6b21c8605f84396be9f6751fb6e3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,716 @@
%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: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 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_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 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: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
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 &89231191
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 89231192}
- component: {fileID: 89231193}
m_Layer: 0
m_Name: BackLight
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &89231192
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 89231191}
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: 1244390350}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &89231193
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 89231191}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: -6398683131212242302, guid: 0000000000000000d000000000000000, type: 0}
position: 0
direction: 0
tooltip:
--- !u!1 &105662418
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 105662419}
- component: {fileID: 105662420}
m_Layer: 0
m_Name: Fog
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &105662419
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 105662418}
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: 2145014273}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &105662420
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 105662418}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0}
position: 0
direction: 0
tooltip:
--- !u!1 &397681479
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 397681481}
- component: {fileID: 397681480}
- component: {fileID: 397681483}
m_Layer: 0
m_Name: GameManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &397681480
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 397681479}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: 8872333681490167307, guid: 0000000000000000d000000000000000, type: 0}
position: 0
direction: 0
tooltip: This is the GameManager
--- !u!4 &397681481
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 397681479}
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: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &397681483
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 397681479}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: 5425037494185492166, guid: 0000000000000000d000000000000000, type: 0}
position: 1
direction: 0
tooltip: This Manager use Object.DontDestroyOnLoad()
--- !u!1 &519420028
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 519420032}
- component: {fileID: 519420031}
- component: {fileID: 519420029}
- component: {fileID: 519420030}
m_Layer: 0
m_Name: MainCamera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &519420029
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
--- !u!114 &519420030
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: 6338563257489195420, guid: 0000000000000000d000000000000000, type: 0}
position: 0
direction: 0
tooltip: Main Camera
--- !u!20 &519420031
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
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: 1
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: 0
m_HDR: 1
m_AllowMSAA: 0
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 0
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &519420032
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, 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}
--- !u!1 &526663872
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 526663873}
- component: {fileID: 526663874}
m_Layer: 0
m_Name: Wind
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &526663873
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 526663872}
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: 2145014273}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &526663874
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 526663872}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: 4978307288704543194, guid: 0000000000000000d000000000000000, type: 0}
position: 0
direction: 0
tooltip:
--- !u!1 &554084497
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 554084499}
- component: {fileID: 554084498}
m_Layer: 0
m_Name: Model
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &554084498
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 554084497}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: -1123978968931220871, guid: 0000000000000000d000000000000000, type: 0}
position: 0
direction: 0
tooltip:
--- !u!4 &554084499
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 554084497}
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!1 &779297617
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 779297618}
- component: {fileID: 779297619}
m_Layer: 0
m_Name: Terrain
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &779297618
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 779297617}
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: 2076569605}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &779297619
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 779297617}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: 3099466108739435423, guid: 0000000000000000d000000000000000, type: 0}
position: 0
direction: 0
tooltip:
--- !u!1 &1244390348
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1244390350}
- component: {fileID: 1244390349}
m_Layer: 0
m_Name: Lights
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1244390349
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1244390348}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: -6398683131212242302, guid: 0000000000000000d000000000000000, type: 0}
position: 0
direction: 0
tooltip:
--- !u!4 &1244390350
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1244390348}
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:
- {fileID: 1287244403}
- {fileID: 1873283119}
- {fileID: 89231192}
m_Father: {fileID: 2076569605}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1287244402
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1287244403}
- component: {fileID: 1287244404}
m_Layer: 0
m_Name: KeyLight
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1287244403
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1287244402}
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: 1244390350}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1287244404
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1287244402}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: -6398683131212242302, guid: 0000000000000000d000000000000000, type: 0}
position: 0
direction: 0
tooltip:
--- !u!1 &1873283118
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1873283119}
- component: {fileID: 1873283120}
m_Layer: 0
m_Name: FillLight
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1873283119
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1873283118}
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: 1244390350}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1873283120
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1873283118}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: -6398683131212242302, guid: 0000000000000000d000000000000000, type: 0}
position: 0
direction: 0
tooltip:
--- !u!1 &2076569603
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2076569605}
- component: {fileID: 2076569604}
m_Layer: 0
m_Name: Enviroment
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2076569604
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2076569603}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: 656655089447870219, guid: 0000000000000000d000000000000000, type: 0}
position: 0
direction: 0
tooltip:
--- !u!4 &2076569605
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2076569603}
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:
- {fileID: 2145014273}
- {fileID: 779297618}
- {fileID: 1244390350}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2145014272
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2145014273}
- component: {fileID: 2145014274}
m_Layer: 0
m_Name: Effects
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2145014273
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2145014272}
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:
- {fileID: 526663873}
- {fileID: 105662419}
m_Father: {fileID: 2076569605}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2145014274
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2145014272}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fc219dcbba90e84b86e2ecf840e0266, type: 3}
m_Name:
m_EditorClassIdentifier:
icon: {fileID: 901774759342009711, guid: 0000000000000000d000000000000000, type: 0}
position: 0
direction: 0
tooltip:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2cda990e2423bbf4892e6590ba056729
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 469d793580c354540ba43e6aeb64d221
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 19552a1e2e8fe244c99238f38355f7ae
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,142 @@
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Reflection;
public class BlockDataCreatorEditor : EditorWindow
{
private GameObject prefab;
private string saveFolder = "Assets/Resources/BlocksData/Final";
[MenuItem("Tools/Block Data Creator")]
public static void ShowWindow() =>
GetWindow<BlockDataCreatorEditor>("Block Data Creator");
private void OnGUI()
{
GUILayout.Label("Block Data Creator", EditorStyles.boldLabel);
EditorGUILayout.Space();
prefab = (GameObject)EditorGUILayout.ObjectField("Block Prefab", prefab, typeof(GameObject), false);
EditorGUILayout.Space();
GUILayout.Label("Save Paths", EditorStyles.boldLabel);
EditorGUILayout.BeginHorizontal();
saveFolder = EditorGUILayout.TextField("BlockData Folder", saveFolder);
if (GUILayout.Button("Browse", GUILayout.Width(60)))
saveFolder = BrowseFolder(saveFolder);
EditorGUILayout.EndHorizontal();
EditorGUILayout.Space();
GUI.enabled = prefab != null;
if (GUILayout.Button("Create BlockData"))
CreateBlockData();
GUI.enabled = true;
if (prefab == null)
EditorGUILayout.HelpBox("Assign a prefab to get started.", MessageType.Info);
}
public void CreateBlockData()
{
EnsureFolderExists(saveFolder);
// ── 1. Create BlockData ───────────────────────────────────────────────
BlockData blockData = ScriptableObject.CreateInstance<BlockData>();
blockData.blockName = prefab.name;
blockData.blockPrefab = prefab;
string assetPath = AssetDatabase.GenerateUniqueAssetPath(
$"{saveFolder}/{prefab.name}_BlockData.asset");
AssetDatabase.CreateAsset(blockData, assetPath);
AssetDatabase.SaveAssets();
// ── 2. Assign BlockData back to the Block component on the prefab ─────
Block block = prefab.GetComponent<Block>();
if (block != null)
{
SerializedObject so = new SerializedObject(block);
SerializedProperty prop = so.FindProperty("BlockData");
if (prop != null)
{
prop.objectReferenceValue = blockData;
so.ApplyModifiedProperties();
PrefabUtility.SavePrefabAsset(prefab);
Debug.Log($"[BlockDataCreator] BlockData assigned to {prefab.name}.");
}
else
Debug.LogWarning("[BlockDataCreator] 'BlockData' field not found on Block component.");
}
else
Debug.LogWarning($"[BlockDataCreator] No Block component on {prefab.name}.");
// ── 3. Ping the new asset ─────────────────────────────────────────────
EditorUtility.FocusProjectWindow();
Selection.activeObject = blockData;
EditorGUIUtility.PingObject(blockData);
Debug.Log($"[BlockDataCreator] Created: {assetPath}");
}
public BlockData CreateBlockData(GameObject Prefab)
{
EnsureFolderExists(saveFolder);
// ── 1. Create BlockData ───────────────────────────────────────────────
BlockData blockData = ScriptableObject.CreateInstance<BlockData>();
blockData.blockName = Prefab.name;
blockData.blockPrefab = Prefab;
string assetPath = AssetDatabase.GenerateUniqueAssetPath(
$"{saveFolder}/{Prefab.name}_BlockData.asset");
AssetDatabase.CreateAsset(blockData, assetPath);
AssetDatabase.SaveAssets();
// ── 2. Assign BlockData back to the Block component on the prefab ─────
Block block = Prefab.GetComponent<Block>();
if (block != null)
{
SerializedObject so = new SerializedObject(block);
SerializedProperty prop = so.FindProperty("BlockData");
if (prop != null)
{
prop.objectReferenceValue = blockData;
so.ApplyModifiedProperties();
PrefabUtility.SavePrefabAsset(Prefab);
Debug.Log($"[BlockDataCreator] BlockData assigned to {Prefab.name}.");
}
else
Debug.LogWarning("[BlockDataCreator] 'BlockData' field not found on Block component.");
}
else
Debug.LogWarning($"[BlockDataCreator] No Block component on {Prefab.name}.");
// ── 3. Ping the new asset ─────────────────────────────────────────────
EditorUtility.FocusProjectWindow();
Selection.activeObject = blockData;
EditorGUIUtility.PingObject(blockData);
Debug.Log($"[BlockDataCreator] Created: {assetPath}");
// ── 4. Return the Block Data ──────────────────────────────────────────
return blockData;
}
private string BrowseFolder(string current)
{
string abs = EditorUtility.OpenFolderPanel("Select Folder", current, "");
if (string.IsNullOrEmpty(abs)) return current;
if (abs.StartsWith(Application.dataPath))
return "Assets" + abs.Substring(Application.dataPath.Length);
Debug.LogWarning("[BlockDataCreator] Folder must be inside Assets.");
return current;
}
private void EnsureFolderExists(string path)
{
if (AssetDatabase.IsValidFolder(path)) return;
string parent = Path.GetDirectoryName(path).Replace("\\", "/");
EnsureFolderExists(parent);
AssetDatabase.CreateFolder(parent, Path.GetFileName(path));
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 67e48e5b7a08bb3479888fe7c8bdc644
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,55 @@
using UnityEngine;
using UnityEditor;
using System.IO;
public class BlockDataIconLinker : AssetPostprocessor
{
// Fires after any assets are imported
static void OnPostprocessAllAssets(
string[] importedAssets,
string[] deletedAssets,
string[] movedAssets,
string[] movedFromAssetPaths)
{
foreach (string assetPath in importedAssets)
{
// Only care about Texture2D PNGs
if (!assetPath.EndsWith(".png", System.StringComparison.OrdinalIgnoreCase))
continue;
Texture2D texture = AssetDatabase.LoadAssetAtPath<Texture2D>(assetPath);
if (texture == null) continue;
// Try to find a matching BlockData for this texture
TryLinkToBlockData(texture, assetPath);
}
}
private static void TryLinkToBlockData(Texture2D texture, string texturePath)
{
string textureName = Path.GetFileNameWithoutExtension(texturePath);
// Find all BlockData assets in the project
string[] guids = AssetDatabase.FindAssets("t:BlockData");
foreach (string guid in guids)
{
string blockDataPath = AssetDatabase.GUIDToAssetPath(guid);
BlockData blockData = AssetDatabase.LoadAssetAtPath<BlockData>(blockDataPath);
if (blockData == null || blockData.blockPrefab == null) continue;
// Match by checking if the texture name contains the prefab name
// Handles prefixes/suffixes like "Icon_zPin", "Icon_zPin_v2", etc.
if (!textureName.Contains(blockData.blockPrefab.name)) continue;
// Skip if already assigned to avoid unnecessary reimports
if (blockData.icon == texture || blockData.icon != null) continue;
blockData.icon = texture;
EditorUtility.SetDirty(blockData);
AssetDatabase.SaveAssetIfDirty(blockData);
Debug.Log($"[BlockDataIconLinker] Linked '{texturePath}' → '{blockDataPath}'");
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7e135bd5a5f097741b1772c8f5fd8b9e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,51 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public enum PlaneAxis
{
XZ = 0,
XY = 1,
YZ = 2
}
[System.Serializable]
public class PlaneSelection
{
public PlaneAxis planeAxis;
public GameObject WorldGrid;
}
public class PlaneSelector : MonoBehaviour
{
public TMP_Dropdown planeAxisDropDown;
public PlaneSelection[] PlaneAxis;
private void Start()
{
planeAxisDropDown.onValueChanged.AddListener(OnPlaneAxisChanged);
UpdatePlaneVisibility();
}
private void OnPlaneAxisChanged(int index)
{
UpdatePlaneVisibility();
}
private void UpdatePlaneVisibility()
{
foreach (var plane in PlaneAxis)
{
if (plane.planeAxis == (PlaneAxis)planeAxisDropDown.value)
{
plane.WorldGrid.SetActive(true);
}
else
{
plane.WorldGrid.SetActive(false);
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 70c9ce54d0b332b4abe8b68218428d08
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,19 @@
{
"name": "Scripts.Editor",
"rootNamespace": "",
"references": [
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:0f8d877125e73cc40a31b031c2e5fe60"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 33db7b02ee883714bad5e572b698bdb7
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9cfe9faaa56b81844a437d9850a85c8f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,48 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a786d380a7823b4d9a0511ba886548f, type: 3}
m_Name: Connector Prefab Settings
m_EditorClassIdentifier:
MainComponents:
GrabInteractable: {fileID: 11500000, guid: d9a466110b129074db957157c7ec5b2f, type: 3}
MechanicalBlock: {fileID: 11500000, guid: c4a1be166f8c7184ab860f9a010f5764, type: 3}
AttachableBlock: {fileID: 11500000, guid: 6f653344f2c17b64fb6a4073754cb555, type: 3}
SocketContainer: {fileID: 11500000, guid: aa5c0234b0ff887468bde7ca9dbbf542, type: 3}
PlacementValidator: {fileID: 11500000, guid: 8245c6e3d94e025439b7ccced75276db,
type: 3}
SocketPoint: {fileID: 11500000, guid: 7d04d85508b5c414d82419db222f9936, type: 3}
ContainerInit: {fileID: 11500000, guid: b628454e932ec7e47be99c98c50c21d2, type: 3}
BlockSettings:
grabInteractable:
Test:
mechanicalBlock:
Test:
attachableBlock:
Type: 1
socketContainer:
Test:
validator:
CollisionLayerMask:
serializedVersion: 2
m_Bits: 64
socketPoint:
SocketRadius: 0.3
MiscellaneousSettings:
BlockLayer:
serializedVersion: 2
m_Bits: 64
categoryData: {fileID: 11400000, guid: 5a2a0a71bcd471d468b7bcacbbc8176a, type: 2}
SavePath: Assets/_Project/Prefabs/Final Prefabs/Connectors
Name: Connector
IteratedNumbering: 1
Suffix: _v
OverwriteExisting: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 38c572c2bd6d37d47b52e39734d17138
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,48 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a786d380a7823b4d9a0511ba886548f, type: 3}
m_Name: Joint Prefab Settings
m_EditorClassIdentifier:
MainComponents:
GrabInteractable: {fileID: 11500000, guid: d9a466110b129074db957157c7ec5b2f, type: 3}
MechanicalBlock: {fileID: 11500000, guid: c4a1be166f8c7184ab860f9a010f5764, type: 3}
AttachableBlock: {fileID: 11500000, guid: 6f653344f2c17b64fb6a4073754cb555, type: 3}
SocketContainer: {fileID: 11500000, guid: aa5c0234b0ff887468bde7ca9dbbf542, type: 3}
PlacementValidator: {fileID: 11500000, guid: 8245c6e3d94e025439b7ccced75276db,
type: 3}
SocketPoint: {fileID: 11500000, guid: 7d04d85508b5c414d82419db222f9936, type: 3}
ContainerInit: {fileID: 11500000, guid: b628454e932ec7e47be99c98c50c21d2, type: 3}
BlockSettings:
grabInteractable:
Test:
mechanicalBlock:
Test:
attachableBlock:
Type: 0
socketContainer:
Test:
validator:
CollisionLayerMask:
serializedVersion: 2
m_Bits: 64
socketPoint:
SocketRadius: 0
MiscellaneousSettings:
BlockLayer:
serializedVersion: 2
m_Bits: 64
categoryData: {fileID: 11400000, guid: ffda9eca5fbd46e4badbaf708cf51b66, type: 2}
SavePath: Assets/_Project/Prefabs/Final Prefabs/Joints
Name: Joint
IteratedNumbering: 1
Suffix: _v
OverwriteExisting: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2de43eefeedfd8a4eb9ba0e9d8b1ef93
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,48 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a786d380a7823b4d9a0511ba886548f, type: 3}
m_Name: Link Prefab Settings
m_EditorClassIdentifier:
MainComponents:
GrabInteractable: {fileID: 11500000, guid: d9a466110b129074db957157c7ec5b2f, type: 3}
MechanicalBlock: {fileID: 11500000, guid: c4a1be166f8c7184ab860f9a010f5764, type: 3}
AttachableBlock: {fileID: 11500000, guid: 6f653344f2c17b64fb6a4073754cb555, type: 3}
SocketContainer: {fileID: 11500000, guid: aa5c0234b0ff887468bde7ca9dbbf542, type: 3}
PlacementValidator: {fileID: 11500000, guid: 8245c6e3d94e025439b7ccced75276db,
type: 3}
SocketPoint: {fileID: 11500000, guid: 7d04d85508b5c414d82419db222f9936, type: 3}
ContainerInit: {fileID: 11500000, guid: b628454e932ec7e47be99c98c50c21d2, type: 3}
BlockSettings:
grabInteractable:
Test:
mechanicalBlock:
Test:
attachableBlock:
Type: 1
socketContainer:
Test:
validator:
CollisionLayerMask:
serializedVersion: 2
m_Bits: 64
socketPoint:
SocketRadius: 0.3
MiscellaneousSettings:
BlockLayer:
serializedVersion: 2
m_Bits: 64
categoryData: {fileID: 11400000, guid: 86480ee67e6364b4fa1f9a1a496e5b4c, type: 2}
SavePath: Assets/_Project/Prefabs/Final Prefabs/Links
Name: Link
IteratedNumbering: 1
Suffix: _v
OverwriteExisting: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 94270647119ef4240866cec766f99b11
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,112 @@
using NaughtyAttributes;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
[System.Serializable]
public class mainComponent
{
[Header("Input the scripts for the components as intstructed by their name")]
[Tooltip("Input the Grab Interactable script here")] public MonoScript GrabInteractable;
[Tooltip("Input the Mechanical Block script here")] public MonoScript MechanicalBlock;
[Tooltip("Input the Attachable Block script here")] public MonoScript AttachableBlock;
[Tooltip("Input the Socket Container script here")] public MonoScript SocketContainer;
[Tooltip("Input the Placement Validator script here")] public MonoScript PlacementValidator;
[Tooltip("Input the Socket Point script here")] public MonoScript SocketPoint;
[Tooltip("Input the Block Container Init script here")] public MonoScript ContainerInit;
}
[System.Serializable]
public class blockSettings
{
[System.Serializable]
public class GrabInteractableSettings
{
[Header("WIP")]
public string Test;
}
[System.Serializable]
public class MechanicalBlockSettings
{
[Header("WIP")]
public string Test;
}
[System.Serializable]
public class AttachableBlockSettings
{
public BlockType Type;
}
[System.Serializable]
public class SocketContainerSettings
{
[Header("WIP")]
public string Test;
}
[System.Serializable]
public class ValidatorSettings
{
public LayerMask CollisionLayerMask;
}
[System.Serializable]
public class SocketPointSettings
{
public float SocketRadius;
}
[System.Serializable]
public class MiscSettings
{
public LayerMask BlockLayer;
}
public GrabInteractableSettings grabInteractable;
public MechanicalBlockSettings mechanicalBlock;
public AttachableBlockSettings attachableBlock;
public SocketContainerSettings socketContainer;
public ValidatorSettings validator;
public SocketPointSettings socketPoint;
public MiscSettings MiscellaneousSettings;
}
[CreateAssetMenu(fileName = "BlockPrefabSettings", menuName = "Youssef Tools/Prefab Creator Settings")]
public class PrefabCreatorSettings : ScriptableObject
{
public mainComponent MainComponents;
public blockSettings BlockSettings;
public CategoryData categoryData;
[Header("-- Save Settings --")]
[ContextMenuItem("Browse Folder", "Browse")]
public string SavePath = "Assets/_Project/Prefabs";
public string Name = "Block";
public bool IteratedNumbering = false;
public string Suffix = " vX";
[Header("-- Behavior [Leave if unsure] --")]
public bool OverwriteExisting = false;
private void Browse()
{
string path = EditorUtility.OpenFolderPanel("Select Save Folder", "Assets", "");
if (!string.IsNullOrEmpty(path))
{
if (path.StartsWith(Application.dataPath))
{
SavePath = "Assets" + path.Substring(Application.dataPath.Length);
}
else
{
Debug.LogWarning("Please select a folder inside the Assets directory.");
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7a786d380a7823b4d9a0511ba886548f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,242 @@
using Codice.CM.SEIDInfo;
using IconsCreationTool.Editor.Core;
using JetBrains.Annotations;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Unity.EditorCoroutines.Editor;
using Unity.VisualScripting;
using UnityEditor;
using UnityEngine;
using static UnityEditor.Experimental.GraphView.GraphView;
using static UnityEngine.GraphicsBuffer;
public class PrefabCreatorTool
{
static BlockDataCreatorEditor BDCE = new BlockDataCreatorEditor();
static IconsCreator IC = new IconsCreator();
[MenuItem("Youssef Tools/Create Prefab", false, 0)]
static void CreatePrefab()
{
string SavedPath = EditorPrefs.GetString("YoussefTool_SettingsPath", "");
if (string.IsNullOrEmpty(SavedPath))
{
Debug.Log("Couldn't find settings script. Please add it via the setup window");
return;
}
else
{
Debug.Log("Found settings scriptable object");
}
PrefabCreatorSettings Settings = AssetDatabase.LoadAssetAtPath<PrefabCreatorSettings>(SavedPath);
if (Settings == null)
{
Debug.LogError("The assigned settings file was deleted or moved. Please reassign in the Settings Manager.");
return;
}
GameObject[] selectedObjects = Selection.gameObjects;
int count = selectedObjects.Length;
if (count == 0)
{
Debug.LogError("Please select a GameObject in the hierarchy first");
return;
}
for (int i = 0; i < count; i++)
{
float progress = (float)i / count;
EditorUtility.DisplayProgressBar("Creating Prefabs", $"Processing {selectedObjects[i].name}...", progress);
GameObject instObj = Object.Instantiate(selectedObjects[i]);
Undo.RegisterCreatedObjectUndo(instObj, "Create Prefab");
CreateStart(instObj, Settings);
}
EditorUtility.ClearProgressBar();
}
// Logic (ngl Youssef cooked here)
public static void CreateStart(GameObject Target, PrefabCreatorSettings Settings)
{
if (Target.transform.childCount == 0)
{
Debug.LogError("Please setup the target object by supplying it with the spheres as children");
return;
}
// Main mesh part
var MC = Settings.MainComponents;
if (MC.GrabInteractable != null)
{
var scriptType = MC.GrabInteractable.GetClass();
if (scriptType == null || !typeof(GrabInteractable).IsAssignableFrom(scriptType))
Debug.LogError("The Grab Interactable script is incorrect or does not inherit from GrabInteractable");
else
{
var gInteract = Target.AddComponent(scriptType);
}
}
if (MC.MechanicalBlock != null)
{
var scriptType = MC.MechanicalBlock.GetClass();
if (scriptType == null || !typeof(Block).IsAssignableFrom(scriptType))
Debug.LogError("The Block script is incorrect!");
else
{
var mBlock = Target.AddComponent(scriptType);
}
}
if (MC.AttachableBlock != null)
{
var scriptType = MC.AttachableBlock.GetClass();
if (scriptType == null || !typeof(AttachableBlock).IsAssignableFrom(scriptType))
Debug.LogError("The Attachable Block script is incorrect!");
else
{
Target.AddComponent(scriptType);
BlockType layerM = Settings.BlockSettings.attachableBlock.Type;
Target.GetComponent<AttachableBlock>().SetBlockType(layerM);
}
}
if (MC.SocketContainer != null)
{
var scriptType = MC.SocketContainer.GetClass();
if (scriptType == null || !typeof(SocketContainer).IsAssignableFrom(scriptType))
Debug.LogError("The Socket Container script is incorrect!");
else
{
var sContain = Target.AddComponent(scriptType);
}
}
if (MC.PlacementValidator != null)
{
var scriptType = MC.PlacementValidator.GetClass();
if (scriptType == null || !typeof(IValidator).IsAssignableFrom(scriptType))
Debug.LogError("The Validator script is incorrect!");
else
{
var pValidate = Target.AddComponent(scriptType);
LayerMask Coll = Settings.BlockSettings.validator.CollisionLayerMask;
Target.GetComponent<IValidator>().SetLayerMask(Coll);
}
}
if (MC.ContainerInit != null)
{
var scriptType = MC.ContainerInit.GetClass();
if (scriptType == null || !typeof(BlockContainerInit).IsAssignableFrom(scriptType))
Debug.LogError("The Block Container Init script is incorrect");
else
{
var cInit = Target.AddComponent(scriptType);
}
}
Rigidbody RB = Target.AddComponent<Rigidbody>();
MeshCollider MeshC = Target.AddComponent<MeshCollider>();
MeshC.convex = false;
RB.isKinematic = true;
RB.useGravity = false;
Target.transform.localEulerAngles = new Vector3(0, 0, 0);
var Tlayer = Settings.BlockSettings.MiscellaneousSettings.BlockLayer;
// Children part
Transform[] Children = Target.GetComponentsInChildren<Transform>().Where(x => x != Target.transform).ToArray();
if (Children.Length < 0)
Debug.Log($"No children exist for object {Target.name}, please make sure the object has children or add sockets manually");
else
{
foreach (Transform t in Children)
{
Object.DestroyImmediate(t.GetComponent<MeshRenderer>());
if (MC.SocketPoint != null)
{
var scriptType = MC.SocketPoint.GetClass();
if (scriptType == null || !typeof(SocketPoint).IsAssignableFrom(scriptType))
Debug.LogError("The Socket Point script is incorrect!");
else
{
t.gameObject.AddComponent(scriptType);
var sPoint = t.gameObject.GetComponent<SocketPoint>();
sPoint.SetSocketRadius(Settings.BlockSettings.socketPoint.SocketRadius);
}
}
Rigidbody rb = t.AddComponent<Rigidbody>();
CapsuleCollider sc = t.AddComponent<CapsuleCollider>();
rb.isKinematic = true;
rb.useGravity = false;
sc.isTrigger = true;
t.localPosition = new Vector3(t.localPosition.x, t.localPosition.y / 2, t.localPosition.z);
t.localScale = new Vector3(0.006f, 0.006f, 0.006f);
}
}
if (!Directory.Exists(Settings.SavePath))
{
Directory.CreateDirectory(Settings.SavePath);
AssetDatabase.Refresh();
}
string fileName = Settings.Name + Settings.Suffix;
string localPath = $"{Settings.SavePath}/{fileName}.prefab";
if (Settings.IteratedNumbering || !Settings.OverwriteExisting)
{
localPath = AssetDatabase.GenerateUniqueAssetPath(localPath);
}
bool success;
GameObject prefabAsset = PrefabUtility.SaveAsPrefabAsset(Target, localPath, out success);
if (success)
{
Debug.Log($"Success! Prefab created at: {localPath}");
EditorGUIUtility.PingObject(prefabAsset);
}
else
{
Debug.LogError("Prefab failed to save. Check the Save Path in Settings.");
}
var BD = BDCE.CreateBlockData(prefabAsset);
prefabAsset.GetComponent<MechanicalBlock>().SetBlockData(BD);
if (Settings.categoryData)
{
var Category = Settings.categoryData;
BD.associatedCategory = Category;
Category.blocks.Add(BD);
}
List<Object> list = new List<Object>();
list.Add(prefabAsset);
IconBackgroundData IBD = new IconBackgroundData(IconBackground.None, Color.white, Texture2D.whiteTexture);
IconsCreatorData ICD = new IconsCreatorData(1024, 0, null, null, IBD, list, true);
IC.SetData(ICD);
IC.CreateIcon();
PrefabUtility.RecordPrefabInstancePropertyModifications(prefabAsset);
EditorUtility.SetDirty(prefabAsset);
AssetDatabase.SaveAssetIfDirty(prefabAsset);
AssetDatabase.Refresh();
Object.DestroyImmediate(Target);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 147dedb329e334b4e8f14903b5a67d1e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,37 @@
using UnityEngine;
using UnityEditor;
public class PrefabSettingsWindow : EditorWindow
{
public PrefabCreatorSettings CurrentSettings;
[MenuItem("Youssef Tools/Prefab Creator Setup")]
public static void ShowWindow() => GetWindow<PrefabSettingsWindow>("Setup Window");
private void OnEnable()
{
string SavedPath = EditorPrefs.GetString("YoussefTool_SettingsPath", "");
if (!string.IsNullOrEmpty(SavedPath))
{
CurrentSettings = AssetDatabase.LoadAssetAtPath<PrefabCreatorSettings>(SavedPath);
}
}
void OnGUI()
{
GUILayout.Label("Active Tool Settings", EditorStyles.boldLabel);
EditorGUI.BeginChangeCheck();
CurrentSettings = (PrefabCreatorSettings)EditorGUILayout.ObjectField(
"Prefab Creator Settings", CurrentSettings, typeof(PrefabCreatorSettings), false);
if (EditorGUI.EndChangeCheck())
{
string path = AssetDatabase.GetAssetPath(CurrentSettings);
EditorPrefs.SetString("YoussefTool_SettingsPath", path);
}
if (CurrentSettings != null)
Editor.CreateEditor(CurrentSettings).OnInspectorGUI();
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 81bb800f6ea1d69459bb074210dd283a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+61
View File
@@ -0,0 +1,61 @@
using System.IO;
using UnityEngine;
using UnityEditor;
public static class Setup
{
[MenuItem("Tools/Setup/CreateFolderStructure")]
public static void CreateDefaultFolders()
{
Folders.CreateDefault("_Project", "Animations" , "Art" , "Audio" , "Data", "Prefabs" , "Scenes" , "Scripts");
Folders.CreateDefault("_Project/Art", "UI" , "Texture" , "Materials" , "Models");
Folders.CreateDefault("_Project/Scenes", "GameScenes" , "TestLabs");
Folders.CreateDefault("_Project/Audio", "BackgroundMusic", "SFX");
Folders.CreateDefault("_Project/Scripts", "Shaders" , "Code");
Folders.CreateDefault("_Project/Prefabs", "XR Prefabs", "System Prefabs" , "Partical Prefabs");
AssetDatabase.Refresh();
}
[MenuItem("Tools/Setup/ImportAssets")]
public static void ImportAssets()
{
Assets.ImportAsset("DOTween HOTween v2.unitypackage" , "Demigiant/Editor ExtensionsAnimation");
Assets.ImportAsset("Colored Hierarchy Headers.unitypackage", "Baedrick/Editor ExtensionsUtilities");
Assets.ImportAsset("CGHierarchyIcons.unitypackage", "Franco Rosatto/Editor ExtensionsUtilities");
Assets.ImportAsset("Folder.Icons.v0.1.2.unitypackage", "WooshiiDev");
}
static class Folders
{
public static void CreateDefault(string root, params string[] folders)
{
var fullpath = Path.Combine(Application.dataPath, root);
foreach (var folder in folders)
{
var path = Path.Combine(fullpath , folder);
if(!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
}
}
}
public static class Assets
{
public static void ImportAsset(string asset , string subfolder, string folder = "C:/Users/hussi/AppData/Roaming/Unity/Asset Store-5.x")
{
AssetDatabase.ImportPackage(Path.Combine(folder, subfolder, asset), false);
}
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aba1aadf96359c3459698607d6d75832
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4575eb992af3f8b409affb219ddba7f4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f1c5c604e6d27cc4d86e81f45c704e11
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b1e9ff0668650a54da2c458e80a90032
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: afb4c815411c28b449e61fbaa1a8bfa3
folderAsset: yes
timeCreated: 1507995550
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 07845a5477be2b149a6f1cb32b5a3a5b
timeCreated: 1507998788
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,63 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!850595691 &4890085278179872738
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: DemoSceneSettings
serializedVersion: 2
m_GIWorkflowMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_BakeBackend: 0
m_LightmapMaxSize: 1024
m_BakeResolution: 40
m_Padding: 2
m_TextureCompression: 1
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 256
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRRussianRouletteStartBounce: 2
m_PVREnvironmentMIS: 0
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 98ee975b74776234986f4d35f14c4ccc
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 53a462744f22ca549927c5e6ea797362
folderAsset: yes
timeCreated: 1509089305
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,93 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1981131855061102
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4344736110947706}
- component: {fileID: 33062901823624450}
- component: {fileID: 65233182844289960}
- component: {fileID: 23099360439063292}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4344736110947706
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1981131855061102}
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: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33062901823624450
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1981131855061102}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65233182844289960
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1981131855061102}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &23099360439063292
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1981131855061102}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 7ec354ef3daae7641b7a3fa5e1fe0c81
timeCreated: 1509089337
licenseType: Store
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,169 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: DummyAnimation
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 1
value: {x: 0, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path:
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path:
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path:
classID: 4
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 1
m_HasMotionFloatCurves: 0
m_Events: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 31fbd6c92d19aaa48910857627a54a25
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,120 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-1567792821050049497
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: DummyAnimation
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 31fbd6c92d19aaa48910857627a54a25, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: DummyAnimatorController
serializedVersion: 5
m_AnimatorParameters:
- m_Name: Float0
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Float1
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Int0
m_Type: 3
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Int1
m_Type: 3
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Bool0
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Bool1
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Trigger0
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
- m_Name: Trigger1
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 945276690032550857}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1107 &945276690032550857
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -1567792821050049497}
m_Position: {x: 390, y: 80, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -1567792821050049497}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 63ee86efd213bf34285c95f33e79dc6c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 753bdb918c6038142acddbd7aae6958f, type: 3}
m_Name: NaughtyScriptableObject
m_EditorClassIdentifier:
listA:
- {fileID: 11400000, guid: 149474eb879a6a641b560ca17d48712f, type: 2}
- {fileID: 11400000, guid: 149474eb879a6a641b560ca17d48712f, type: 2}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 9cf80899b80517945a2d2390fb48877f
timeCreated: 1518639643
licenseType: Store
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 19472ac11eae27a4b804f354ca7d9c00, type: 3}
m_Name: TestScriptableObjectA
m_EditorClassIdentifier:
listB:
- {fileID: 11400000, guid: 05371aa7630d3ef44ac0106af06cd73c, type: 2}
- {fileID: 11400000, guid: 05371aa7630d3ef44ac0106af06cd73c, type: 2}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 149474eb879a6a641b560ca17d48712f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c2b396aeebc9d984da298eee313896bc, type: 3}
m_Name: TestScriptableObjectB
m_EditorClassIdentifier:
slider: {x: 3, y: 7}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 05371aa7630d3ef44ac0106af06cd73c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,127 @@
fileFormatVersion: 2
guid: 005888ede18a58e4db8d069cfa3007cb
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
+10
View File
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 66686847ee1fa044bb15dfe473666178
folderAsset: yes
timeCreated: 1507995546
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 1f67e408a6d0adf4ab29d095ccd8b116
folderAsset: yes
timeCreated: 1507998942
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c76425e719cd4424d868674bcfb233f2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class AllowNestingAttribute : DrawerAttribute
{
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 95b49d3abe880c044adbe7faf6b7b4ec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,24 @@
using System;
using UnityEngine;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class AnimatorParamAttribute : DrawerAttribute
{
public string AnimatorName { get; private set; }
public AnimatorControllerParameterType? AnimatorParamType { get; private set; }
public AnimatorParamAttribute(string animatorName)
{
AnimatorName = animatorName;
AnimatorParamType = null;
}
public AnimatorParamAttribute(string animatorName, AnimatorControllerParameterType animatorParamType)
{
AnimatorName = animatorName;
AnimatorParamType = animatorParamType;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7373332cb77b42744a415d6b4add445d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,30 @@
using System;
using UnityEngine;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class CurveRangeAttribute : DrawerAttribute
{
public Vector2 Min { get; private set; }
public Vector2 Max { get; private set; }
public EColor Color { get; private set; }
public CurveRangeAttribute(Vector2 min, Vector2 max, EColor color = EColor.Clear)
{
Min = min;
Max = max;
Color = color;
}
public CurveRangeAttribute(EColor color)
: this(Vector2.zero, Vector2.one, color)
{
}
public CurveRangeAttribute(float minX, float minY, float maxX, float maxY, EColor color = EColor.Clear)
: this(new Vector2(minX, minY), new Vector2(maxX, maxY), color)
{
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bbdf3fb8882c7514c9a01108122cda7e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,11 @@
using UnityEngine;
namespace NaughtyAttributes
{
/// <summary>
/// Base class for all drawer attributes
/// </summary>
public class DrawerAttribute : PropertyAttribute, INaughtyAttribute
{
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9df37fdebccf65c4da5b0a14f6dad5f5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,57 @@
using System.Collections;
using System;
using System.Collections.Generic;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class DropdownAttribute : DrawerAttribute
{
public string ValuesName { get; private set; }
public DropdownAttribute(string valuesName)
{
ValuesName = valuesName;
}
}
public interface IDropdownList : IEnumerable<KeyValuePair<string, object>>
{
}
public class DropdownList<T> : IDropdownList
{
private List<KeyValuePair<string, object>> _values;
public DropdownList()
{
_values = new List<KeyValuePair<string, object>>();
}
public void Add(string displayName, T value)
{
_values.Add(new KeyValuePair<string, object>(displayName, value));
}
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
return _values.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public static explicit operator DropdownList<object>(DropdownList<T> target)
{
DropdownList<object> result = new DropdownList<object>();
foreach (var kvp in target)
{
result.Add(kvp.Key, kvp.Value);
}
return result;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2cb864a1092cec04f8a4dbb556e8ed31
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class EnumFlagsAttribute : DrawerAttribute
{
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e8b31eb6d7299e54d89dcabc4cad0e6a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class ExpandableAttribute : DrawerAttribute
{
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 60926d6ca7f9ced469e9248ff1192da6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More