From f049177e20a276049c61edbad631c1b2bbdd5706 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 15 Oct 2020 19:05:22 +0800 Subject: -advanced inspector +odin --- .../Controllers/Old_AnimContro_Saionji.controller | 2 +- Assets/Art/Sound.meta | 8 - Assets/MeshUtility.meta | 8 - Assets/MeshUtility/CHANGELOG.md | 7 - Assets/MeshUtility/CHANGELOG.md.meta | 7 - Assets/MeshUtility/Documentation.meta | 8 - Assets/MeshUtility/Documentation/MeshUtility.md | 7 - .../MeshUtility/Documentation/MeshUtility.md.meta | 7 - Assets/MeshUtility/Documentation/images.meta | 8 - .../Documentation/images/blendshape_separator.jpg | Bin 47176 -> 0 bytes .../images/blendshape_separator.jpg.meta | 88 - .../Documentation/images/installation_1.jpg | Bin 23760 -> 0 bytes .../Documentation/images/installation_1.jpg.meta | 88 - .../Documentation/images/installation_2.jpg | Bin 20387 -> 0 bytes .../Documentation/images/installation_2.jpg.meta | 88 - .../Documentation/images/installation_3.jpg | Bin 24575 -> 0 bytes .../Documentation/images/installation_3.jpg.meta | 88 - .../Documentation/images/interface_1.jpg | Bin 17973 -> 0 bytes .../Documentation/images/interface_1.jpg.meta | 88 - .../Documentation/images/interface_2.jpg | Bin 13868 -> 0 bytes .../Documentation/images/interface_2.jpg.meta | 88 - .../Documentation/images/interface_3.jpg | Bin 26061 -> 0 bytes .../Documentation/images/interface_3.jpg.meta | 88 - .../MeshUtility/Documentation/images/result_1.jpg | Bin 28604 -> 0 bytes .../Documentation/images/result_1.jpg.meta | 88 - .../MeshUtility/Documentation/images/result_2.jpg | Bin 21222 -> 0 bytes .../Documentation/images/result_2.jpg.meta | 88 - Assets/MeshUtility/Documentation/notes.meta | 8 - .../Documentation/notes/MeshSeparator.md | 25 - .../Documentation/notes/MeshSeparator.md.meta | 7 - Assets/MeshUtility/Editor.meta | 8 - Assets/MeshUtility/Editor/BoneMeshEraserWizard.cs | 200 - .../Editor/BoneMeshEraserWizard.cs.meta | 13 - Assets/MeshUtility/Editor/HumanoidEditor.cs | 324 - Assets/MeshUtility/Editor/HumanoidEditor.cs.meta | 11 - .../MeshUtility/Editor/MeshUtility.Editor.asmdef | 16 - .../Editor/MeshUtility.Editor.asmdef.meta | 7 - Assets/MeshUtility/Editor/MeshUtility.cs | 286 - Assets/MeshUtility/Editor/MeshUtility.cs.meta | 11 - Assets/MeshUtility/LICENSE.md | 9 - Assets/MeshUtility/LICENSE.md.meta | 7 - Assets/MeshUtility/README.md | 58 - Assets/MeshUtility/README.md.meta | 7 - Assets/MeshUtility/README.url | 2 - Assets/MeshUtility/README.url.meta | 7 - Assets/MeshUtility/Runtime.meta | 8 - Assets/MeshUtility/Runtime/BindposeGizmo.cs | 158 - Assets/MeshUtility/Runtime/BindposeGizmo.cs.meta | 13 - Assets/MeshUtility/Runtime/BoneMeshEraser.cs | 166 - Assets/MeshUtility/Runtime/BoneMeshEraser.cs.meta | 13 - Assets/MeshUtility/Runtime/BoneNormalizer.cs | 507 - Assets/MeshUtility/Runtime/BoneNormalizer.cs.meta | 13 - Assets/MeshUtility/Runtime/Humanoid.cs | 441 - Assets/MeshUtility/Runtime/Humanoid.cs.meta | 11 - Assets/MeshUtility/Runtime/HumanoidLoader.cs | 60 - Assets/MeshUtility/Runtime/HumanoidLoader.cs.meta | 11 - Assets/MeshUtility/Runtime/MeshExtensions.cs | 85 - Assets/MeshUtility/Runtime/MeshExtensions.cs.meta | 12 - .../MeshUtility/Runtime/MeshIntegrationResult.cs | 13 - .../Runtime/MeshIntegrationResult.cs.meta | 11 - Assets/MeshUtility/Runtime/MeshIntegrator.cs | 253 - Assets/MeshUtility/Runtime/MeshIntegrator.cs.meta | 3 - .../MeshUtility/Runtime/MeshIntegratorUtility.cs | 140 - .../Runtime/MeshIntegratorUtility.cs.meta | 3 - Assets/MeshUtility/Runtime/MeshUtility.asmdef | 3 - Assets/MeshUtility/Runtime/MeshUtility.asmdef.meta | 7 - Assets/MeshUtility/Runtime/UnityExtensions.cs | 319 - Assets/MeshUtility/Runtime/UnityExtensions.cs.meta | 11 - Assets/MeshUtility/Runtime/UnityPath.cs | 435 - Assets/MeshUtility/Runtime/UnityPath.cs.meta | 12 - Assets/MeshUtility/package.json | 13 - Assets/MeshUtility/package.json.meta | 7 - Assets/Plugins/AdvancedInspector.meta | 5 - Assets/Plugins/AdvancedInspector/Attributes.meta | 5 - .../Attributes/AdvancedInspector.cs | 60 - .../Attributes/AdvancedInspector.cs.meta | 8 - .../Plugins/AdvancedInspector/Attributes/Angle.cs | 34 - .../AdvancedInspector/Attributes/Angle.cs.meta | 8 - .../AdvancedInspector/Attributes/Background.cs | 100 - .../Attributes/Background.cs.meta | 8 - .../Plugins/AdvancedInspector/Attributes/Bypass.cs | 13 - .../AdvancedInspector/Attributes/Bypass.cs.meta | 8 - .../AdvancedInspector/Attributes/Collection.cs | 151 - .../Attributes/Collection.cs.meta | 8 - .../AdvancedInspector/Attributes/Constructor.cs | 82 - .../Attributes/Constructor.cs.meta | 12 - .../AdvancedInspector/Attributes/CreateDerived.cs | 15 - .../Attributes/CreateDerived.cs.meta | 8 - .../AdvancedInspector/Attributes/Descriptor.cs | 262 - .../Attributes/Descriptor.cs.meta | 8 - .../Attributes/DisplayAsParent.cs | 10 - .../Attributes/DisplayAsParent.cs.meta | 8 - .../Attributes/DontAllowSceneObject.cs | 11 - .../Attributes/DontAllowSceneObject.cs.meta | 8 - .../Plugins/AdvancedInspector/Attributes/Enum.cs | 68 - .../AdvancedInspector/Attributes/Enum.cs.meta | 8 - .../AdvancedInspector/Attributes/Expandable.cs | 46 - .../Attributes/Expandable.cs.meta | 8 - .../AdvancedInspector/Attributes/FieldEditor.cs | 26 - .../Attributes/FieldEditor.cs.meta | 8 - .../Plugins/AdvancedInspector/Attributes/Group.cs | 110 - .../AdvancedInspector/Attributes/Group.cs.meta | 8 - .../Plugins/AdvancedInspector/Attributes/Help.cs | 199 - .../AdvancedInspector/Attributes/Help.cs.meta | 8 - .../AdvancedInspector/Attributes/Inspect.cs | 195 - .../AdvancedInspector/Attributes/Inspect.cs.meta | 8 - .../Plugins/AdvancedInspector/Attributes/Method.cs | 37 - .../AdvancedInspector/Attributes/Method.cs.meta | 8 - .../AdvancedInspector/Attributes/NoPicker.cs | 13 - .../AdvancedInspector/Attributes/NoPicker.cs.meta | 8 - .../AdvancedInspector/Attributes/RangeValue.cs | 40 - .../Attributes/RangeValue.cs.meta | 8 - .../AdvancedInspector/Attributes/ReadOnly.cs | 84 - .../AdvancedInspector/Attributes/ReadOnly.cs.meta | 8 - .../AdvancedInspector/Attributes/Restrict.cs | 122 - .../AdvancedInspector/Attributes/Restrict.cs.meta | 8 - .../AdvancedInspector/Attributes/RuntimeResolve.cs | 85 - .../Attributes/RuntimeResolve.cs.meta | 8 - .../Plugins/AdvancedInspector/Attributes/Space.cs | 48 - .../AdvancedInspector/Attributes/Space.cs.meta | 8 - .../Plugins/AdvancedInspector/Attributes/Style.cs | 43 - .../AdvancedInspector/Attributes/Style.cs.meta | 8 - Assets/Plugins/AdvancedInspector/Attributes/Tab.cs | 25 - .../AdvancedInspector/Attributes/Tab.cs.meta | 8 - .../AdvancedInspector/Attributes/TextField.cs | 87 - .../AdvancedInspector/Attributes/TextField.cs.meta | 8 - .../Plugins/AdvancedInspector/Attributes/Title.cs | 111 - .../AdvancedInspector/Attributes/Title.cs.meta | 8 - .../AdvancedInspector/Attributes/Toolbar.cs | 108 - .../AdvancedInspector/Attributes/Toolbar.cs.meta | 8 - Assets/Plugins/AdvancedInspector/Core.meta | 5 - .../AdvancedInspector/Core/ActionBinding.cs | 744 -- .../AdvancedInspector/Core/ActionBinding.cs.meta | 8 - .../Core/ComponentMonoBehaviour.cs | 199 - .../Core/ComponentMonoBehaviour.cs.meta | 8 - .../Plugins/AdvancedInspector/Core/RangeFloat.cs | 20 - .../AdvancedInspector/Core/RangeFloat.cs.meta | 8 - Assets/Plugins/AdvancedInspector/Core/RangeInt.cs | 20 - .../AdvancedInspector/Core/RangeInt.cs.meta | 8 - .../Plugins/AdvancedInspector/Core/UDictionary.cs | 230 - .../AdvancedInspector/Core/UDictionary.cs.meta | 8 - Assets/Plugins/AdvancedInspector/Event.meta | 5 - .../AdvancedInspector/Event/EventHandlers.cs | 22 - .../AdvancedInspector/Event/EventHandlers.cs.meta | 8 - Assets/Plugins/AdvancedInspector/Interface.meta | 5 - .../AdvancedInspector/Interface/ICopiable.cs | 18 - .../AdvancedInspector/Interface/ICopiable.cs.meta | 8 - .../Plugins/AdvancedInspector/Interface/ICopy.cs | 18 - .../AdvancedInspector/Interface/ICopy.cs.meta | 8 - .../AdvancedInspector/Interface/IDataChanged.cs | 24 - .../Interface/IDataChanged.cs.meta | 8 - .../Interface/IInspectorRunning.cs | 29 - .../Interface/IInspectorRunning.cs.meta | 8 - .../AdvancedInspector/Interface/IListAttribute.cs | 12 - .../Interface/IListAttribute.cs.meta | 8 - .../AdvancedInspector/Interface/IPreview.cs | 26 - .../AdvancedInspector/Interface/IPreview.cs.meta | 8 - .../Interface/IRuntimeAttribute.cs | 44 - .../Interface/IRuntimeAttribute.cs.meta | 8 - Assets/Plugins/AdvancedInspector/Utility.meta | 5 - .../AdvancedInspector/Utility/TypeUtility.cs | 25 - .../AdvancedInspector/Utility/TypeUtility.cs.meta | 8 - Assets/Plugins/Editor/AdvancedInspector.meta | 5 - .../Editor/AdvancedInspector/AdvancedInspector.XML | 1630 --- .../AdvancedInspector/AdvancedInspector.XML.meta | 8 - .../Editor/AdvancedInspector/AdvancedInspector.dll | Bin 167936 -> 0 bytes .../AdvancedInspector/AdvancedInspector.dll.meta | 33 - .../Editor/AdvancedInspector/AdvancedInspector.pdb | Bin 421376 -> 0 bytes .../AdvancedInspector/AdvancedInspector.pdb.meta | 8 - .../Plugins/Editor/AdvancedInspector/Examples.meta | 5 - .../Examples/ExternalInspectorWindow.cs | 76 - .../Examples/ExternalInspectorWindow.cs.meta | 8 - .../Plugins/Editor/AdvancedInspector/ExtraGUI.meta | 5 - .../Editor/AdvancedInspector/ExtraGUI/ExtraGUI.cs | 196 - .../AdvancedInspector/ExtraGUI/ExtraGUI.cs.meta | 8 - .../AdvancedInspector/ExtraGUI/ExtraGUILayout.cs | 59 - .../ExtraGUI/ExtraGUILayout.cs.meta | 8 - .../Editor/AdvancedInspector/FieldEditors.meta | 5 - .../FieldEditors/AnimationCurveEditor.cs | 29 - .../FieldEditors/AnimationCurveEditor.cs.meta | 8 - .../FieldEditors/BooleanEditor.cs | 30 - .../FieldEditors/BooleanEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/BoundsEditor.cs | 134 - .../FieldEditors/BoundsEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/CharEditor.cs | 40 - .../FieldEditors/CharEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/ColorEditor.cs | 49 - .../FieldEditors/ColorEditor.cs.meta | 8 - .../FieldEditors/DateTimeEditor.cs | 69 - .../FieldEditors/DateTimeEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/EnumEditor.cs | 192 - .../FieldEditors/EnumEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/FloatEditor.cs | 208 - .../FieldEditors/FloatEditor.cs.meta | 8 - .../FieldEditors/GradientEditor.cs | 36 - .../FieldEditors/GradientEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/GuidEditor.cs | 25 - .../FieldEditors/GuidEditor.cs.meta | 8 - .../FieldEditors/IntegerEditor.cs | 195 - .../FieldEditors/IntegerEditor.cs.meta | 8 - .../FieldEditors/LayerMaskEditor.cs | 104 - .../FieldEditors/LayerMaskEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/MonoEditor.cs | 78 - .../FieldEditors/MonoEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/ObjectEditor.cs | 192 - .../FieldEditors/ObjectEditor.cs.meta | 8 - .../FieldEditors/QuaternionEditor.cs | 168 - .../FieldEditors/QuaternionEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/RangeEditor.cs | 109 - .../FieldEditors/RangeEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/RectEditor.cs | 165 - .../FieldEditors/RectEditor.cs.meta | 8 - .../FieldEditors/RigidbodyConstraints2DEditor.cs | 60 - .../RigidbodyConstraints2DEditor.cs.meta | 12 - .../FieldEditors/RigidbodyConstraintsEditor.cs | 69 - .../RigidbodyConstraintsEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/StringEditor.cs | 89 - .../FieldEditors/StringEditor.cs.meta | 8 - .../FieldEditors/TimeSpanEditor.cs | 98 - .../FieldEditors/TimeSpanEditor.cs.meta | 8 - .../AdvancedInspector/FieldEditors/VectorEditor.cs | 208 - .../FieldEditors/VectorEditor.cs.meta | 8 - .../Editor/AdvancedInspector/UniToolsEditor.XML | 453 - .../AdvancedInspector/UniToolsEditor.XML.meta | 4 - .../Editor/AdvancedInspector/UniToolsEditor.dll | Bin 61440 -> 0 bytes .../AdvancedInspector/UniToolsEditor.dll.meta | 33 - .../Editor/AdvancedInspector/UniToolsEditor.pdb | Bin 42496 -> 0 bytes .../AdvancedInspector/UniToolsEditor.pdb.meta | 4 - .../Editor/AdvancedInspector/UnityTypes.meta | 5 - .../UnityTypes/AnchoredJoint2DEditor.cs | 76 - .../UnityTypes/AnchoredJoint2DEditor.cs.meta | 8 - .../UnityTypes/AnimationEditor.cs | 85 - .../UnityTypes/AnimationEditor.cs.meta | 8 - .../AdvancedInspector/UnityTypes/AnimatorEditor.cs | 117 - .../UnityTypes/AnimatorEditor.cs.meta | 8 - .../UnityTypes/BoxColliderEditor.cs | 70 - .../UnityTypes/BoxColliderEditor.cs.meta | 8 - .../AdvancedInspector/UnityTypes/CameraEditor.cs | 268 - .../UnityTypes/CameraEditor.cs.meta | 8 - .../UnityTypes/CapsuleColliderEditor.cs | 165 - .../UnityTypes/CapsuleColliderEditor.cs.meta | 8 - .../UnityTypes/CharacterControllerEditor.cs | 151 - .../UnityTypes/CharacterControllerEditor.cs.meta | 8 - .../UnityTypes/CharacterJointEditor.cs | 33 - .../UnityTypes/CharacterJointEditor.cs.meta | 8 - .../AdvancedInspector/UnityTypes/ClothEditor.cs | 37 - .../UnityTypes/ClothEditor.cs.meta | 8 - .../UnityTypes/ClothRendererEditor.cs | 26 - .../UnityTypes/ClothRendererEditor.cs.meta | 8 - .../AdvancedInspector/UnityTypes/ColliderEditor.cs | 39 - .../UnityTypes/ColliderEditor.cs.meta | 8 - .../UnityTypes/ConstantForceEditor.cs | 29 - .../UnityTypes/ConstantForceEditor.cs.meta | 8 - .../UnityTypes/FixedJointEditor.cs | 20 - .../UnityTypes/FixedJointEditor.cs.meta | 8 - .../UnityTypes/HingeJoint2DEditor.cs | 69 - .../UnityTypes/HingeJoint2DEditor.cs.meta | 8 - .../UnityTypes/HingeJointEditor.cs | 84 - .../UnityTypes/HingeJointEditor.cs.meta | 8 - .../AdvancedInspector/UnityTypes/Joint2DEditor.cs | 160 - .../UnityTypes/Joint2DEditor.cs.meta | 8 - .../AdvancedInspector/UnityTypes/JointEditor.cs | 37 - .../UnityTypes/JointEditor.cs.meta | 8 - .../AdvancedInspector/UnityTypes/LightEditor.cs | 351 - .../UnityTypes/LightEditor.cs.meta | 8 - .../UnityTypes/MeshColliderEditor.cs | 43 - .../UnityTypes/MeshColliderEditor.cs.meta | 8 - .../AdvancedInspector/UnityTypes/MeshEditor.cs | 45 - .../UnityTypes/MeshEditor.cs.meta | 8 - .../UnityTypes/MeshFilterEditor.cs | 23 - .../UnityTypes/MeshFilterEditor.cs.meta | 8 - .../UnityTypes/MeshRendererEditor.cs | 20 - .../UnityTypes/MeshRendererEditor.cs.meta | 8 - .../AdvancedInspector/UnityTypes/RendererEditor.cs | 53 - .../UnityTypes/RendererEditor.cs.meta | 8 - .../UnityTypes/Rigidbody2DEditor.cs | 43 - .../UnityTypes/Rigidbody2DEditor.cs.meta | 8 - .../UnityTypes/RigidbodyEditor.cs | 72 - .../UnityTypes/RigidbodyEditor.cs.meta | 8 - .../UnityTypes/SkinnedMeshRendererEditor.cs | 36 - .../UnityTypes/SkinnedMeshRendererEditor.cs.meta | 8 - .../UnityTypes/SphereColliderEditor.cs | 76 - .../UnityTypes/SphereColliderEditor.cs.meta | 8 - .../UnityTypes/SpringJoint2DEditor.cs | 28 - .../UnityTypes/SpringJoint2DEditor.cs.meta | 8 - .../UnityTypes/SpringJointEditor.cs | 30 - .../UnityTypes/SpringJointEditor.cs.meta | 8 - .../UnityTypes/SpriteRendererEditor.cs | 36 - .../UnityTypes/SpriteRendererEditor.cs.meta | 8 - .../AdvancedInspector/UnityTypes/SubTypes.meta | 5 - .../UnityTypes/SubTypes/JointAngleLimits2D.cs | 25 - .../UnityTypes/SubTypes/JointAngleLimits2D.cs.meta | 8 - .../UnityTypes/SubTypes/JointDriveEditor.cs | 29 - .../UnityTypes/SubTypes/JointDriveEditor.cs.meta | 8 - .../UnityTypes/SubTypes/JointLimitsEditor.cs | 29 - .../UnityTypes/SubTypes/JointLimitsEditor.cs.meta | 8 - .../UnityTypes/SubTypes/JointMotor2DEditor.cs | 25 - .../UnityTypes/SubTypes/JointMotor2DEditor.cs.meta | 8 - .../UnityTypes/SubTypes/JointMotorEditor.cs | 27 - .../UnityTypes/SubTypes/JointMotorEditor.cs.meta | 8 - .../UnityTypes/SubTypes/JointSpringEditor.cs | 27 - .../UnityTypes/SubTypes/JointSpringEditor.cs.meta | 8 - .../UnityTypes/SubTypes/SoftJointLimitEditor.cs | 29 - .../SubTypes/SoftJointLimitEditor.cs.meta | 8 - .../SubTypes/WheelFrictionCurveEditor.cs | 31 - .../SubTypes/WheelFrictionCurveEditor.cs.meta | 8 - .../UnityTypes/TerrainColliderEditor.cs | 32 - .../UnityTypes/TerrainColliderEditor.cs.meta | 8 - .../AdvancedInspector/UnityTypes/TextMeshEditor.cs | 49 - .../UnityTypes/TextMeshEditor.cs.meta | 8 - .../UnityTypes/TransformEditor.cs | 32 - .../UnityTypes/TransformEditor.cs.meta | 8 - .../UnityTypes/WheelColliderEditor.cs | 47 - .../UnityTypes/WheelColliderEditor.cs.meta | 8 - Assets/Plugins/Sirenix.meta | 9 + Assets/Plugins/Sirenix/Assemblies.meta | 9 + Assets/Plugins/Sirenix/Assemblies/NoEditor.meta | 9 + .../Assemblies/NoEditor/Sirenix.Serialization.dll | Bin 0 -> 324608 bytes .../NoEditor/Sirenix.Serialization.dll.mdb | Bin 0 -> 121435 bytes .../NoEditor/Sirenix.Serialization.dll.mdb.meta | 8 + .../NoEditor/Sirenix.Serialization.dll.meta | 77 + .../Assemblies/NoEditor/Sirenix.Utilities.dll | Bin 0 -> 145408 bytes .../Assemblies/NoEditor/Sirenix.Utilities.dll.mdb | Bin 0 -> 47002 bytes .../NoEditor/Sirenix.Utilities.dll.mdb.meta | 8 + .../Assemblies/NoEditor/Sirenix.Utilities.dll.meta | 77 + .../Sirenix/Assemblies/NoEmitAndNoEditor.meta | 9 + .../NoEmitAndNoEditor/Sirenix.Serialization.dll | Bin 0 -> 314880 bytes .../Sirenix.Serialization.dll.mdb | Bin 0 -> 118415 bytes .../Sirenix.Serialization.dll.mdb.meta | 8 + .../Sirenix.Serialization.dll.meta | 80 + .../NoEmitAndNoEditor/Sirenix.Utilities.dll | Bin 0 -> 142848 bytes .../NoEmitAndNoEditor/Sirenix.Utilities.dll.mdb | Bin 0 -> 46098 bytes .../Sirenix.Utilities.dll.mdb.meta | 8 + .../NoEmitAndNoEditor/Sirenix.Utilities.dll.meta | 80 + .../Sirenix.OdinInspector.Attributes.dll | Bin 0 -> 37888 bytes .../Sirenix.OdinInspector.Attributes.dll.mdb | Bin 0 -> 21517 bytes .../Sirenix.OdinInspector.Attributes.dll.mdb.meta | 8 + .../Sirenix.OdinInspector.Attributes.dll.meta | 47 + .../Sirenix.OdinInspector.Attributes.xml | 5690 ++++++++++ .../Sirenix.OdinInspector.Attributes.xml.meta | 8 + .../Assemblies/Sirenix.OdinInspector.Editor.dll | Bin 0 -> 1248256 bytes .../Sirenix.OdinInspector.Editor.dll.mdb | Bin 0 -> 348910 bytes .../Sirenix.OdinInspector.Editor.dll.mdb.meta | 8 + .../Sirenix.OdinInspector.Editor.dll.meta | 47 + .../Assemblies/Sirenix.OdinInspector.Editor.xml | 10843 +++++++++++++++++++ .../Sirenix.OdinInspector.Editor.xml.meta | 8 + .../Assemblies/Sirenix.Serialization.Config.dll | Bin 0 -> 19968 bytes .../Sirenix.Serialization.Config.dll.mdb | Bin 0 -> 1315 bytes .../Sirenix.Serialization.Config.dll.mdb.meta | 8 + .../Sirenix.Serialization.Config.dll.meta | 47 + .../Assemblies/Sirenix.Serialization.Config.xml | 202 + .../Sirenix.Serialization.Config.xml.meta | 8 + .../Sirenix/Assemblies/Sirenix.Serialization.dll | Bin 0 -> 370176 bytes .../Assemblies/Sirenix.Serialization.dll.mdb | Bin 0 -> 132068 bytes .../Assemblies/Sirenix.Serialization.dll.mdb.meta | 8 + .../Assemblies/Sirenix.Serialization.dll.meta | 47 + .../Assemblies/Sirenix.Utilities.Editor.dll | Bin 0 -> 531968 bytes .../Assemblies/Sirenix.Utilities.Editor.dll.mdb | Bin 0 -> 110541 bytes .../Sirenix.Utilities.Editor.dll.mdb.meta | 8 + .../Assemblies/Sirenix.Utilities.Editor.dll.meta | 47 + .../Assemblies/Sirenix.Utilities.Editor.xml | 7771 +++++++++++++ .../Assemblies/Sirenix.Utilities.Editor.xml.meta | 8 + .../Sirenix/Assemblies/Sirenix.Utilities.dll | Bin 0 -> 154624 bytes .../Sirenix/Assemblies/Sirenix.Utilities.dll.mdb | Bin 0 -> 48187 bytes .../Assemblies/Sirenix.Utilities.dll.mdb.meta | 8 + .../Sirenix/Assemblies/Sirenix.Utilities.dll.meta | 47 + .../Sirenix/Assemblies/Sirenix.Utilities.xml | 3734 +++++++ .../Sirenix/Assemblies/Sirenix.Utilities.xml.meta | 8 + Assets/Plugins/Sirenix/Assemblies/link.xml | 6 + Assets/Plugins/Sirenix/Assemblies/link.xml.meta | 7 + Assets/Plugins/Sirenix/Demos.meta | 9 + .../Demos/Custom Attribute Processors.unitypackage | Bin 0 -> 6686 bytes .../Custom Attribute Processors.unitypackage.meta | 8 + .../Sirenix/Demos/Custom Drawers.unitypackage | Bin 0 -> 13342 bytes .../Sirenix/Demos/Custom Drawers.unitypackage.meta | 8 + .../Sirenix/Demos/Editor Windows.unitypackage | Bin 0 -> 4995 bytes .../Sirenix/Demos/Editor Windows.unitypackage.meta | 8 + .../Sirenix/Demos/Sample - RPG Editor.unitypackage | Bin 0 -> 1005195 bytes .../Demos/Sample - RPG Editor.unitypackage.meta | 8 + Assets/Plugins/Sirenix/Odin Inspector.meta | 9 + Assets/Plugins/Sirenix/Odin Inspector/Assets.meta | 9 + .../Sirenix/Odin Inspector/Assets/Editor.meta | 9 + .../Assets/Editor/Odin Inspector Logo.png | Bin 0 -> 23267 bytes .../Assets/Editor/Odin Inspector Logo.png.meta | 57 + .../Assets/Editor/OdinPathLookup.asset | 13 + .../Assets/Editor/OdinPathLookup.asset.meta | 8 + Assets/Plugins/Sirenix/Odin Inspector/Config.meta | 8 + .../Sirenix/Odin Inspector/Config/Editor.meta | 8 + .../Config/Editor/GeneralDrawerConfig.asset | 14 + .../Config/Editor/GeneralDrawerConfig.asset.meta | 8 + .../Config/Editor/InspectorConfig.asset | 19 + .../Config/Editor/InspectorConfig.asset.meta | 8 + .../Config/Editor/OdinModuleConfig.asset | 17 + .../Config/Editor/OdinModuleConfig.asset.meta | 8 + .../Sirenix/Odin Inspector/Config/Resources.meta | 8 + .../Odin Inspector/Config/Resources/Sirenix.meta | 8 + .../Sirenix/GlobalSerializationConfig.asset | 22 + .../Sirenix/GlobalSerializationConfig.asset.meta | 8 + Assets/Plugins/Sirenix/Odin Inspector/Modules.meta | 9 + .../Odin Inspector/Modules/Unity.Entities.data | Bin 0 -> 41377 bytes .../Modules/Unity.Entities.data.meta | 8 + .../Odin Inspector/Modules/Unity.Mathematics.data | Bin 0 -> 46862 bytes .../Modules/Unity.Mathematics.data.meta | 8 + Assets/Plugins/Sirenix/Odin Inspector/Scripts.meta | 9 + .../Sirenix/Odin Inspector/Scripts/Editor.meta | 9 + .../Editor/AssemblyImportSettingsAutomation.cs | 134 + .../AssemblyImportSettingsAutomation.cs.meta | 12 + .../Scripts/Editor/BuildAOTAutomation.cs | 79 + .../Scripts/Editor/BuildAOTAutomation.cs.meta | 12 + .../Scripts/Editor/EnsureOdinInspectorDefine.cs | 121 + .../Editor/EnsureOdinInspectorDefine.cs.meta | 12 + .../Editor/FixBrokenUnityObjectWrapperDrawer.cs | 208 + .../FixBrokenUnityObjectWrapperDrawer.cs.meta | 12 + ....OdinInspector.CompatibilityLayer.Editor.asmdef | 13 + ...Inspector.CompatibilityLayer.Editor.asmdef.meta | 8 + .../Scripts/Editor/SyncListDrawer.cs | 88 + .../Scripts/Editor/SyncListDrawer.cs.meta | 12 + .../Scripts/Editor/SyncVarAttributeDrawer.cs | 42 + .../Scripts/Editor/SyncVarAttributeDrawer.cs.meta | 12 + .../Editor/Vector2IntMinMaxAttributeDrawer.cs | 73 + .../Editor/Vector2IntMinMaxAttributeDrawer.cs.meta | 12 + .../Scripts/Editor/VectorIntDrawers.cs | 141 + .../Scripts/Editor/VectorIntDrawers.cs.meta | 12 + .../Scripts/Editor/VectorIntPropertyResolvers.cs | 54 + .../Editor/VectorIntPropertyResolvers.cs.meta | 12 + .../Scripts/SerializedNetworkBehaviour.cs | 66 + .../Scripts/SerializedNetworkBehaviour.cs.meta | 12 + ...Sirenix.OdinInspector.CompatibilityLayer.asmdef | 11 + ...ix.OdinInspector.CompatibilityLayer.asmdef.meta | 8 + .../Odin Inspector/Scripts/VectorIntFormatters.cs | 80 + .../Scripts/VectorIntFormatters.cs.meta | 12 + Assets/Plugins/Sirenix/Readme.txt | 35 + Assets/Plugins/Sirenix/Readme.txt.meta | 8 + Assets/Prefabs/Characters/Saionji.prefab | 16 +- Assets/Scenes/Demo/SaionjiShowOff.unity | 33 +- Assets/Scripts/ApplicationMain.cs | 7 +- Assets/Scripts/Physics/PhysicsBall.cs | 23 +- Assets/Scripts/Physics/PhysicsBody.cs | 13 + Assets/Scripts/Physics/PhysicsBox.cs | 29 +- Assets/Scripts/Physics/PhysicsHelper.cs | 19 +- Assets/Scripts/Physics/PhysicsPrimitive.cs | 46 +- Assets/Scripts/Physics/PhysicsWorld.cs | 65 +- Assets/Scripts/Test/SaionjiScript.cs | 23 + Assets/ThirdParty/AdvancedInspector.meta | 5 - Assets/ThirdParty/VRM/MeshUtility.meta | 8 + Assets/ThirdParty/VRM/MeshUtility/CHANGELOG.md | 7 + .../ThirdParty/VRM/MeshUtility/CHANGELOG.md.meta | 7 + .../ThirdParty/VRM/MeshUtility/Documentation.meta | 8 + .../VRM/MeshUtility/Documentation/MeshUtility.md | 7 + .../MeshUtility/Documentation/MeshUtility.md.meta | 7 + .../VRM/MeshUtility/Documentation/images.meta | 8 + .../Documentation/images/blendshape_separator.jpg | Bin 0 -> 47176 bytes .../images/blendshape_separator.jpg.meta | 88 + .../Documentation/images/installation_1.jpg | Bin 0 -> 23760 bytes .../Documentation/images/installation_1.jpg.meta | 88 + .../Documentation/images/installation_2.jpg | Bin 0 -> 20387 bytes .../Documentation/images/installation_2.jpg.meta | 88 + .../Documentation/images/installation_3.jpg | Bin 0 -> 24575 bytes .../Documentation/images/installation_3.jpg.meta | 88 + .../Documentation/images/interface_1.jpg | Bin 0 -> 17973 bytes .../Documentation/images/interface_1.jpg.meta | 88 + .../Documentation/images/interface_2.jpg | Bin 0 -> 13868 bytes .../Documentation/images/interface_2.jpg.meta | 88 + .../Documentation/images/interface_3.jpg | Bin 0 -> 26061 bytes .../Documentation/images/interface_3.jpg.meta | 88 + .../MeshUtility/Documentation/images/result_1.jpg | Bin 0 -> 28604 bytes .../Documentation/images/result_1.jpg.meta | 88 + .../MeshUtility/Documentation/images/result_2.jpg | Bin 0 -> 21222 bytes .../Documentation/images/result_2.jpg.meta | 88 + .../VRM/MeshUtility/Documentation/notes.meta | 8 + .../Documentation/notes/MeshSeparator.md | 25 + .../Documentation/notes/MeshSeparator.md.meta | 7 + Assets/ThirdParty/VRM/MeshUtility/Editor.meta | 8 + .../VRM/MeshUtility/Editor/BoneMeshEraserWizard.cs | 200 + .../Editor/BoneMeshEraserWizard.cs.meta | 13 + .../VRM/MeshUtility/Editor/HumanoidEditor.cs | 324 + .../VRM/MeshUtility/Editor/HumanoidEditor.cs.meta | 11 + .../MeshUtility/Editor/MeshUtility.Editor.asmdef | 16 + .../Editor/MeshUtility.Editor.asmdef.meta | 7 + .../VRM/MeshUtility/Editor/MeshUtility.cs | 286 + .../VRM/MeshUtility/Editor/MeshUtility.cs.meta | 11 + Assets/ThirdParty/VRM/MeshUtility/LICENSE.md | 9 + Assets/ThirdParty/VRM/MeshUtility/LICENSE.md.meta | 7 + Assets/ThirdParty/VRM/MeshUtility/README.md | 58 + Assets/ThirdParty/VRM/MeshUtility/README.md.meta | 7 + Assets/ThirdParty/VRM/MeshUtility/README.url | 2 + Assets/ThirdParty/VRM/MeshUtility/README.url.meta | 7 + Assets/ThirdParty/VRM/MeshUtility/Runtime.meta | 8 + .../VRM/MeshUtility/Runtime/BindposeGizmo.cs | 158 + .../VRM/MeshUtility/Runtime/BindposeGizmo.cs.meta | 13 + .../VRM/MeshUtility/Runtime/BoneMeshEraser.cs | 166 + .../VRM/MeshUtility/Runtime/BoneMeshEraser.cs.meta | 13 + .../VRM/MeshUtility/Runtime/BoneNormalizer.cs | 507 + .../VRM/MeshUtility/Runtime/BoneNormalizer.cs.meta | 13 + .../ThirdParty/VRM/MeshUtility/Runtime/Humanoid.cs | 441 + .../VRM/MeshUtility/Runtime/Humanoid.cs.meta | 11 + .../VRM/MeshUtility/Runtime/HumanoidLoader.cs | 60 + .../VRM/MeshUtility/Runtime/HumanoidLoader.cs.meta | 11 + .../VRM/MeshUtility/Runtime/MeshExtensions.cs | 85 + .../VRM/MeshUtility/Runtime/MeshExtensions.cs.meta | 12 + .../MeshUtility/Runtime/MeshIntegrationResult.cs | 13 + .../Runtime/MeshIntegrationResult.cs.meta | 11 + .../VRM/MeshUtility/Runtime/MeshIntegrator.cs | 253 + .../VRM/MeshUtility/Runtime/MeshIntegrator.cs.meta | 3 + .../MeshUtility/Runtime/MeshIntegratorUtility.cs | 140 + .../Runtime/MeshIntegratorUtility.cs.meta | 3 + .../VRM/MeshUtility/Runtime/MeshUtility.asmdef | 3 + .../MeshUtility/Runtime/MeshUtility.asmdef.meta | 7 + .../VRM/MeshUtility/Runtime/UnityExtensions.cs | 319 + .../MeshUtility/Runtime/UnityExtensions.cs.meta | 11 + .../VRM/MeshUtility/Runtime/UnityPath.cs | 435 + .../VRM/MeshUtility/Runtime/UnityPath.cs.meta | 12 + Assets/ThirdParty/VRM/MeshUtility/package.json | 13 + .../ThirdParty/VRM/MeshUtility/package.json.meta | 7 + 514 files changed, 35411 insertions(+), 16776 deletions(-) delete mode 100644 Assets/Art/Sound.meta delete mode 100644 Assets/MeshUtility.meta delete mode 100644 Assets/MeshUtility/CHANGELOG.md delete mode 100644 Assets/MeshUtility/CHANGELOG.md.meta delete mode 100644 Assets/MeshUtility/Documentation.meta delete mode 100644 Assets/MeshUtility/Documentation/MeshUtility.md delete mode 100644 Assets/MeshUtility/Documentation/MeshUtility.md.meta delete mode 100644 Assets/MeshUtility/Documentation/images.meta delete mode 100644 Assets/MeshUtility/Documentation/images/blendshape_separator.jpg delete mode 100644 Assets/MeshUtility/Documentation/images/blendshape_separator.jpg.meta delete mode 100644 Assets/MeshUtility/Documentation/images/installation_1.jpg delete mode 100644 Assets/MeshUtility/Documentation/images/installation_1.jpg.meta delete mode 100644 Assets/MeshUtility/Documentation/images/installation_2.jpg delete mode 100644 Assets/MeshUtility/Documentation/images/installation_2.jpg.meta delete mode 100644 Assets/MeshUtility/Documentation/images/installation_3.jpg delete mode 100644 Assets/MeshUtility/Documentation/images/installation_3.jpg.meta delete mode 100644 Assets/MeshUtility/Documentation/images/interface_1.jpg delete mode 100644 Assets/MeshUtility/Documentation/images/interface_1.jpg.meta delete mode 100644 Assets/MeshUtility/Documentation/images/interface_2.jpg delete mode 100644 Assets/MeshUtility/Documentation/images/interface_2.jpg.meta delete mode 100644 Assets/MeshUtility/Documentation/images/interface_3.jpg delete mode 100644 Assets/MeshUtility/Documentation/images/interface_3.jpg.meta delete mode 100644 Assets/MeshUtility/Documentation/images/result_1.jpg delete mode 100644 Assets/MeshUtility/Documentation/images/result_1.jpg.meta delete mode 100644 Assets/MeshUtility/Documentation/images/result_2.jpg delete mode 100644 Assets/MeshUtility/Documentation/images/result_2.jpg.meta delete mode 100644 Assets/MeshUtility/Documentation/notes.meta delete mode 100644 Assets/MeshUtility/Documentation/notes/MeshSeparator.md delete mode 100644 Assets/MeshUtility/Documentation/notes/MeshSeparator.md.meta delete mode 100644 Assets/MeshUtility/Editor.meta delete mode 100644 Assets/MeshUtility/Editor/BoneMeshEraserWizard.cs delete mode 100644 Assets/MeshUtility/Editor/BoneMeshEraserWizard.cs.meta delete mode 100644 Assets/MeshUtility/Editor/HumanoidEditor.cs delete mode 100644 Assets/MeshUtility/Editor/HumanoidEditor.cs.meta delete mode 100644 Assets/MeshUtility/Editor/MeshUtility.Editor.asmdef delete mode 100644 Assets/MeshUtility/Editor/MeshUtility.Editor.asmdef.meta delete mode 100644 Assets/MeshUtility/Editor/MeshUtility.cs delete mode 100644 Assets/MeshUtility/Editor/MeshUtility.cs.meta delete mode 100644 Assets/MeshUtility/LICENSE.md delete mode 100644 Assets/MeshUtility/LICENSE.md.meta delete mode 100644 Assets/MeshUtility/README.md delete mode 100644 Assets/MeshUtility/README.md.meta delete mode 100644 Assets/MeshUtility/README.url delete mode 100644 Assets/MeshUtility/README.url.meta delete mode 100644 Assets/MeshUtility/Runtime.meta delete mode 100644 Assets/MeshUtility/Runtime/BindposeGizmo.cs delete mode 100644 Assets/MeshUtility/Runtime/BindposeGizmo.cs.meta delete mode 100644 Assets/MeshUtility/Runtime/BoneMeshEraser.cs delete mode 100644 Assets/MeshUtility/Runtime/BoneMeshEraser.cs.meta delete mode 100644 Assets/MeshUtility/Runtime/BoneNormalizer.cs delete mode 100644 Assets/MeshUtility/Runtime/BoneNormalizer.cs.meta delete mode 100644 Assets/MeshUtility/Runtime/Humanoid.cs delete mode 100644 Assets/MeshUtility/Runtime/Humanoid.cs.meta delete mode 100644 Assets/MeshUtility/Runtime/HumanoidLoader.cs delete mode 100644 Assets/MeshUtility/Runtime/HumanoidLoader.cs.meta delete mode 100644 Assets/MeshUtility/Runtime/MeshExtensions.cs delete mode 100644 Assets/MeshUtility/Runtime/MeshExtensions.cs.meta delete mode 100644 Assets/MeshUtility/Runtime/MeshIntegrationResult.cs delete mode 100644 Assets/MeshUtility/Runtime/MeshIntegrationResult.cs.meta delete mode 100644 Assets/MeshUtility/Runtime/MeshIntegrator.cs delete mode 100644 Assets/MeshUtility/Runtime/MeshIntegrator.cs.meta delete mode 100644 Assets/MeshUtility/Runtime/MeshIntegratorUtility.cs delete mode 100644 Assets/MeshUtility/Runtime/MeshIntegratorUtility.cs.meta delete mode 100644 Assets/MeshUtility/Runtime/MeshUtility.asmdef delete mode 100644 Assets/MeshUtility/Runtime/MeshUtility.asmdef.meta delete mode 100644 Assets/MeshUtility/Runtime/UnityExtensions.cs delete mode 100644 Assets/MeshUtility/Runtime/UnityExtensions.cs.meta delete mode 100644 Assets/MeshUtility/Runtime/UnityPath.cs delete mode 100644 Assets/MeshUtility/Runtime/UnityPath.cs.meta delete mode 100644 Assets/MeshUtility/package.json delete mode 100644 Assets/MeshUtility/package.json.meta delete mode 100644 Assets/Plugins/AdvancedInspector.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/AdvancedInspector.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/AdvancedInspector.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Angle.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Angle.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Background.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Background.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Bypass.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Bypass.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Collection.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Collection.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Constructor.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Constructor.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/CreateDerived.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/CreateDerived.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Descriptor.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Descriptor.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/DisplayAsParent.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/DisplayAsParent.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/DontAllowSceneObject.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/DontAllowSceneObject.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Enum.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Enum.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Expandable.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Expandable.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/FieldEditor.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/FieldEditor.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Group.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Group.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Help.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Help.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Inspect.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Inspect.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Method.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Method.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/NoPicker.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/NoPicker.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/RangeValue.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/RangeValue.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/ReadOnly.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/ReadOnly.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Restrict.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Restrict.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/RuntimeResolve.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/RuntimeResolve.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Space.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Space.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Style.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Style.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Tab.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Tab.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/TextField.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/TextField.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Title.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Title.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Toolbar.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Attributes/Toolbar.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Core.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Core/ActionBinding.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Core/ActionBinding.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Core/ComponentMonoBehaviour.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Core/ComponentMonoBehaviour.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Core/RangeFloat.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Core/RangeFloat.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Core/RangeInt.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Core/RangeInt.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Core/UDictionary.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Core/UDictionary.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Event.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Event/EventHandlers.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Event/EventHandlers.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Interface.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/ICopiable.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/ICopiable.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/ICopy.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/ICopy.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/IDataChanged.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/IDataChanged.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/IInspectorRunning.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/IInspectorRunning.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/IListAttribute.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/IListAttribute.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/IPreview.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/IPreview.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/IRuntimeAttribute.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Interface/IRuntimeAttribute.cs.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Utility.meta delete mode 100644 Assets/Plugins/AdvancedInspector/Utility/TypeUtility.cs delete mode 100644 Assets/Plugins/AdvancedInspector/Utility/TypeUtility.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.XML delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.XML.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.dll delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.dll.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.pdb delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.pdb.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/Examples.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/Examples/ExternalInspectorWindow.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/Examples/ExternalInspectorWindow.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/ExtraGUI.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUI.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUI.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUILayout.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUILayout.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/AnimationCurveEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/AnimationCurveEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BooleanEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BooleanEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BoundsEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BoundsEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/CharEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/CharEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ColorEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ColorEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/DateTimeEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/DateTimeEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/EnumEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/EnumEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/FloatEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/FloatEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GradientEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GradientEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GuidEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GuidEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/IntegerEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/IntegerEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/LayerMaskEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/LayerMaskEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/MonoEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/MonoEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ObjectEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ObjectEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/QuaternionEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/QuaternionEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RangeEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RangeEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RectEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RectEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraints2DEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraints2DEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraintsEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraintsEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/StringEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/StringEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/TimeSpanEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/TimeSpanEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/VectorEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/FieldEditors/VectorEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.XML delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.XML.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.dll delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.dll.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.pdb delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.pdb.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnchoredJoint2DEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnchoredJoint2DEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimatorEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimatorEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/BoxColliderEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/BoxColliderEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CameraEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CameraEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CapsuleColliderEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CapsuleColliderEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterControllerEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterControllerEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterJointEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterJointEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothRendererEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothRendererEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ColliderEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ColliderEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ConstantForceEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ConstantForceEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/FixedJointEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/FixedJointEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJoint2DEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJoint2DEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJointEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJointEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Joint2DEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Joint2DEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/JointEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/JointEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/LightEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/LightEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshColliderEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshColliderEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshFilterEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshFilterEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshRendererEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshRendererEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RendererEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RendererEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Rigidbody2DEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Rigidbody2DEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RigidbodyEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RigidbodyEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SkinnedMeshRendererEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SkinnedMeshRendererEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SphereColliderEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SphereColliderEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJoint2DEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJoint2DEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJointEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJointEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpriteRendererEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpriteRendererEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointAngleLimits2D.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointAngleLimits2D.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointDriveEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointDriveEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointLimitsEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointLimitsEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotor2DEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotor2DEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotorEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotorEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointSpringEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointSpringEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/SoftJointLimitEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/SoftJointLimitEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/WheelFrictionCurveEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/WheelFrictionCurveEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TerrainColliderEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TerrainColliderEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TextMeshEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TextMeshEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TransformEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TransformEditor.cs.meta delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/WheelColliderEditor.cs delete mode 100644 Assets/Plugins/Editor/AdvancedInspector/UnityTypes/WheelColliderEditor.cs.meta create mode 100644 Assets/Plugins/Sirenix.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEditor.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.mdb create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.mdb.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.mdb create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.mdb.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.mdb create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.mdb.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.mdb create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.mdb.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.mdb create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.mdb.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.mdb create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.mdb.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.mdb create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.mdb.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.mdb create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.mdb.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.mdb create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.mdb.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.mdb create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.mdb.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml create mode 100644 Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml.meta create mode 100644 Assets/Plugins/Sirenix/Assemblies/link.xml create mode 100644 Assets/Plugins/Sirenix/Assemblies/link.xml.meta create mode 100644 Assets/Plugins/Sirenix/Demos.meta create mode 100644 Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage create mode 100644 Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta create mode 100644 Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage create mode 100644 Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta create mode 100644 Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage create mode 100644 Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta create mode 100644 Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage create mode 100644 Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Assets.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Odin Inspector Logo.png create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Odin Inspector Logo.png.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config/Editor.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config/Resources.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Modules.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/AssemblyImportSettingsAutomation.cs create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/AssemblyImportSettingsAutomation.cs.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/BuildAOTAutomation.cs create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/BuildAOTAutomation.cs.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/EnsureOdinInspectorDefine.cs create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/EnsureOdinInspectorDefine.cs.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/FixBrokenUnityObjectWrapperDrawer.cs create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/FixBrokenUnityObjectWrapperDrawer.cs.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Sirenix.OdinInspector.CompatibilityLayer.Editor.asmdef create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Sirenix.OdinInspector.CompatibilityLayer.Editor.asmdef.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncListDrawer.cs create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncListDrawer.cs.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Vector2IntMinMaxAttributeDrawer.cs create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Vector2IntMinMaxAttributeDrawer.cs.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntDrawers.cs create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntDrawers.cs.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntPropertyResolvers.cs create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntPropertyResolvers.cs.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/SerializedNetworkBehaviour.cs create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/SerializedNetworkBehaviour.cs.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Sirenix.OdinInspector.CompatibilityLayer.asmdef create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/Sirenix.OdinInspector.CompatibilityLayer.asmdef.meta create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/VectorIntFormatters.cs create mode 100644 Assets/Plugins/Sirenix/Odin Inspector/Scripts/VectorIntFormatters.cs.meta create mode 100644 Assets/Plugins/Sirenix/Readme.txt create mode 100644 Assets/Plugins/Sirenix/Readme.txt.meta delete mode 100644 Assets/ThirdParty/AdvancedInspector.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/CHANGELOG.md create mode 100644 Assets/ThirdParty/VRM/MeshUtility/CHANGELOG.md.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/MeshUtility.md create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/MeshUtility.md.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/blendshape_separator.jpg create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/blendshape_separator.jpg.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_1.jpg create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_1.jpg.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_2.jpg create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_2.jpg.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_3.jpg create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_3.jpg.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_1.jpg create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_1.jpg.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_2.jpg create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_2.jpg.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_3.jpg create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_3.jpg.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_1.jpg create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_1.jpg.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_2.jpg create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_2.jpg.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/notes.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/notes/MeshSeparator.md create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Documentation/notes/MeshSeparator.md.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Editor.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Editor/BoneMeshEraserWizard.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Editor/BoneMeshEraserWizard.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Editor/HumanoidEditor.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Editor/HumanoidEditor.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.Editor.asmdef create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.Editor.asmdef.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/LICENSE.md create mode 100644 Assets/ThirdParty/VRM/MeshUtility/LICENSE.md.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/README.md create mode 100644 Assets/ThirdParty/VRM/MeshUtility/README.md.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/README.url create mode 100644 Assets/ThirdParty/VRM/MeshUtility/README.url.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/BindposeGizmo.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/BindposeGizmo.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneMeshEraser.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneMeshEraser.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneNormalizer.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneNormalizer.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/Humanoid.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/Humanoid.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/HumanoidLoader.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/HumanoidLoader.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshExtensions.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshExtensions.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrationResult.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrationResult.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrator.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrator.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegratorUtility.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegratorUtility.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshUtility.asmdef create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshUtility.asmdef.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityExtensions.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityExtensions.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityPath.cs create mode 100644 Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityPath.cs.meta create mode 100644 Assets/ThirdParty/VRM/MeshUtility/package.json create mode 100644 Assets/ThirdParty/VRM/MeshUtility/package.json.meta (limited to 'Assets') diff --git a/Assets/Art/Controllers/Old_AnimContro_Saionji.controller b/Assets/Art/Controllers/Old_AnimContro_Saionji.controller index 65d94615..bc316299 100644 --- a/Assets/Art/Controllers/Old_AnimContro_Saionji.controller +++ b/Assets/Art/Controllers/Old_AnimContro_Saionji.controller @@ -2361,4 +2361,4 @@ AnimatorStateMachine: m_EntryPosition: {x: 50, y: 120, z: 0} m_ExitPosition: {x: 612, y: 96, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} - m_DefaultState: {fileID: 1102748194168913198} + m_DefaultState: {fileID: 1102885414272778094} diff --git a/Assets/Art/Sound.meta b/Assets/Art/Sound.meta deleted file mode 100644 index 8ea43879..00000000 --- a/Assets/Art/Sound.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 27a9dc88d783408488dd40fcf72d2a62 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility.meta b/Assets/MeshUtility.meta deleted file mode 100644 index 28298acd..00000000 --- a/Assets/MeshUtility.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f11c20c3f50e40b4f8f6259f8e0886e0 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/CHANGELOG.md b/Assets/MeshUtility/CHANGELOG.md deleted file mode 100644 index 8e0827e1..00000000 --- a/Assets/MeshUtility/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# Changelog -All notable changes to this package will be documented in this file. - -## [0.0.1] - 2020-07-01 -### Added -- The first release of MeshUtility -- Add MeshSeparator: the mesh with BlendShape can be separated out \ No newline at end of file diff --git a/Assets/MeshUtility/CHANGELOG.md.meta b/Assets/MeshUtility/CHANGELOG.md.meta deleted file mode 100644 index fdcf1a9a..00000000 --- a/Assets/MeshUtility/CHANGELOG.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 988849cd155716d4f9c3a8f18a856470 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation.meta b/Assets/MeshUtility/Documentation.meta deleted file mode 100644 index 3a651bf6..00000000 --- a/Assets/MeshUtility/Documentation.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 42e2174ab737d474ebaee9d1c19b7934 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/MeshUtility.md b/Assets/MeshUtility/Documentation/MeshUtility.md deleted file mode 100644 index 0a111e70..00000000 --- a/Assets/MeshUtility/Documentation/MeshUtility.md +++ /dev/null @@ -1,7 +0,0 @@ -# MeshUtility - -A mesh processing package for mesh separation, etc. - -## Documentation Link - -[MeshSeparator](https://github.com/vrm-c/UniVRM/tree/master/Assets/MeshUtility/Documentation/notes/MeshSeparator.md) \ No newline at end of file diff --git a/Assets/MeshUtility/Documentation/MeshUtility.md.meta b/Assets/MeshUtility/Documentation/MeshUtility.md.meta deleted file mode 100644 index 3e93b85f..00000000 --- a/Assets/MeshUtility/Documentation/MeshUtility.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 43890cb851a34c5488d15e1a32e7dadc -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/images.meta b/Assets/MeshUtility/Documentation/images.meta deleted file mode 100644 index 82cf4db8..00000000 --- a/Assets/MeshUtility/Documentation/images.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 19a2e88b29a2db943aee731aafda8a84 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/images/blendshape_separator.jpg b/Assets/MeshUtility/Documentation/images/blendshape_separator.jpg deleted file mode 100644 index b28eb462..00000000 Binary files a/Assets/MeshUtility/Documentation/images/blendshape_separator.jpg and /dev/null differ diff --git a/Assets/MeshUtility/Documentation/images/blendshape_separator.jpg.meta b/Assets/MeshUtility/Documentation/images/blendshape_separator.jpg.meta deleted file mode 100644 index b013c05f..00000000 --- a/Assets/MeshUtility/Documentation/images/blendshape_separator.jpg.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: a9a09bb093d309947958f67bfe21e095 -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - 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: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - 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: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/images/installation_1.jpg b/Assets/MeshUtility/Documentation/images/installation_1.jpg deleted file mode 100644 index bd916403..00000000 Binary files a/Assets/MeshUtility/Documentation/images/installation_1.jpg and /dev/null differ diff --git a/Assets/MeshUtility/Documentation/images/installation_1.jpg.meta b/Assets/MeshUtility/Documentation/images/installation_1.jpg.meta deleted file mode 100644 index fcd26b64..00000000 --- a/Assets/MeshUtility/Documentation/images/installation_1.jpg.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: b3d26d2cfebad4b43a904c4a9978fadf -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - 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: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - 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: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/images/installation_2.jpg b/Assets/MeshUtility/Documentation/images/installation_2.jpg deleted file mode 100644 index e31b7ec9..00000000 Binary files a/Assets/MeshUtility/Documentation/images/installation_2.jpg and /dev/null differ diff --git a/Assets/MeshUtility/Documentation/images/installation_2.jpg.meta b/Assets/MeshUtility/Documentation/images/installation_2.jpg.meta deleted file mode 100644 index 26b42b79..00000000 --- a/Assets/MeshUtility/Documentation/images/installation_2.jpg.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: 323176881f04b704bad2644d21ce914a -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - 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: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - 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: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/images/installation_3.jpg b/Assets/MeshUtility/Documentation/images/installation_3.jpg deleted file mode 100644 index 5d0aaed2..00000000 Binary files a/Assets/MeshUtility/Documentation/images/installation_3.jpg and /dev/null differ diff --git a/Assets/MeshUtility/Documentation/images/installation_3.jpg.meta b/Assets/MeshUtility/Documentation/images/installation_3.jpg.meta deleted file mode 100644 index f3b98799..00000000 --- a/Assets/MeshUtility/Documentation/images/installation_3.jpg.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: e9dd20fb6b4bcb146b40e8f729725fa9 -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - 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: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - 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: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/images/interface_1.jpg b/Assets/MeshUtility/Documentation/images/interface_1.jpg deleted file mode 100644 index eec170ec..00000000 Binary files a/Assets/MeshUtility/Documentation/images/interface_1.jpg and /dev/null differ diff --git a/Assets/MeshUtility/Documentation/images/interface_1.jpg.meta b/Assets/MeshUtility/Documentation/images/interface_1.jpg.meta deleted file mode 100644 index ea056784..00000000 --- a/Assets/MeshUtility/Documentation/images/interface_1.jpg.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: 1ddbc5d5bb1796c4ab3ccdd5d0c29aa7 -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - 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: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - 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: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/images/interface_2.jpg b/Assets/MeshUtility/Documentation/images/interface_2.jpg deleted file mode 100644 index 98adf2b9..00000000 Binary files a/Assets/MeshUtility/Documentation/images/interface_2.jpg and /dev/null differ diff --git a/Assets/MeshUtility/Documentation/images/interface_2.jpg.meta b/Assets/MeshUtility/Documentation/images/interface_2.jpg.meta deleted file mode 100644 index 8754427e..00000000 --- a/Assets/MeshUtility/Documentation/images/interface_2.jpg.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: 23c78259991e1cf49a88e110cd18e0ed -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - 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: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - 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: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/images/interface_3.jpg b/Assets/MeshUtility/Documentation/images/interface_3.jpg deleted file mode 100644 index e9d52bf4..00000000 Binary files a/Assets/MeshUtility/Documentation/images/interface_3.jpg and /dev/null differ diff --git a/Assets/MeshUtility/Documentation/images/interface_3.jpg.meta b/Assets/MeshUtility/Documentation/images/interface_3.jpg.meta deleted file mode 100644 index 4dc7751a..00000000 --- a/Assets/MeshUtility/Documentation/images/interface_3.jpg.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: c6bc8b3735742bd439c4f5eee478cc1a -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - 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: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - 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: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/images/result_1.jpg b/Assets/MeshUtility/Documentation/images/result_1.jpg deleted file mode 100644 index 65d704cd..00000000 Binary files a/Assets/MeshUtility/Documentation/images/result_1.jpg and /dev/null differ diff --git a/Assets/MeshUtility/Documentation/images/result_1.jpg.meta b/Assets/MeshUtility/Documentation/images/result_1.jpg.meta deleted file mode 100644 index 03db4542..00000000 --- a/Assets/MeshUtility/Documentation/images/result_1.jpg.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: 1be7c06f1e0cc2a448ad9166891d03dd -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - 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: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - 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: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/images/result_2.jpg b/Assets/MeshUtility/Documentation/images/result_2.jpg deleted file mode 100644 index 951347ea..00000000 Binary files a/Assets/MeshUtility/Documentation/images/result_2.jpg and /dev/null differ diff --git a/Assets/MeshUtility/Documentation/images/result_2.jpg.meta b/Assets/MeshUtility/Documentation/images/result_2.jpg.meta deleted file mode 100644 index 20249090..00000000 --- a/Assets/MeshUtility/Documentation/images/result_2.jpg.meta +++ /dev/null @@ -1,88 +0,0 @@ -fileFormatVersion: 2 -guid: d2fa21619ba10b043a82f64ccca30878 -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 9 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - 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: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - 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: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - singleChannelComponent: 0 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - serializedVersion: 2 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: - vertices: [] - indices: - edges: [] - weights: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/notes.meta b/Assets/MeshUtility/Documentation/notes.meta deleted file mode 100644 index 72f20c27..00000000 --- a/Assets/MeshUtility/Documentation/notes.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ea010ddf8bf34de4fb36d95afb078702 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Documentation/notes/MeshSeparator.md b/Assets/MeshUtility/Documentation/notes/MeshSeparator.md deleted file mode 100644 index da93e7d9..00000000 --- a/Assets/MeshUtility/Documentation/notes/MeshSeparator.md +++ /dev/null @@ -1,25 +0,0 @@ -# MeshSeparator - -MeshSeparator provides a functionality of separating meshes contained BlendShape. Simply select a GameObject with skinned Meshes and click processing. The mesh splitting results are generated in the Assets folder. The model with sparse BlendShape data distributed in a large-volume mesh can be benefited from size reduction and performance improvements after mesh separation. - -## How to use - -Select a GameObject contained skinned mesh and BlendShape: - - - -Select `Mesh Utility` -> `MeshSeparator`: - - - -The separate meshes are saved in the Assets folder. GameObjects with separate meshes are also available in the Hierarchy Window: - - - -In this example, the model's mesh are split into two parts: face and body: - -Face: with BlendShape | Body: without BlendShape -:-------------------------:|:-------------------------: - | - -Note that if all the polygons of a mesh are used by BlendShape, MeshSeparator will not perform mesh separation. \ No newline at end of file diff --git a/Assets/MeshUtility/Documentation/notes/MeshSeparator.md.meta b/Assets/MeshUtility/Documentation/notes/MeshSeparator.md.meta deleted file mode 100644 index 13d9f1f9..00000000 --- a/Assets/MeshUtility/Documentation/notes/MeshSeparator.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ad5ca4fe4bdde854bb90cb5a3aa267d4 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Editor.meta b/Assets/MeshUtility/Editor.meta deleted file mode 100644 index 9c63441d..00000000 --- a/Assets/MeshUtility/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1e0d906064b5cad4394c89ec960a887e -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Editor/BoneMeshEraserWizard.cs b/Assets/MeshUtility/Editor/BoneMeshEraserWizard.cs deleted file mode 100644 index 63bf9045..00000000 --- a/Assets/MeshUtility/Editor/BoneMeshEraserWizard.cs +++ /dev/null @@ -1,200 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using UnityEditor; -using UnityEngine; - - -namespace MeshUtility -{ - [CustomPropertyDrawer(typeof(BoneMeshEraser.EraseBone))] - public class EraseBoneDrawer : PropertyDrawer - { - public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) - { - //EditorGUI.BeginProperty(position, label, property); - - var leftWidth = 0.6f; - var rightWidth = 1.0f - leftWidth; - - var leftSide = new Rect(position.x, position.y, position.width * leftWidth, position.height); - var rightSide = new Rect(position.width * leftWidth, position.y, position.width * rightWidth, position.height); - { - EditorGUI.PropertyField(leftSide, property.FindPropertyRelative("Bone"), new GUIContent("", "")); - EditorGUI.PropertyField(rightSide, property.FindPropertyRelative("Erase")); - } - - //EditorGUI.EndProperty(); - } - - public override float GetPropertyHeight(SerializedProperty property, GUIContent label) - { - var height = base.GetPropertyHeight(property, label); - return height; - } - } - - public class BoneMeshEraserWizard : ScriptableWizard - { - const string ASSET_SUFFIX = ".asset"; - - [SerializeField] - SkinnedMeshRenderer m_skinnedMesh; - - [SerializeField] - Animator m_animator; - - [SerializeField] - Transform EraseRoot; - - [SerializeField] - BoneMeshEraser.EraseBone[] m_eraseBones; - - [MenuItem(MeshUtility.MENU_PARENT + "BoneMeshEraser Wizard", priority = 4)] - static void CreateWizard() - { - ScriptableWizard.DisplayWizard("BoneMeshEraser", "Erase triangles by bone", "Erase"); - } - - private void OnEnable() - { - var root = Selection.activeGameObject; - if (root != null) - { - m_animator = root.GetComponent(); - m_skinnedMesh = root.GetComponent(); - OnValidate(); - } - } - - void OnValidate() - { - //Debug.Log("OnValidate"); - if (m_skinnedMesh == null) - { - m_eraseBones = new BoneMeshEraser.EraseBone[] { }; - return; - } - - if (EraseRoot == null) - { - if (m_animator != null) - { - EraseRoot = m_animator.GetBoneTransform(HumanBodyBones.Head); - //Debug.LogFormat("head: {0}", EraseRoot); - } - } - - m_eraseBones = m_skinnedMesh.bones.Select(x => - { - var eb = new BoneMeshEraser.EraseBone - { - Bone = x, - }; - - if (EraseRoot != null) - { - // 首の子孫を消去 - if (eb.Bone.Ancestor().Any(y => y == EraseRoot)) - { - //Debug.LogFormat("erase {0}", x); - eb.Erase = true; - } - } - - return eb; - }) - .ToArray(); - } - - void OnWizardUpdate() - { - helpString = "select target skinnedMesh and animator"; - } - - - - static int IndexOf(Transform[] list, Transform target) - { - for (int i = 0; i < list.Length; ++i) - { - if (list[i] == target) - { - return i; - } - } - return -1; - } - - SkinnedMeshRenderer _Erase(GameObject go) - { - if (go == null) - { - Debug.LogWarning("select root object in hierarchy"); - return null; - } - if (m_skinnedMesh == null) - { - Debug.LogWarning("no skinnedmesh"); - return null; - } - - var bones = m_skinnedMesh.bones; - var eraseBones = m_eraseBones - .Where(x => x.Erase) - .Select(x => Array.IndexOf(bones, x.Bone)) - .ToArray(); - - var meshNode = new GameObject("BoneMeshEraser"); - meshNode.transform.SetParent(go.transform, false); - - var erased = meshNode.AddComponent(); - erased.sharedMesh = BoneMeshEraser.CreateErasedMesh(m_skinnedMesh.sharedMesh, eraseBones); - erased.sharedMaterials = m_skinnedMesh.sharedMaterials; - erased.bones = m_skinnedMesh.bones; - - return erased; - } - - void Erase() - { - var go = Selection.activeGameObject; - var renderer = _Erase(go); - if (renderer == null) - { - return; - } - - // save mesh to Assets - var assetPath = string.Format("{0}{1}", go.name, ASSET_SUFFIX); - var prefab = MeshUtility.GetPrefab(go); - if (prefab != null) - { - var prefabPath = AssetDatabase.GetAssetPath(prefab); - assetPath = string.Format("{0}/{1}{2}", - Path.GetDirectoryName(prefabPath), - Path.GetFileNameWithoutExtension(prefabPath), - ASSET_SUFFIX - ); - } - - Debug.LogFormat("CreateAsset: {0}", assetPath); - AssetDatabase.CreateAsset(renderer.sharedMesh, assetPath); - } - - void OnWizardCreate() - { - //Debug.Log("OnWizardCreate"); - Erase(); - - // close - } - - void OnWizardOtherButton() - { - //Debug.Log("OnWizardOtherButton"); - Erase(); - } - } -} diff --git a/Assets/MeshUtility/Editor/BoneMeshEraserWizard.cs.meta b/Assets/MeshUtility/Editor/BoneMeshEraserWizard.cs.meta deleted file mode 100644 index ef9f3976..00000000 --- a/Assets/MeshUtility/Editor/BoneMeshEraserWizard.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 881b00db73f639c48a3f043a775fa61a -timeCreated: 1518503829 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Editor/HumanoidEditor.cs b/Assets/MeshUtility/Editor/HumanoidEditor.cs deleted file mode 100644 index f9a99cfc..00000000 --- a/Assets/MeshUtility/Editor/HumanoidEditor.cs +++ /dev/null @@ -1,324 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.IO; -using UnityEditor; -using UnityEngine; -using System; - -namespace MeshUtility -{ - [CustomEditor(typeof(Humanoid))] - public class HumanoidEditor : Editor - { - const int LABEL_WIDTH = 100; - - Humanoid m_target; - - SerializedProperty m_Hips; - #region leg - SerializedProperty m_LeftUpperLeg; - SerializedProperty m_RightUpperLeg; - SerializedProperty m_LeftLowerLeg; - SerializedProperty m_RightLowerLeg; - SerializedProperty m_LeftFoot; - SerializedProperty m_RightFoot; - SerializedProperty m_LeftToes; - SerializedProperty m_RightToes; - - #endregion - - #region spine - SerializedProperty m_Spine; - SerializedProperty m_Chest; - SerializedProperty m_UpperChest; - SerializedProperty m_Neck; - SerializedProperty m_Head; - SerializedProperty m_LeftEye; - SerializedProperty m_RightEye; - SerializedProperty m_Jaw; - - #endregion - - #region arm - SerializedProperty m_LeftShoulder; - SerializedProperty m_RightShoulder; - SerializedProperty m_LeftUpperArm; - SerializedProperty m_RightUpperArm; - SerializedProperty m_LeftLowerArm; - SerializedProperty m_RightLowerArm; - SerializedProperty m_LeftHand; - SerializedProperty m_RightHand; - - #endregion - - #region fingers - SerializedProperty m_LeftThumbProximal; - SerializedProperty m_LeftThumbIntermediate; - SerializedProperty m_LeftThumbDistal; - SerializedProperty m_LeftIndexProximal; - SerializedProperty m_LeftIndexIntermediate; - SerializedProperty m_LeftIndexDistal; - SerializedProperty m_LeftMiddleProximal; - SerializedProperty m_LeftMiddleIntermediate; - SerializedProperty m_LeftMiddleDistal; - SerializedProperty m_LeftRingProximal; - SerializedProperty m_LeftRingIntermediate; - SerializedProperty m_LeftRingDistal; - SerializedProperty m_LeftLittleProximal; - SerializedProperty m_LeftLittleIntermediate; - SerializedProperty m_LeftLittleDistal; - SerializedProperty m_RightThumbProximal; - SerializedProperty m_RightThumbIntermediate; - SerializedProperty m_RightThumbDistal; - SerializedProperty m_RightIndexProximal; - SerializedProperty m_RightIndexIntermediate; - SerializedProperty m_RightIndexDistal; - SerializedProperty m_RightMiddleProximal; - SerializedProperty m_RightMiddleIntermediate; - SerializedProperty m_RightMiddleDistal; - SerializedProperty m_RightRingProximal; - SerializedProperty m_RightRingIntermediate; - SerializedProperty m_RightRingDistal; - SerializedProperty m_RightLittleProximal; - SerializedProperty m_RightLittleIntermediate; - SerializedProperty m_RightLittleDistal; - - #endregion - - void OnEnable() - { - m_target = target as Humanoid; - m_Hips = serializedObject.FindProperty($"m_{nameof(Humanoid.Hips)}"); - - #region legs - m_LeftUpperLeg = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftUpperLeg)}"); - m_RightUpperLeg = serializedObject.FindProperty($"m_{nameof(Humanoid.RightUpperLeg)}"); - m_LeftLowerLeg = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftLowerLeg)}"); - m_RightLowerLeg = serializedObject.FindProperty($"m_{nameof(Humanoid.RightLowerLeg)}"); - m_LeftFoot = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftFoot)}"); - m_RightFoot = serializedObject.FindProperty($"m_{nameof(Humanoid.RightFoot)}"); - m_LeftToes = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftToes)}"); - m_RightToes = serializedObject.FindProperty($"m_{nameof(Humanoid.RightToes)}"); - #endregion - - #region spine - m_Spine = serializedObject.FindProperty($"m_{nameof(Humanoid.Spine)}"); - m_Chest = serializedObject.FindProperty($"m_{nameof(Humanoid.Chest)}"); - m_UpperChest = serializedObject.FindProperty($"m_{nameof(Humanoid.UpperChest)}"); - m_Neck = serializedObject.FindProperty($"m_{nameof(Humanoid.Neck)}"); - m_Head = serializedObject.FindProperty($"m_{nameof(Humanoid.Head)}"); - m_LeftEye = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftEye)}"); - m_RightEye = serializedObject.FindProperty($"m_{nameof(Humanoid.RightEye)}"); - m_Jaw = serializedObject.FindProperty($"m_{nameof(Humanoid.Jaw)}"); - - #endregion - - #region arm - m_LeftShoulder = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftShoulder)}"); - m_RightShoulder = serializedObject.FindProperty($"m_{nameof(Humanoid.RightShoulder)}"); - m_LeftUpperArm = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftUpperArm)}"); - m_RightUpperArm = serializedObject.FindProperty($"m_{nameof(Humanoid.RightUpperArm)}"); - m_LeftLowerArm = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftLowerArm)}"); - m_RightLowerArm = serializedObject.FindProperty($"m_{nameof(Humanoid.RightLowerArm)}"); - m_LeftHand = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftHand)}"); - m_RightHand = serializedObject.FindProperty($"m_{nameof(Humanoid.RightHand)}"); - - #endregion - - #region fingers - m_LeftThumbProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftThumbProximal)}"); - m_LeftThumbIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftThumbIntermediate)}"); - m_LeftThumbDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftThumbDistal)}"); - m_LeftIndexProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftIndexProximal)}"); - m_LeftIndexIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftIndexIntermediate)}"); - m_LeftIndexDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftIndexDistal)}"); - m_LeftMiddleProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftMiddleProximal)}"); - m_LeftMiddleIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftMiddleIntermediate)}"); - m_LeftMiddleDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftMiddleDistal)}"); - m_LeftRingProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftRingProximal)}"); - m_LeftRingIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftRingIntermediate)}"); - m_LeftRingDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftRingDistal)}"); - m_LeftLittleProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftLittleProximal)}"); - m_LeftLittleIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftLittleIntermediate)}"); - m_LeftLittleDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftLittleDistal)}"); - m_RightThumbProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightThumbProximal)}"); - m_RightThumbIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.RightThumbIntermediate)}"); - m_RightThumbDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightThumbDistal)}"); - m_RightIndexProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightIndexProximal)}"); - m_RightIndexIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.RightIndexIntermediate)}"); - m_RightIndexDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightIndexDistal)}"); - m_RightMiddleProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightMiddleProximal)}"); - m_RightMiddleIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.RightMiddleIntermediate)}"); - m_RightMiddleDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightMiddleDistal)}"); - m_RightRingProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightRingProximal)}"); - m_RightRingIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.RightRingIntermediate)}"); - m_RightRingDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightRingDistal)}"); - m_RightLittleProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightLittleProximal)}"); - m_RightLittleIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.RightLittleIntermediate)}"); - m_RightLittleDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightLittleDistal)}"); - #endregion - } - - struct Horizontal : IDisposable - { - public static Horizontal Using() - { - EditorGUILayout.BeginHorizontal(); - return default; - } - public void Dispose() - { - EditorGUILayout.EndHorizontal(); - } - } - - static void HorizontalFields(string label, params SerializedProperty[] props) - { - try - { - EditorGUILayout.BeginHorizontal(); - - GUILayout.Label(label, GUILayout.Width(LABEL_WIDTH)); - GUILayout.FlexibleSpace(); - - foreach (var prop in props) - { - EditorGUILayout.PropertyField(prop, GUIContent.none, true, GUILayout.MinWidth(100)); - } - } - finally - { - EditorGUILayout.EndHorizontal(); - } - } - - static bool s_spineFold; - static bool s_legFold; - static bool s_armFold; - static bool s_fingerFold; - static string GetDialogDir(UnityEngine.Object obj) - { - var prefab = PrefabUtility.GetCorrespondingObjectFromSource(obj); - if (prefab == null) - { - return null; - } - return UnityPath.FromAsset(prefab).FullPath; - } - - public override void OnInspectorGUI() - { - foreach (var validation in m_target.Validate()) - { - EditorGUILayout.HelpBox(validation.Message, validation.IsError ? MessageType.Error : MessageType.Warning); - } - - // prefer - serializedObject.Update(); - - EditorGUILayout.PropertyField(m_Hips); - - s_spineFold = EditorGUILayout.Foldout(s_spineFold, "Body"); - if (s_spineFold) - { - EditorGUILayout.PropertyField(m_Spine); - EditorGUILayout.PropertyField(m_Chest); - EditorGUILayout.PropertyField(m_UpperChest); - EditorGUILayout.PropertyField(m_Neck); - EditorGUILayout.PropertyField(m_Head); - EditorGUILayout.PropertyField(m_Jaw); - HorizontalFields("Eye", m_LeftEye, m_RightEye); - } - - s_legFold = EditorGUILayout.Foldout(s_legFold, "Leg"); - if (s_legFold) - { - HorizontalFields("UpperLeg", m_LeftUpperLeg, m_RightUpperLeg); - HorizontalFields("LowerLeg", m_LeftLowerLeg, m_RightLowerLeg); - HorizontalFields("Foot", m_LeftFoot, m_RightFoot); - HorizontalFields("Toes", m_LeftToes, m_RightToes); - } - - s_armFold = EditorGUILayout.Foldout(s_armFold, "Arm"); - if (s_armFold) - { - HorizontalFields("Shoulder", m_LeftShoulder, m_RightShoulder); - HorizontalFields("UpperArm", m_LeftUpperArm, m_RightUpperArm); - HorizontalFields("LowerArm", m_LeftLowerArm, m_RightLowerArm); - HorizontalFields("Hand", m_LeftHand, m_RightHand); - } - - s_fingerFold = EditorGUILayout.Foldout(s_fingerFold, "Finger"); - if (s_fingerFold) - { - HorizontalFields("LeftThumb", m_LeftThumbProximal, m_LeftThumbIntermediate, m_LeftThumbDistal); - HorizontalFields("LeftIndex", m_LeftIndexProximal, m_LeftIndexIntermediate, m_LeftIndexDistal); - HorizontalFields("LeftMiddle", m_LeftMiddleProximal, m_LeftMiddleIntermediate, m_LeftMiddleDistal); - HorizontalFields("LeftRing", m_LeftRingProximal, m_LeftRingIntermediate, m_LeftRingDistal); - HorizontalFields("LeftLittle", m_LeftLittleProximal, m_LeftLittleIntermediate, m_LeftLittleDistal); - HorizontalFields("RightThumb", m_RightThumbProximal, m_RightThumbIntermediate, m_RightThumbDistal); - HorizontalFields("RightIndex", m_RightIndexProximal, m_RightIndexIntermediate, m_RightIndexDistal); - HorizontalFields("RightMiddle", m_RightMiddleProximal, m_RightMiddleIntermediate, m_RightMiddleDistal); - HorizontalFields("RightRing", m_RightRingProximal, m_RightRingIntermediate, m_RightRingDistal); - HorizontalFields("RightLittle", m_RightLittleProximal, m_RightLittleIntermediate, m_RightLittleDistal); - } - - serializedObject.ApplyModifiedProperties(); - - // create avatar - if (GUILayout.Button("Create UnityEngine.Avatar")) - { - var path = EditorUtility.SaveFilePanel( - "Save avatar", - GetDialogDir(m_target), - string.Format("{0}.avatar.asset", serializedObject.targetObject.name), - "asset"); - if (!string.IsNullOrEmpty(path)) - { - var avatar = m_target.CreateAvatar(); - if (avatar != null) - { - var unityPath = UnityPath.FromFullpath(path); - avatar.name = "avatar"; - Debug.LogFormat("Create avatar {0}", unityPath); - AssetDatabase.CreateAsset(avatar, unityPath.Value); - AssetDatabase.ImportAsset(unityPath.Value); - - // replace - var animator = m_target.GetComponent(); - if (animator == null) - { - animator = m_target.gameObject.AddComponent(); - } - animator.avatar = avatar; - - Selection.activeObject = avatar; - } - } - } - } - - void OnSceneGUI() - { - // var bones = m_target.Bones; - // if (bones != null) - // { - // for (int i = 0; i < bones.Length; ++i) - // { - // DrawBone((HumanBodyBones)i, bones[i]); - // } - // foreach (var x in m_bones) - // { - // x.Draw(); - // } - // } - - var forward = m_target.GetForward(); - - var begin = m_target.transform.position; - var end = begin + forward; - Handles.DrawLine(begin, end); - } - } -} diff --git a/Assets/MeshUtility/Editor/HumanoidEditor.cs.meta b/Assets/MeshUtility/Editor/HumanoidEditor.cs.meta deleted file mode 100644 index dffaaa18..00000000 --- a/Assets/MeshUtility/Editor/HumanoidEditor.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 57cc7b16eb4146c4ab5631f538e2489f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Editor/MeshUtility.Editor.asmdef b/Assets/MeshUtility/Editor/MeshUtility.Editor.asmdef deleted file mode 100644 index 9854cd8f..00000000 --- a/Assets/MeshUtility/Editor/MeshUtility.Editor.asmdef +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "MeshUtility.Editor", - "references": [ - "MeshUtility" - ], - "optionalUnityReferences": [], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [] -} \ No newline at end of file diff --git a/Assets/MeshUtility/Editor/MeshUtility.Editor.asmdef.meta b/Assets/MeshUtility/Editor/MeshUtility.Editor.asmdef.meta deleted file mode 100644 index ad84160c..00000000 --- a/Assets/MeshUtility/Editor/MeshUtility.Editor.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: eedb868807606df4db953419ab9e0780 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Editor/MeshUtility.cs b/Assets/MeshUtility/Editor/MeshUtility.cs deleted file mode 100644 index 045879c6..00000000 --- a/Assets/MeshUtility/Editor/MeshUtility.cs +++ /dev/null @@ -1,286 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; -using UnityEngine; -using UnityEditor; - -namespace MeshUtility -{ - public class MeshUtility - { - public const string MENU_PARENT = "Mesh Utility/"; - public const int MENU_PRIORITY = 11; - - private const string ASSET_SUFFIX = ".mesh.asset"; - private const string MENU_NAME = MENU_PARENT + "MeshSeparator"; - private static readonly Vector3 ZERO_MOVEMENT = Vector3.zero; - - public static Object GetPrefab(GameObject instance) - { -#if UNITY_2018_2_OR_NEWER - return PrefabUtility.GetCorrespondingObjectFromSource(instance); -#else - return PrefabUtility.GetPrefabParent(go); -#endif - } - - private enum BlendShapeLogic - { - WithBlendShape, - WithoutBlendShape, - } - - [MenuItem(MENU_NAME, validate = true)] - private static bool ShowLogValidation() - { - if (Selection.activeTransform == null) - return false; - else - return true; - } - - [MenuItem(MENU_NAME, priority = 2)] - public static void SeparateSkinnedMeshContainedBlendShape() - { - var go = Selection.activeTransform.gameObject; - - if (go.GetComponentsInChildren().Length > 0) - { - SeparationProcessing(go); - go.SetActive(false); - } - else - { - EditorUtility.DisplayDialog("Error", "No skinnedMeshRenderer contained", "ok"); - } - } - - [MenuItem("Mesh Utility/MeshSeparator Docs", priority = MeshUtility.MENU_PRIORITY)] - public static void LinkToMeshSeparatorDocs() - { - Application.OpenURL("https://github.com/vrm-c/UniVRM/tree/master/Assets/MeshUtility"); - } - - private static void SeparationProcessing(GameObject go) - { - var outputObject = GameObject.Instantiate(go); - var skinnedMeshRenderers = outputObject.GetComponentsInChildren(); - foreach (var skinnedMeshRenderer in skinnedMeshRenderers) - { - if (skinnedMeshRenderer.sharedMesh.blendShapeCount > 0) - { - SeparatePolyWithBlendShape(skinnedMeshRenderer); - } - } - } - - private static void SeparatePolyWithBlendShape(SkinnedMeshRenderer skinnedMeshRendererInput) - { - var indicesUsedByBlendShape = new Dictionary(); - var mesh = skinnedMeshRendererInput.sharedMesh; - - // retrieve the original BlendShape data - for (int i = 0; i < mesh.blendShapeCount; ++i) - { - var deltaVertices = new Vector3[mesh.vertexCount]; - var deltaNormals = new Vector3[mesh.vertexCount]; - var deltaTangents = new Vector3[mesh.vertexCount]; - mesh.GetBlendShapeFrameVertices(i, 0, deltaVertices, deltaNormals, deltaTangents); - - for (int j = 0; j < deltaVertices.Length; j++) - { - if (!deltaVertices[j].Equals(ZERO_MOVEMENT)) - { - if (!indicesUsedByBlendShape.Values.Contains(j)) - { - indicesUsedByBlendShape.Add(indicesUsedByBlendShape.Count, j); - } - } - } - } - - var subMeshCount = mesh.subMeshCount; - var submeshesWithBlendShape = new Dictionary(); - var submeshesWithoutBlendShape = new Dictionary(); - var vertexIndexWithBlendShape = new Dictionary(); - var vertexCounterWithBlendShape = 0; - var vertexIndexWithoutBlendShape = new Dictionary(); - var vertexCounterWithoutBlendShape = 0; - - // check blendshape's vertex index from submesh - for (int i = 0; i < subMeshCount; i++) - { - var triangle = mesh.GetTriangles(i); - var submeshWithBlendShape = new List(); - var submeshWithoutBlendShape = new List(); - - for (int j = 0; j < triangle.Length; j += 3) - { - if (indicesUsedByBlendShape.Values.Contains(triangle[j]) || - indicesUsedByBlendShape.Values.Contains(triangle[j + 1]) || - indicesUsedByBlendShape.Values.Contains(triangle[j + 2])) - { - BuildNewTriangleList(vertexIndexWithBlendShape, triangle, j, submeshWithBlendShape, ref vertexCounterWithBlendShape); - } - else - { - BuildNewTriangleList(vertexIndexWithoutBlendShape, triangle, j, submeshWithoutBlendShape, ref vertexCounterWithoutBlendShape); - } - } - if (submeshWithBlendShape.Count > 0) - submeshesWithBlendShape.Add(i, submeshWithBlendShape.ToArray()); - if (submeshWithoutBlendShape.Count > 0) - submeshesWithoutBlendShape.Add(i, submeshWithoutBlendShape.ToArray()); ; - } - - // check if any BlendShape exists - if (submeshesWithoutBlendShape.Count > 0) - { - // put the mesh without BlendShape in a new SkinnedMeshRenderer - var srcGameObject = skinnedMeshRendererInput.gameObject; - var srcTransform = skinnedMeshRendererInput.transform.parent; - var targetObjectForMeshWithoutBS = GameObject.Instantiate(srcGameObject); - targetObjectForMeshWithoutBS.name = srcGameObject.name + "_WithoutBlendShape"; - targetObjectForMeshWithoutBS.transform.SetParent(srcTransform); - var skinnedMeshRendererWithoutBS = targetObjectForMeshWithoutBS.GetComponent(); - - // build meshes with/without BlendShape - BuildNewMesh(skinnedMeshRendererInput, vertexIndexWithBlendShape, submeshesWithBlendShape, BlendShapeLogic.WithBlendShape); - BuildNewMesh(skinnedMeshRendererWithoutBS, vertexIndexWithoutBlendShape, submeshesWithoutBlendShape, BlendShapeLogic.WithoutBlendShape); - } - } - - private static void BuildNewTriangleList(Dictionary newVerticesListLookUp, int[] triangleList, int index, - List newTriangleList, ref int vertexCounter) - { - // build new vertex list and triangle list - // vertex 1 - if (!newVerticesListLookUp.Keys.Contains(triangleList[index])) - { - newVerticesListLookUp.Add(triangleList[index], vertexCounter); - newTriangleList.Add(vertexCounter); - vertexCounter++; - } - else - { - var newVertexIndex = newVerticesListLookUp[triangleList[index]]; - newTriangleList.Add(newVertexIndex); - } - // vertex 2 - if (!newVerticesListLookUp.Keys.Contains(triangleList[index + 1])) - { - newVerticesListLookUp.Add(triangleList[index + 1], vertexCounter); - newTriangleList.Add(vertexCounter); - vertexCounter++; - } - else - { - var newVertexIndex = newVerticesListLookUp[triangleList[index + 1]]; - newTriangleList.Add(newVertexIndex); - } - // vertex 3 - if (!newVerticesListLookUp.Keys.Contains(triangleList[index + 2])) - { - newVerticesListLookUp.Add(triangleList[index + 2], vertexCounter); - newTriangleList.Add(vertexCounter); - vertexCounter++; - } - else - { - var newVertexIndex = newVerticesListLookUp[triangleList[index + 2]]; - newTriangleList.Add(newVertexIndex); - } - } - - private static void BuildNewMesh(SkinnedMeshRenderer skinnedMeshRenderer, Dictionary newIndexLookUpDict, - Dictionary subMeshes, BlendShapeLogic blendShapeLabel) - { - // get original mesh data - var materialList = new List(); - skinnedMeshRenderer.GetSharedMaterials(materialList); - var mesh = skinnedMeshRenderer.sharedMesh; - var meshVertices = mesh.vertices; - var meshNormals = mesh.normals; - var meshTangents = mesh.tangents; - var meshColors = mesh.colors; - var meshBoneWeights = mesh.boneWeights; - var meshUVs = mesh.uv; - - // build new mesh - var materialListNew = new List(); - var newMesh = new Mesh(); - - if (mesh.vertexCount > ushort.MaxValue) - { -#if UNITY_2017_3_OR_NEWER - Debug.LogFormat("exceed 65535 vertices: {0}", mesh.vertexCount); - newMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32; -#else - throw new NotImplementedException(String.Format("exceed 65535 vertices: {0}", integrator.Positions.Count.ToString())); -#endif - } - - var newDataLength = newIndexLookUpDict.Count; - var newIndexLookUp = newIndexLookUpDict.Keys.ToArray(); - - newMesh.vertices = newIndexLookUp.Select(x => meshVertices[x]).ToArray(); - if (meshNormals.Length > 0) newMesh.normals = newIndexLookUp.Select(x => meshNormals[x]).ToArray(); - if (meshTangents.Length > 0) newMesh.tangents = newIndexLookUp.Select(x => meshTangents[x]).ToArray(); - if (meshColors.Length > 0) newMesh.colors = newIndexLookUp.Select(x => meshColors[x]).ToArray(); - if (meshBoneWeights.Length > 0) newMesh.boneWeights = newIndexLookUp.Select(x => meshBoneWeights[x]).ToArray(); - if (meshUVs.Length > 0) newMesh.uv = newIndexLookUp.Select(x => meshUVs[x]).ToArray(); - newMesh.bindposes = mesh.bindposes; - - // add BlendShape data - if (blendShapeLabel == BlendShapeLogic.WithBlendShape) - { - for (int i = 0; i < mesh.blendShapeCount; i++) - { - // get original BlendShape data - var srcVertices = new Vector3[mesh.vertexCount]; - var srcNormals = new Vector3[mesh.vertexCount]; - var srcTangents = new Vector3[mesh.vertexCount]; - mesh.GetBlendShapeFrameVertices(i, 0, srcVertices, srcNormals, srcTangents); - - // declare the size for the destination array - var dstVertices = new Vector3[newDataLength]; - var dstNormals = new Vector3[newDataLength]; - var dstTangents = new Vector3[newDataLength]; - - dstVertices = newIndexLookUp.Select(x => srcVertices[x]).ToArray(); - dstNormals = newIndexLookUp.Select(x => srcNormals[x]).ToArray(); - dstTangents = newIndexLookUp.Select(x => srcTangents[x]).ToArray(); - newMesh.AddBlendShapeFrame(mesh.GetBlendShapeName(i), mesh.GetBlendShapeFrameWeight(i, 0), - dstVertices, dstNormals, dstTangents); - } - } - - newMesh.subMeshCount = subMeshes.Count; - var cosMaterialIndex = subMeshes.Keys.ToArray(); - - // build material list - for (int i = 0; i < subMeshes.Count; i++) - { - newMesh.SetTriangles(subMeshes[cosMaterialIndex[i]], i); - materialListNew.Add(materialList[cosMaterialIndex[i]]); - } - skinnedMeshRenderer.sharedMaterials = materialListNew.ToArray(); - skinnedMeshRenderer.sharedMesh = newMesh; - - // save mesh as asset - var assetPath = string.Format("{0}{1}", Path.GetFileNameWithoutExtension(mesh.name), ASSET_SUFFIX); - Debug.Log(assetPath); - if (!string.IsNullOrEmpty((AssetDatabase.GetAssetPath(mesh)))) - { - var directory = Path.GetDirectoryName(AssetDatabase.GetAssetPath(mesh)).Replace("\\", "/"); - assetPath = string.Format("{0}/{1}{2}", directory, Path.GetFileNameWithoutExtension(mesh.name) + "_" + blendShapeLabel.ToString(), ASSET_SUFFIX); - } - else - { - assetPath = string.Format("Assets/{0}{1}", Path.GetFileNameWithoutExtension(mesh.name) + "_" + blendShapeLabel.ToString(), ASSET_SUFFIX); - } - Debug.LogFormat("CreateAsset: {0}", assetPath); - AssetDatabase.CreateAsset(newMesh, assetPath); - } - } -} \ No newline at end of file diff --git a/Assets/MeshUtility/Editor/MeshUtility.cs.meta b/Assets/MeshUtility/Editor/MeshUtility.cs.meta deleted file mode 100644 index 2fb0aadd..00000000 --- a/Assets/MeshUtility/Editor/MeshUtility.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c1bbe850b95e44740bbbb44064e17d25 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/LICENSE.md b/Assets/MeshUtility/LICENSE.md deleted file mode 100644 index 7a9585e4..00000000 --- a/Assets/MeshUtility/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) 2020 VRM Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Assets/MeshUtility/LICENSE.md.meta b/Assets/MeshUtility/LICENSE.md.meta deleted file mode 100644 index 6462af9e..00000000 --- a/Assets/MeshUtility/LICENSE.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 5759a25d3024bd94a92b0af38bac243c -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/README.md b/Assets/MeshUtility/README.md deleted file mode 100644 index c96f8f90..00000000 --- a/Assets/MeshUtility/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# MeshUtility - -Mesh processing tool in Unity platform. - -## Utilities - -### MeshSeparator - -Separate the target mesh into different categories based on given conditions. - -Currently support BlendShape mesh separation. See [documentation](Documentation/notes/MeshSeparator.md) for more details. - - - -### MeshIntegrator - -Integrate all the meshes of a Prefab (Project window). - -### Integrate Static Mesh - -Integrate all the static meshes in the Hierarchy (Root and its children). - -### MeshNormalizer - -Bake the Hierarchy. This is VRM normalize backend. -MeshNormalizer can do blendShape bake. - -## Import MeshUtility - -There are two ways to import MeshUtility into a Unity project. - -### 1. Unity Package Manager (from Unity 2019) - -You can add MeshUtility package via `UPM`. First click `Window` from menu on top, then select `Package Manager`. - - - -In `Package Manager`, click `Add package from git URL` and paste `https://github.com/vrm-c/UniVRM.git?path=/Assets/MeshUtility`. - - - -Now check your project window. You shall see MeshUtility in the `Packages` folder. - -### 2. Add package name and its url in manifest.json - -Another way of importing MeshUtility is manually adding necessary information in manifest.json, which is in the directory of `Package folder` in your Unity project. Open manifest.json with text editor and add the followings in `dependencies`: - -```json -{ - "dependencies": { - "com.vrmc.meshutility": "https://github.com/vrm-c/UniVRM.git?path=/Assets/MeshUtility", - } -} -``` - -Go back to the Unity project. The system will automatically load the package. - - \ No newline at end of file diff --git a/Assets/MeshUtility/README.md.meta b/Assets/MeshUtility/README.md.meta deleted file mode 100644 index b5c1eb77..00000000 --- a/Assets/MeshUtility/README.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: febba2ec3ea2c9247ab21226ce81f924 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/README.url b/Assets/MeshUtility/README.url deleted file mode 100644 index 79542bae..00000000 --- a/Assets/MeshUtility/README.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=https://github.com/vrm-c/UniVRM/tree/master/Assets/MeshUtility \ No newline at end of file diff --git a/Assets/MeshUtility/README.url.meta b/Assets/MeshUtility/README.url.meta deleted file mode 100644 index 6ee109b6..00000000 --- a/Assets/MeshUtility/README.url.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 42e2fc8311d7ef44fa3975996ba1645d -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Runtime.meta b/Assets/MeshUtility/Runtime.meta deleted file mode 100644 index 3b08e959..00000000 --- a/Assets/MeshUtility/Runtime.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fc6ddf08077eac64fb9e33738e1c314d -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Runtime/BindposeGizmo.cs b/Assets/MeshUtility/Runtime/BindposeGizmo.cs deleted file mode 100644 index 23e233e5..00000000 --- a/Assets/MeshUtility/Runtime/BindposeGizmo.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -// using UniGLTF; -#if UNITY_EDITOR -using UnityEditor; -#endif - - -namespace MeshUtility -{ - [DisallowMultipleComponent] - public class BindposeGizmo : MonoBehaviour - { - [SerializeField] - Mesh m_target; - - [SerializeField] - float[] m_boneWeights; - - [SerializeField, Range(0.1f, 1.0f)] - float m_gizmoSize = 0.02f; - - [SerializeField] - Color m_meshGizmoColor = Color.yellow; - - [SerializeField] - Color m_bindGizmoColor = Color.red; - - private void Reset() - { - var renderer = GetComponent(); - if (renderer == null) return; - m_target = renderer.sharedMesh; - } - -#if UNITY_EDITOR - #region ToBindpose - [ContextMenu("ToBindpose")] - void ToBindpose() - { - var renderer = GetComponent(); - - var root = - renderer.bones - .Select(x => Ancestors(x).Reverse().ToArray()) - .Aggregate((a, b) => - { - int i = 0; - for (; i < a.Length && i < b.Length; ++i) - { - if (a[i] != b[i]) - { - break; - } - } - return a.Take(i).ToArray(); - }) - .Last() - ; - - var map = new Dictionary(); - for (int i = 0; i < renderer.bones.Length; ++i) - { - map[renderer.bones[i]] = m_target.bindposes[i]; - } - - { - var bones = Traverse(root); - Undo.RecordObjects(bones.ToArray(), "toBindpose"); - - foreach (var x in bones) - { - var bind = default(Matrix4x4); - if (map.TryGetValue(x, out bind)) - { - var toWorld = renderer.transform.localToWorldMatrix * bind.inverse; - x.position = toWorld.GetColumn(3); - x.rotation = toWorld.ExtractRotation(); - } - } - - //EditorUtility.SetDirty(transform); - } - } - - IEnumerable Traverse(Transform self) - { - yield return self; - - foreach (Transform child in self) - { - foreach (var x in Traverse(child)) - { - yield return x; - } - } - } - - IEnumerable Ancestors(Transform self) - { - yield return self; - - if (self.parent != null) - { - foreach (var x in Ancestors(self.parent)) - { - yield return x; - } - } - } - #endregion -#endif - - private void OnDrawGizmos() - { - if (m_target == null) - { - return; - } - - Gizmos.matrix = transform.localToWorldMatrix; - - if (m_target.bindposes != null && m_target.bindposes.Length > 0) - { - if (m_boneWeights == null || m_boneWeights.Length != m_target.bindposes.Length) - { - m_boneWeights = new float[m_target.bindposes.Length]; - foreach (var bw in m_target.boneWeights) - { - if (bw.weight0 > 0) m_boneWeights[bw.boneIndex0] += bw.weight0; - if (bw.weight1 > 0) m_boneWeights[bw.boneIndex1] += bw.weight1; - if (bw.weight2 > 0) m_boneWeights[bw.boneIndex2] += bw.weight2; - if (bw.weight3 > 0) m_boneWeights[bw.boneIndex3] += bw.weight3; - } - } - - Gizmos.color = m_meshGizmoColor; - Gizmos.DrawWireMesh(m_target); - - for (var i = 0; i < m_target.bindposes.Length; ++i) - { - var color = m_bindGizmoColor * m_boneWeights[i]; - color.a = 1.0f; - Gizmos.color = color; - - Gizmos.matrix = transform.localToWorldMatrix * m_target.bindposes[i].inverse; - Gizmos.DrawWireCube(Vector3.zero, Vector3.one * m_gizmoSize); - } - } - else - { - Gizmos.color = Color.gray; - Gizmos.DrawWireMesh(m_target); - } - } - } -} diff --git a/Assets/MeshUtility/Runtime/BindposeGizmo.cs.meta b/Assets/MeshUtility/Runtime/BindposeGizmo.cs.meta deleted file mode 100644 index 1567b1e4..00000000 --- a/Assets/MeshUtility/Runtime/BindposeGizmo.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 3ada4f7077a352343aed57e71a58885d -timeCreated: 1518245944 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Runtime/BoneMeshEraser.cs b/Assets/MeshUtility/Runtime/BoneMeshEraser.cs deleted file mode 100644 index 64ee850d..00000000 --- a/Assets/MeshUtility/Runtime/BoneMeshEraser.cs +++ /dev/null @@ -1,166 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; - - -namespace MeshUtility -{ - public static class BoneMeshEraser - { - private struct ExcludeBoneIndex - { - public readonly bool Bone0; - public readonly bool Bone1; - public readonly bool Bone2; - public readonly bool Bone3; - - public ExcludeBoneIndex(bool bone0, bool bone1, bool bone2, bool bone3) - { - Bone0 = bone0; - Bone1 = bone1; - Bone2 = bone2; - Bone3 = bone3; - } - } - - [Serializable] - public struct EraseBone - { - public Transform Bone; - public bool Erase; - - public override string ToString() - { - return Bone.name + ":" + Erase; - } - } - - static int ExcludeTriangles(int[] triangles, BoneWeight[] bws, int[] exclude) - { - int count = 0; - if (bws != null && bws.Length > 0) - { - for (int i = 0; i < triangles.Length; i += 3) - { - var a = triangles[i]; - var b = triangles[i + 1]; - var c = triangles[i + 2]; - - { - var bw = bws[a]; - var eb = AreBoneContains(ref exclude, bw.boneIndex0, bw.boneIndex1, bw.boneIndex2, bw.boneIndex3); - if (bw.weight0 > 0 && eb.Bone0) continue; - if (bw.weight1 > 0 && eb.Bone1) continue; - if (bw.weight2 > 0 && eb.Bone2) continue; - if (bw.weight3 > 0 && eb.Bone3) continue; - } - { - var bw = bws[b]; - var eb = AreBoneContains(ref exclude, bw.boneIndex0, bw.boneIndex1, bw.boneIndex2, bw.boneIndex3); - if (bw.weight0 > 0 && eb.Bone0) continue; - if (bw.weight1 > 0 && eb.Bone1) continue; - if (bw.weight2 > 0 && eb.Bone2) continue; - if (bw.weight3 > 0 && eb.Bone3) continue; - } - { - var bw = bws[c]; - var eb = AreBoneContains(ref exclude, bw.boneIndex0, bw.boneIndex1, bw.boneIndex2, bw.boneIndex3); - if (bw.weight0 > 0 && eb.Bone0) continue; - if (bw.weight1 > 0 && eb.Bone1) continue; - if (bw.weight2 > 0 && eb.Bone2) continue; - if (bw.weight3 > 0 && eb.Bone3) continue; - } - - triangles[count++] = a; - triangles[count++] = b; - triangles[count++] = c; - } - } - - return count; - } - - private static ExcludeBoneIndex AreBoneContains(ref int[] exclude, int boneIndex0, int boneIndex1, - int boneIndex2, int boneIndex3) - { - var b0 = false; - var b1 = false; - var b2 = false; - var b3 = false; - for (int i = 0; i < exclude.Length; i++) - { - if (exclude[i] == boneIndex0) - { - b0 = true; - continue; - } - - if (exclude[i] == boneIndex1) - { - b1 = true; - continue; - } - - if (exclude[i] == boneIndex2) - { - b2 = true; - continue; - } - - if (exclude[i] == boneIndex3) - { - b3 = true; - } - } - - return new ExcludeBoneIndex(b0, b1, b2, b3); - } - - public static Mesh CreateErasedMesh(Mesh src, int[] eraseBoneIndices) - { - /* - Debug.LogFormat("{0} exclude: {1}", - src.name, - String.Join(", ", eraseBoneIndices.Select(x => x.ToString()).ToArray()) - ); - */ - var mesh = new Mesh(); - mesh.name = src.name + "(erased)"; - -#if UNITY_2017_3_OR_NEWER - mesh.indexFormat = src.indexFormat; -#endif - - mesh.vertices = src.vertices; - mesh.normals = src.normals; - mesh.uv = src.uv; - mesh.tangents = src.tangents; - mesh.boneWeights = src.boneWeights; - mesh.bindposes = src.bindposes; - mesh.subMeshCount = src.subMeshCount; - for (int i = 0; i < src.subMeshCount; ++i) - { - var indices = src.GetIndices(i); - var count = ExcludeTriangles(indices, mesh.boneWeights, eraseBoneIndices); - var dst = new int[count]; - Array.Copy(indices, 0, dst, 0, count); - mesh.SetIndices(dst, MeshTopology.Triangles, i); - } - - return mesh; - } - - public static IEnumerable Ancestor(this Transform t) - { - yield return t; - - if (t.parent != null) - { - foreach (var x in Ancestor(t.parent)) - { - yield return x; - } - } - } - } -} diff --git a/Assets/MeshUtility/Runtime/BoneMeshEraser.cs.meta b/Assets/MeshUtility/Runtime/BoneMeshEraser.cs.meta deleted file mode 100644 index db633e87..00000000 --- a/Assets/MeshUtility/Runtime/BoneMeshEraser.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 270bf7461f6f8d546ae540cb7d5fc6f3 -timeCreated: 1519018975 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Runtime/BoneNormalizer.cs b/Assets/MeshUtility/Runtime/BoneNormalizer.cs deleted file mode 100644 index b5f5231c..00000000 --- a/Assets/MeshUtility/Runtime/BoneNormalizer.cs +++ /dev/null @@ -1,507 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - - -namespace MeshUtility -{ - public static class BoneNormalizer - { - public delegate Avatar CreateAvatarFunc(GameObject original, GameObject normalized, Dictionary boneMap); - - static (GameObject, Dictionary) NormalizeHierarchy(GameObject go, CreateAvatarFunc createAvatar) - { - var boneMap = new Dictionary(); - - // - // 回転・スケールの無いヒエラルキーをコピーする - // - var normalized = new GameObject(go.name + "(normalized)"); - normalized.transform.position = go.transform.position; - CopyAndBuild(go.transform, normalized.transform, boneMap); - - // - // 新しいヒエラルキーからAvatarを作る - // - { - var animator = normalized.AddComponent(); - var avatar = createAvatar(go, normalized, boneMap); - avatar.name = go.name + ".normalized"; - animator.avatar = avatar; - } - - return (normalized, boneMap); - } - - /// - /// 回転とスケールを除去したヒエラルキーをコピーする。 - /// - /// - /// - static void CopyAndBuild(Transform src, Transform dst, Dictionary boneMap) - { - boneMap[src] = dst; - - foreach (Transform child in src) - { - if (child.gameObject.activeSelf) - { - var dstChild = new GameObject(child.name); - dstChild.transform.SetParent(dst); - dstChild.transform.position = child.position; // copy position only - - CopyAndBuild(child, dstChild.transform, boneMap); - } - } - } - - class BlendShapeReport - { - string m_name; - int m_count; - struct BlendShapeStat - { - public int Index; - public string Name; - public int VertexCount; - public int NormalCount; - public int TangentCount; - - public override string ToString() - { - return string.Format("[{0}]{1}: {2}, {3}, {4}\n", Index, Name, VertexCount, NormalCount, TangentCount); - } - } - List m_stats = new List(); - public int Count - { - get { return m_stats.Count; } - } - public BlendShapeReport(Mesh mesh) - { - m_name = mesh.name; - m_count = mesh.vertexCount; - } - public void SetCount(int index, string name, int v, int n, int t) - { - m_stats.Add(new BlendShapeStat - { - Index = index, - Name = name, - VertexCount = v, - NormalCount = n, - TangentCount = t, - }); - } - public override string ToString() - { - return String.Format("NormalizeSkinnedMesh: {0}({1}verts)\n{2}", - m_name, - m_count, - String.Join("", m_stats.Select(x => x.ToString()).ToArray())); - } - } - - /// - /// index が 有効であれば、setter に weight を渡す。無効であれば setter に 0 を渡す。 - /// - /// - /// - /// - /// - static bool CopyOrDropWeight(int[] indexMap, int srcIndex, float weight, Action setter) - { - if (srcIndex < 0 || srcIndex >= indexMap.Length) - { - // ありえるかどうかわからないが BoneWeight.boneIndexN に変な値が入っている. - setter(0, 0); - return false; - } - - var dstIndex = indexMap[srcIndex]; - if (dstIndex != -1) - { - // 有効なindex。weightをコピーする - setter(dstIndex, weight); - return true; - } - else - { - // 無効なindex。0でクリアする - setter(0, 0); - return false; - } - } - - /// - /// BoneWeight[] src から新しいボーンウェイトを作成する。 - /// - /// 変更前のBoneWeight[] - /// 新旧のボーンの対応表。新しい方は無効なボーンが除去されてnullの部分がある - /// 変更前のボーン配列 - /// 変更後のボーン配列。除去されたボーンがある場合、変更前より短い - /// - public static BoneWeight[] MapBoneWeight(BoneWeight[] src, - Dictionary boneMap, - Transform[] srcBones, - Transform[] dstBones - ) - { - // 処理前後の index の対応表を作成する - var indexMap = new int[srcBones.Length]; - for (int i = 0; i < srcBones.Length; ++i) - { - var srcBone = srcBones[i]; - if (srcBone == null) - { - // 元のボーンが無い - indexMap[i] = -1; - Debug.LogWarningFormat("bones[{0}] is null", i); - } - else - { - if (boneMap.TryGetValue(srcBone, out Transform dstBone)) - { - // 対応するボーンが存在する - var dstIndex = Array.IndexOf(dstBones, dstBone); - if (dstIndex == -1) - { - // ありえない。バグ - throw new Exception(); - } - indexMap[i] = dstIndex; - } - else - { - // 先のボーンが無い - indexMap[i] = -1; - Debug.LogWarningFormat("{0} is removed", srcBone.name); - } - } - } - - // 新しいBoneWeightを作成する - var newBoneWeights = new BoneWeight[src.Length]; - for (int i = 0; i < src.Length; ++i) - { - BoneWeight srcBoneWeight = src[i]; - - // 0 - CopyOrDropWeight(indexMap, srcBoneWeight.boneIndex0, srcBoneWeight.weight0, (newIndex, newWeight) => - { - newBoneWeights[i].boneIndex0 = newIndex; - newBoneWeights[i].weight0 = newWeight; - }); - // 1 - CopyOrDropWeight(indexMap, srcBoneWeight.boneIndex1, srcBoneWeight.weight1, (newIndex, newWeight) => - { - newBoneWeights[i].boneIndex1 = newIndex; - newBoneWeights[i].weight1 = newWeight; - }); - // 2 - CopyOrDropWeight(indexMap, srcBoneWeight.boneIndex2, srcBoneWeight.weight2, (newIndex, newWeight) => - { - newBoneWeights[i].boneIndex2 = newIndex; - newBoneWeights[i].weight2 = newWeight; - }); - // 3 - CopyOrDropWeight(indexMap, srcBoneWeight.boneIndex3, srcBoneWeight.weight3, (newIndex, newWeight) => - { - newBoneWeights[i].boneIndex3 = newIndex; - newBoneWeights[i].weight3 = newWeight; - }); - } - - return newBoneWeights; - } - - /// - /// srcのSkinnedMeshRendererを正規化して、dstにアタッチする - /// - /// 正規化前のSkinnedMeshRendererのTransform - /// 正規化後のSkinnedMeshRendererのTransform - /// 正規化前のボーンから正規化後のボーンを得る - static void NormalizeSkinnedMesh(Transform src, Transform dst, Dictionary boneMap, bool clearBlendShape) - { - var srcRenderer = src.GetComponent(); - if (srcRenderer == null - || !srcRenderer.enabled - || srcRenderer.sharedMesh == null - || srcRenderer.sharedMesh.vertexCount == 0) - { - // 有効なSkinnedMeshRendererが無かった - return; - } - - var srcMesh = srcRenderer.sharedMesh; - var originalSrcMesh = srcMesh; - - // clear blendShape - if (clearBlendShape) - { - for (int i = 0; i < srcMesh.blendShapeCount; ++i) - { - srcRenderer.SetBlendShapeWeight(i, 0); - } - } - - // 元の Transform[] bones から、無効なboneを取り除いて前に詰めた配列を作る - var dstBones = srcRenderer.bones - .Where(x => x != null && boneMap.ContainsKey(x)) - .Select(x => boneMap[x]) - .ToArray(); - - var hasBoneWeight = srcRenderer.bones != null && srcRenderer.bones.Length > 0; - if (!hasBoneWeight) - { - // Before bake, bind no weight bones - //Debug.LogFormat("no weight: {0}", srcMesh.name); - - srcMesh = srcMesh.Copy(true); - var bw = new BoneWeight - { - boneIndex0 = 0, - boneIndex1 = 0, - boneIndex2 = 0, - boneIndex3 = 0, - weight0 = 1.0f, - weight1 = 0.0f, - weight2 = 0.0f, - weight3 = 0.0f, - }; - srcMesh.boneWeights = Enumerable.Range(0, srcMesh.vertexCount).Select(x => bw).ToArray(); - srcMesh.bindposes = new Matrix4x4[] { Matrix4x4.identity }; - - srcRenderer.rootBone = srcRenderer.transform; - dstBones = new[] { boneMap[srcRenderer.transform] }; - srcRenderer.bones = new[] { srcRenderer.transform }; - srcRenderer.sharedMesh = srcMesh; - } - - // BakeMesh - var mesh = srcMesh.Copy(false); - mesh.name = srcMesh.name + ".baked"; - srcRenderer.BakeMesh(mesh); - - var blendShapeValues = new Dictionary(); - for (int i = 0; i < srcMesh.blendShapeCount; i++) - { - var val = srcRenderer.GetBlendShapeWeight(i); - if (val > 0) blendShapeValues.Add(i, val); - } - - // 新しい骨格のボーンウェイトを作成する - mesh.boneWeights = MapBoneWeight(srcMesh.boneWeights, boneMap, srcRenderer.bones, dstBones); - - // recalc bindposes - mesh.bindposes = dstBones.Select(x => x.worldToLocalMatrix * dst.transform.localToWorldMatrix).ToArray(); - - //var m = src.localToWorldMatrix; // include scaling - var m = default(Matrix4x4); - m.SetTRS(Vector3.zero, src.rotation, Vector3.one); // rotation only - mesh.ApplyMatrix(m); - - // - // BlendShapes - // - var meshVertices = mesh.vertices; - var meshNormals = mesh.normals; -#if VRM_NORMALIZE_BLENDSHAPE_TANGENT - var meshTangents = mesh.tangents.Select(x => (Vector3)x).ToArray(); -#endif - - var originalBlendShapePositions = new Vector3[meshVertices.Length]; - var originalBlendShapeNormals = new Vector3[meshVertices.Length]; - var originalBlendShapeTangents = new Vector3[meshVertices.Length]; - - var report = new BlendShapeReport(srcMesh); - var blendShapeMesh = new Mesh(); - for (int i = 0; i < srcMesh.blendShapeCount; ++i) - { - // check blendShape - srcRenderer.sharedMesh.GetBlendShapeFrameVertices(i, 0, originalBlendShapePositions, originalBlendShapeNormals, originalBlendShapeTangents); - var hasVertices = originalBlendShapePositions.Count(x => x != Vector3.zero); - var hasNormals = originalBlendShapeNormals.Count(x => x != Vector3.zero); -#if VRM_NORMALIZE_BLENDSHAPE_TANGENT - var hasTangents = originalBlendShapeTangents.Count(x => x != Vector3.zero); -#else - var hasTangents = 0; -#endif - var name = srcMesh.GetBlendShapeName(i); - if (string.IsNullOrEmpty(name)) - { - name = String.Format("{0}", i); - } - - report.SetCount(i, name, hasVertices, hasNormals, hasTangents); - - srcRenderer.SetBlendShapeWeight(i, 100.0f); - srcRenderer.BakeMesh(blendShapeMesh); - if (blendShapeMesh.vertices.Length != mesh.vertices.Length) - { - throw new Exception("different vertex count"); - } - - var value = blendShapeValues.ContainsKey(i) ? blendShapeValues[i] : 0; - srcRenderer.SetBlendShapeWeight(i, value); - - Vector3[] vertices = blendShapeMesh.vertices; - - for (int j = 0; j < vertices.Length; ++j) - { - if (originalBlendShapePositions[j] == Vector3.zero) - { - vertices[j] = Vector3.zero; - } - else - { - vertices[j] = m.MultiplyPoint(vertices[j]) - meshVertices[j]; - } - } - - Vector3[] normals = blendShapeMesh.normals; - for (int j = 0; j < normals.Length; ++j) - { - if (originalBlendShapeNormals[j] == Vector3.zero) - { - normals[j] = Vector3.zero; - - } - else - { - normals[j] = m.MultiplyVector(normals[j]) - meshNormals[j]; - } - } - - Vector3[] tangents = blendShapeMesh.tangents.Select(x => (Vector3)x).ToArray(); -#if VRM_NORMALIZE_BLENDSHAPE_TANGENT - for (int j = 0; j < tangents.Length; ++j) - { - if (originalBlendShapeTangents[j] == Vector3.zero) - { - tangents[j] = Vector3.zero; - } - else - { - tangents[j] = m.MultiplyVector(tangents[j]) - meshTangents[j]; - } - } -#endif - - var frameCount = srcMesh.GetBlendShapeFrameCount(i); - for (int f = 0; f < frameCount; f++) - { - - var weight = srcMesh.GetBlendShapeFrameWeight(i, f); - - try - { - mesh.AddBlendShapeFrame(name, - weight, - vertices, - hasNormals > 0 ? normals : null, - hasTangents > 0 ? tangents : null - ); - } - catch (Exception) - { - Debug.LogErrorFormat("fail to mesh.AddBlendShapeFrame {0}.{1}", - mesh.name, - srcMesh.GetBlendShapeName(i) - ); - throw; - } - } - } - - if (report.Count > 0) - { - Debug.LogFormat("{0}", report.ToString()); - } - - var dstRenderer = dst.gameObject.AddComponent(); - dstRenderer.sharedMaterials = srcRenderer.sharedMaterials; - if (srcRenderer.rootBone != null) - { - dstRenderer.rootBone = boneMap[srcRenderer.rootBone]; - } - dstRenderer.bones = dstBones; - dstRenderer.sharedMesh = mesh; - - if (!hasBoneWeight) - { - // restore bones - srcRenderer.bones = new Transform[] { }; - srcRenderer.sharedMesh = originalSrcMesh; - } - } - - /// - /// - /// - /// - /// - static void NormalizeNoneSkinnedMesh(Transform src, Transform dst) - { - var srcFilter = src.GetComponent(); - if (srcFilter == null - || srcFilter.sharedMesh == null - || srcFilter.sharedMesh.vertexCount == 0) - { - return; - } - - var srcRenderer = src.GetComponent(); - if (srcRenderer == null || !srcRenderer.enabled) - { - return; - } - - // Meshに乗っているボーンの姿勢を適用する - var dstFilter = dst.gameObject.AddComponent(); - - var dstMesh = srcFilter.sharedMesh.Copy(false); - dstMesh.ApplyRotationAndScale(src.localToWorldMatrix); - dstFilter.sharedMesh = dstMesh; - - // Materialをコピー - var dstRenderer = dst.gameObject.AddComponent(); - dstRenderer.sharedMaterials = srcRenderer.sharedMaterials; - } - - /// - /// 回転とスケールを除去したヒエラルキーのコピーを作成する(MeshをBakeする) - /// - /// 対象のヒエラルキーのルート - /// BlendShapeを0クリアするか否か。false の場合 BlendShape の現状を Bake する - /// Avatarを作る関数 - /// - public static (GameObject, Dictionary) Execute(GameObject go, - bool clearBlendShapeBeforeNormalize, CreateAvatarFunc createAvatar) - { - // - // 正規化されたヒエラルキーを作る - // - var (normalized, boneMap) = NormalizeHierarchy(go, createAvatar); - - // - // 各メッシュから回転・スケールを取り除いてBinding行列を再計算する - // - foreach (var src in go.transform.Traverse()) - { - Transform dst; - if (!boneMap.TryGetValue(src, out dst)) - { - continue; - } - - NormalizeSkinnedMesh(src, dst, boneMap, clearBlendShapeBeforeNormalize); - - NormalizeNoneSkinnedMesh(src, dst); - } - - return (normalized, boneMap); - } - } -} diff --git a/Assets/MeshUtility/Runtime/BoneNormalizer.cs.meta b/Assets/MeshUtility/Runtime/BoneNormalizer.cs.meta deleted file mode 100644 index 4663d268..00000000 --- a/Assets/MeshUtility/Runtime/BoneNormalizer.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: b330ec419f98af14687c302638922ab0 -timeCreated: 1519379418 -licenseType: Free -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Runtime/Humanoid.cs b/Assets/MeshUtility/Runtime/Humanoid.cs deleted file mode 100644 index c6d61948..00000000 --- a/Assets/MeshUtility/Runtime/Humanoid.cs +++ /dev/null @@ -1,441 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace MeshUtility -{ - /// - /// Bone割り当てを保持する。 - /// ヒエラルキーのルート(おそらくHipsの親)にアタッチする - /// - [DisallowMultipleComponent] - public class Humanoid : MonoBehaviour - { - [SerializeField] private Transform m_Hips; public Transform Hips => m_Hips; - - #region leg - [SerializeField] private Transform m_LeftUpperLeg; public Transform LeftUpperLeg => m_LeftUpperLeg; - [SerializeField] private Transform m_RightUpperLeg; public Transform RightUpperLeg => m_RightUpperLeg; - [SerializeField] private Transform m_LeftLowerLeg; public Transform LeftLowerLeg => m_LeftLowerLeg; - [SerializeField] private Transform m_RightLowerLeg; public Transform RightLowerLeg => m_RightLowerLeg; - [SerializeField] private Transform m_LeftFoot; public Transform LeftFoot => m_LeftFoot; - [SerializeField] private Transform m_RightFoot; public Transform RightFoot => m_RightFoot; - [SerializeField] private Transform m_LeftToes; public Transform LeftToes => m_LeftToes; - [SerializeField] private Transform m_RightToes; public Transform RightToes => m_RightToes; - #endregion - - #region spine - [SerializeField] private Transform m_Spine; public Transform Spine => m_Spine; - [SerializeField] private Transform m_Chest; public Transform Chest => m_Chest; - [SerializeField] private Transform m_UpperChest; public Transform UpperChest => m_UpperChest; - [SerializeField] private Transform m_Neck; public Transform Neck => m_Neck; - [SerializeField] private Transform m_Head; public Transform Head => m_Head; - [SerializeField] private Transform m_LeftEye; public Transform LeftEye => m_LeftEye; - [SerializeField] private Transform m_RightEye; public Transform RightEye => m_RightEye; - [SerializeField] private Transform m_Jaw; public Transform Jaw => m_Jaw; - #endregion - - #region arm - [SerializeField] private Transform m_LeftShoulder; public Transform LeftShoulder => m_LeftShoulder; - [SerializeField] private Transform m_RightShoulder; public Transform RightShoulder => m_RightShoulder; - [SerializeField] private Transform m_LeftUpperArm; public Transform LeftUpperArm => m_LeftUpperArm; - [SerializeField] private Transform m_RightUpperArm; public Transform RightUpperArm => m_RightUpperArm; - [SerializeField] private Transform m_LeftLowerArm; public Transform LeftLowerArm => m_LeftLowerArm; - [SerializeField] private Transform m_RightLowerArm; public Transform RightLowerArm => m_RightLowerArm; - [SerializeField] private Transform m_LeftHand; public Transform LeftHand => m_LeftHand; - [SerializeField] private Transform m_RightHand; public Transform RightHand => m_RightHand; - #endregion - - #region fingers - [SerializeField] private Transform m_LeftThumbProximal; public Transform LeftThumbProximal => m_LeftThumbProximal; - [SerializeField] private Transform m_LeftThumbIntermediate; public Transform LeftThumbIntermediate => m_LeftThumbIntermediate; - [SerializeField] private Transform m_LeftThumbDistal; public Transform LeftThumbDistal => m_LeftThumbDistal; - [SerializeField] private Transform m_LeftIndexProximal; public Transform LeftIndexProximal => m_LeftIndexProximal; - [SerializeField] private Transform m_LeftIndexIntermediate; public Transform LeftIndexIntermediate => m_LeftIndexIntermediate; - [SerializeField] private Transform m_LeftIndexDistal; public Transform LeftIndexDistal => m_LeftIndexDistal; - [SerializeField] private Transform m_LeftMiddleProximal; public Transform LeftMiddleProximal => m_LeftMiddleProximal; - [SerializeField] private Transform m_LeftMiddleIntermediate; public Transform LeftMiddleIntermediate => m_LeftMiddleIntermediate; - [SerializeField] private Transform m_LeftMiddleDistal; public Transform LeftMiddleDistal => m_LeftMiddleDistal; - [SerializeField] private Transform m_LeftRingProximal; public Transform LeftRingProximal => m_LeftRingProximal; - [SerializeField] private Transform m_LeftRingIntermediate; public Transform LeftRingIntermediate => m_LeftRingIntermediate; - [SerializeField] private Transform m_LeftRingDistal; public Transform LeftRingDistal => m_LeftRingDistal; - [SerializeField] private Transform m_LeftLittleProximal; public Transform LeftLittleProximal => m_LeftLittleProximal; - [SerializeField] private Transform m_LeftLittleIntermediate; public Transform LeftLittleIntermediate => m_LeftLittleIntermediate; - [SerializeField] private Transform m_LeftLittleDistal; public Transform LeftLittleDistal => m_LeftLittleDistal; - [SerializeField] private Transform m_RightThumbProximal; public Transform RightThumbProximal => m_RightThumbProximal; - [SerializeField] private Transform m_RightThumbIntermediate; public Transform RightThumbIntermediate => m_RightThumbIntermediate; - [SerializeField] private Transform m_RightThumbDistal; public Transform RightThumbDistal => m_RightThumbDistal; - [SerializeField] private Transform m_RightIndexProximal; public Transform RightIndexProximal => m_RightIndexProximal; - [SerializeField] private Transform m_RightIndexIntermediate; public Transform RightIndexIntermediate => m_RightIndexIntermediate; - [SerializeField] private Transform m_RightIndexDistal; public Transform RightIndexDistal => m_RightIndexDistal; - [SerializeField] private Transform m_RightMiddleProximal; public Transform RightMiddleProximal => m_RightMiddleProximal; - [SerializeField] private Transform m_RightMiddleIntermediate; public Transform RightMiddleIntermediate => m_RightMiddleIntermediate; - [SerializeField] private Transform m_RightMiddleDistal; public Transform RightMiddleDistal => m_RightMiddleDistal; - [SerializeField] private Transform m_RightRingProximal; public Transform RightRingProximal => m_RightRingProximal; - [SerializeField] private Transform m_RightRingIntermediate; public Transform RightRingIntermediate => m_RightRingIntermediate; - [SerializeField] private Transform m_RightRingDistal; public Transform RightRingDistal => m_RightRingDistal; - [SerializeField] private Transform m_RightLittleProximal; public Transform RightLittleProximal => m_RightLittleProximal; - [SerializeField] private Transform m_RightLittleIntermediate; public Transform RightLittleIntermediate => m_RightLittleIntermediate; - [SerializeField] private Transform m_RightLittleDistal; public Transform RightLittleDistal => m_RightLittleDistal; - #endregion - - void Reset() - { - AssignBonesFromAnimator(); - } - - public struct Validation - { - public readonly string Message; - public readonly bool IsError; - - public Validation(string message, bool isError) - { - Message = message; - IsError = isError; - } - } - - IEnumerable Required(params (string, Transform)[] props) - { - foreach (var prop in props) - { - if (prop.Item2 == null) - { - var name = prop.Item1; - if (name.StartsWith("m_")) - { - name = name.Substring(2); - } - yield return new Validation($"{name} is Required", true); - } - } - } - - static Vector3 GetForward(Transform l, Transform r) - { - if (l == null || r == null) - { - return Vector3.zero; - } - var lr = (r.position - l.position).normalized; - return Vector3.Cross(lr, Vector3.up); - } - - public Vector3 GetForward() - { - return GetForward(m_LeftUpperLeg, m_RightUpperLeg); - } - - public IEnumerable Validate() - { - foreach (var validation in Required( - (nameof(m_Hips), m_Hips), (nameof(m_Spine), m_Spine), (nameof(m_Head), m_Head), - (nameof(m_LeftUpperLeg), m_LeftUpperLeg), (nameof(m_LeftLowerLeg), m_LeftLowerLeg), (nameof(m_LeftFoot), m_LeftFoot), - (nameof(m_RightUpperLeg), m_RightUpperLeg), (nameof(m_RightLowerLeg), m_RightLowerLeg), (nameof(m_RightFoot), m_RightFoot), - (nameof(m_LeftUpperArm), m_LeftUpperArm), (nameof(m_LeftLowerArm), m_LeftLowerArm), (nameof(m_LeftHand), m_LeftHand), - (nameof(m_RightUpperArm), m_RightUpperArm), (nameof(m_RightLowerArm), m_RightLowerArm), (nameof(m_RightHand), m_RightHand) - )) - { - yield return validation; - } - - // var forward = GetForward(); - // if (Vector3.Dot(Vector3.forward, forward) < 0.5f) - // { - // yield return new Validation("Not facing the Z-axis positive direction", true); - // } - } - - /// - /// ボーン割り当てから UnityEngine.Avatar を生成する - /// - /// - public Avatar CreateAvatar() - { - return HumanoidLoader.LoadHumanoidAvatar(transform, BoneMap); - } - - public Transform GetBoneTransform(HumanBodyBones bone) - { - switch (bone) - { - case HumanBodyBones.Hips: return Hips; - - #region leg - case HumanBodyBones.LeftUpperLeg: return LeftUpperLeg; - case HumanBodyBones.RightUpperLeg: return RightUpperLeg; - case HumanBodyBones.LeftLowerLeg: return LeftLowerLeg; - case HumanBodyBones.RightLowerLeg: return RightLowerLeg; - case HumanBodyBones.LeftFoot: return LeftFoot; - case HumanBodyBones.RightFoot: return RightFoot; - case HumanBodyBones.LeftToes: return LeftToes; - case HumanBodyBones.RightToes: return RightToes; - #endregion - - #region spine - case HumanBodyBones.Spine: return Spine; - case HumanBodyBones.Chest: return Chest; - case HumanBodyBones.UpperChest: return UpperChest; - case HumanBodyBones.Neck: return Neck; - case HumanBodyBones.Head: return Head; - case HumanBodyBones.LeftEye: return LeftEye; - case HumanBodyBones.RightEye: return RightEye; - case HumanBodyBones.Jaw: return Jaw; - #endregion - - #region arm - case HumanBodyBones.LeftShoulder: return LeftShoulder; - case HumanBodyBones.RightShoulder: return RightShoulder; - case HumanBodyBones.LeftUpperArm: return LeftUpperArm; - case HumanBodyBones.RightUpperArm: return RightUpperArm; - case HumanBodyBones.LeftLowerArm: return LeftLowerArm; - case HumanBodyBones.RightLowerArm: return RightLowerArm; - case HumanBodyBones.LeftHand: return LeftHand; - case HumanBodyBones.RightHand: return RightHand; - #endregion - - #region fingers - case HumanBodyBones.LeftThumbProximal: return LeftThumbProximal; - case HumanBodyBones.LeftThumbIntermediate: return LeftThumbIntermediate; - case HumanBodyBones.LeftThumbDistal: return LeftThumbDistal; - case HumanBodyBones.LeftIndexProximal: return LeftIndexProximal; - case HumanBodyBones.LeftIndexIntermediate: return LeftIndexIntermediate; - case HumanBodyBones.LeftIndexDistal: return LeftIndexDistal; - case HumanBodyBones.LeftMiddleProximal: return LeftMiddleProximal; - case HumanBodyBones.LeftMiddleIntermediate: return LeftMiddleIntermediate; - case HumanBodyBones.LeftMiddleDistal: return LeftMiddleDistal; - case HumanBodyBones.LeftRingProximal: return LeftRingProximal; - case HumanBodyBones.LeftRingIntermediate: return LeftRingIntermediate; - case HumanBodyBones.LeftRingDistal: return LeftRingDistal; - case HumanBodyBones.LeftLittleProximal: return LeftLittleProximal; - case HumanBodyBones.LeftLittleIntermediate: return LeftLittleIntermediate; - case HumanBodyBones.LeftLittleDistal: return LeftLittleDistal; - case HumanBodyBones.RightThumbProximal: return RightThumbProximal; - case HumanBodyBones.RightThumbIntermediate: return RightThumbIntermediate; - case HumanBodyBones.RightThumbDistal: return RightThumbDistal; - case HumanBodyBones.RightIndexProximal: return RightIndexProximal; - case HumanBodyBones.RightIndexIntermediate: return RightIndexIntermediate; - case HumanBodyBones.RightIndexDistal: return RightIndexDistal; - case HumanBodyBones.RightMiddleProximal: return RightMiddleProximal; - case HumanBodyBones.RightMiddleIntermediate: return RightMiddleIntermediate; - case HumanBodyBones.RightMiddleDistal: return RightMiddleDistal; - case HumanBodyBones.RightRingProximal: return RightRingProximal; - case HumanBodyBones.RightRingIntermediate: return RightRingIntermediate; - case HumanBodyBones.RightRingDistal: return RightRingDistal; - case HumanBodyBones.RightLittleProximal: return RightLittleProximal; - case HumanBodyBones.RightLittleIntermediate: return RightLittleIntermediate; - case HumanBodyBones.RightLittleDistal: return RightLittleDistal; - #endregion - - } - - return null; - } - - IEnumerable<(Transform, HumanBodyBones)> BoneMap - { - get - { - if (Hips != null) { yield return (Hips, HumanBodyBones.Hips); } - - #region leg - if (LeftUpperLeg != null) { yield return (LeftUpperLeg, HumanBodyBones.LeftUpperLeg); } - if (RightUpperLeg != null) { yield return (RightUpperLeg, HumanBodyBones.RightUpperLeg); } - if (LeftLowerLeg != null) { yield return (LeftLowerLeg, HumanBodyBones.LeftLowerLeg); } - if (RightLowerLeg != null) { yield return (RightLowerLeg, HumanBodyBones.RightLowerLeg); } - if (LeftFoot != null) { yield return (LeftFoot, HumanBodyBones.LeftFoot); } - if (RightFoot != null) { yield return (RightFoot, HumanBodyBones.RightFoot); } - if (LeftToes != null) { yield return (LeftToes, HumanBodyBones.LeftToes); } - if (RightToes != null) { yield return (RightToes, HumanBodyBones.RightToes); } - #endregion - - #region spine - if (Spine != null) { yield return (Spine, HumanBodyBones.Spine); } - if (Chest != null) { yield return (Chest, HumanBodyBones.Chest); } - if (UpperChest != null) { yield return (UpperChest, HumanBodyBones.UpperChest); } - if (Neck != null) { yield return (Neck, HumanBodyBones.Neck); } - if (Head != null) { yield return (Head, HumanBodyBones.Head); } - if (LeftEye != null) { yield return (LeftEye, HumanBodyBones.LeftEye); } - if (RightEye != null) { yield return (RightEye, HumanBodyBones.RightEye); } - if (Jaw != null) { yield return (Jaw, HumanBodyBones.Jaw); } - #endregion - - #region arm - if (LeftShoulder != null) { yield return (LeftShoulder, HumanBodyBones.LeftShoulder); } - if (RightShoulder != null) { yield return (RightShoulder, HumanBodyBones.RightShoulder); } - if (LeftUpperArm != null) { yield return (LeftUpperArm, HumanBodyBones.LeftUpperArm); } - if (RightUpperArm != null) { yield return (RightUpperArm, HumanBodyBones.RightUpperArm); } - if (LeftLowerArm != null) { yield return (LeftLowerArm, HumanBodyBones.LeftLowerArm); } - if (RightLowerArm != null) { yield return (RightLowerArm, HumanBodyBones.RightLowerArm); } - if (LeftHand != null) { yield return (LeftHand, HumanBodyBones.LeftHand); } - if (RightHand != null) { yield return (RightHand, HumanBodyBones.RightHand); } - #endregion - - #region fingers - if (LeftThumbProximal != null) { yield return (LeftThumbProximal, HumanBodyBones.LeftThumbProximal); } - if (LeftThumbIntermediate != null) { yield return (LeftThumbIntermediate, HumanBodyBones.LeftThumbIntermediate); } - if (LeftThumbDistal != null) { yield return (LeftThumbDistal, HumanBodyBones.LeftThumbDistal); } - if (LeftIndexProximal != null) { yield return (LeftIndexProximal, HumanBodyBones.LeftIndexProximal); } - if (LeftIndexIntermediate != null) { yield return (LeftIndexIntermediate, HumanBodyBones.LeftIndexIntermediate); } - if (LeftIndexDistal != null) { yield return (LeftIndexDistal, HumanBodyBones.LeftIndexDistal); } - if (LeftMiddleProximal != null) { yield return (LeftMiddleProximal, HumanBodyBones.LeftMiddleProximal); } - if (LeftMiddleIntermediate != null) { yield return (LeftMiddleIntermediate, HumanBodyBones.LeftMiddleIntermediate); } - if (LeftMiddleDistal != null) { yield return (LeftMiddleDistal, HumanBodyBones.LeftMiddleDistal); } - if (LeftRingProximal != null) { yield return (LeftRingProximal, HumanBodyBones.LeftRingProximal); } - if (LeftRingIntermediate != null) { yield return (LeftRingIntermediate, HumanBodyBones.LeftRingIntermediate); } - if (LeftRingDistal != null) { yield return (LeftRingDistal, HumanBodyBones.LeftRingDistal); } - if (LeftLittleProximal != null) { yield return (LeftLittleProximal, HumanBodyBones.LeftLittleProximal); } - if (LeftLittleIntermediate != null) { yield return (LeftLittleIntermediate, HumanBodyBones.LeftLittleIntermediate); } - if (LeftLittleDistal != null) { yield return (LeftLittleDistal, HumanBodyBones.LeftLittleDistal); } - if (RightThumbProximal != null) { yield return (RightThumbProximal, HumanBodyBones.RightThumbProximal); } - if (RightThumbIntermediate != null) { yield return (RightThumbIntermediate, HumanBodyBones.RightThumbIntermediate); } - if (RightThumbDistal != null) { yield return (RightThumbDistal, HumanBodyBones.RightThumbDistal); } - if (RightIndexProximal != null) { yield return (RightIndexProximal, HumanBodyBones.RightIndexProximal); } - if (RightIndexIntermediate != null) { yield return (RightIndexIntermediate, HumanBodyBones.RightIndexIntermediate); } - if (RightIndexDistal != null) { yield return (RightIndexDistal, HumanBodyBones.RightIndexDistal); } - if (RightMiddleProximal != null) { yield return (RightMiddleProximal, HumanBodyBones.RightMiddleProximal); } - if (RightMiddleIntermediate != null) { yield return (RightMiddleIntermediate, HumanBodyBones.RightMiddleIntermediate); } - if (RightMiddleDistal != null) { yield return (RightMiddleDistal, HumanBodyBones.RightMiddleDistal); } - if (RightRingProximal != null) { yield return (RightRingProximal, HumanBodyBones.RightRingProximal); } - if (RightRingIntermediate != null) { yield return (RightRingIntermediate, HumanBodyBones.RightRingIntermediate); } - if (RightRingDistal != null) { yield return (RightRingDistal, HumanBodyBones.RightRingDistal); } - if (RightLittleProximal != null) { yield return (RightLittleProximal, HumanBodyBones.RightLittleProximal); } - if (RightLittleIntermediate != null) { yield return (RightLittleIntermediate, HumanBodyBones.RightLittleIntermediate); } - if (RightLittleDistal != null) { yield return (RightLittleDistal, HumanBodyBones.RightLittleDistal); } - #endregion - } - } - - /// - /// nodes からボーンを割り当てる - /// - /// - public void AssignBones(IEnumerable<(HumanBodyBones, Transform)> nodes) - { - foreach (var (key, value) in nodes) - { - if (key == HumanBodyBones.LastBone) - { - continue; - } - if (value is null) - { - continue; - } - - switch (key) - { - case HumanBodyBones.Hips: m_Hips = value; break; - - #region leg - case HumanBodyBones.LeftUpperLeg: m_LeftUpperLeg = value; break; - case HumanBodyBones.RightUpperLeg: m_RightUpperLeg = value; break; - case HumanBodyBones.LeftLowerLeg: m_LeftLowerLeg = value; break; - case HumanBodyBones.RightLowerLeg: m_RightLowerLeg = value; break; - case HumanBodyBones.LeftFoot: m_LeftFoot = value; break; - case HumanBodyBones.RightFoot: m_RightFoot = value; break; - case HumanBodyBones.LeftToes: m_LeftToes = value; break; - case HumanBodyBones.RightToes: m_RightToes = value; break; - #endregion - - #region spine - case HumanBodyBones.Spine: m_Spine = value; break; - case HumanBodyBones.Chest: m_Chest = value; break; - case HumanBodyBones.UpperChest: m_UpperChest = value; break; - case HumanBodyBones.Neck: m_Neck = value; break; - case HumanBodyBones.Head: m_Head = value; break; - case HumanBodyBones.LeftEye: m_LeftEye = value; break; - case HumanBodyBones.RightEye: m_RightEye = value; break; - case HumanBodyBones.Jaw: m_Jaw = value; break; - #endregion - - #region arm - case HumanBodyBones.LeftShoulder: m_LeftShoulder = value; break; - case HumanBodyBones.RightShoulder: m_RightShoulder = value; break; - case HumanBodyBones.LeftUpperArm: m_LeftUpperArm = value; break; - case HumanBodyBones.RightUpperArm: m_RightUpperArm = value; break; - case HumanBodyBones.LeftLowerArm: m_LeftLowerArm = value; break; - case HumanBodyBones.RightLowerArm: m_RightLowerArm = value; break; - case HumanBodyBones.LeftHand: m_LeftHand = value; break; - case HumanBodyBones.RightHand: m_RightHand = value; break; - #endregion - - #region fingers - case HumanBodyBones.LeftThumbProximal: m_LeftThumbProximal = value; break; - case HumanBodyBones.LeftThumbIntermediate: m_LeftThumbIntermediate = value; break; - case HumanBodyBones.LeftThumbDistal: m_LeftThumbDistal = value; break; - case HumanBodyBones.LeftIndexProximal: m_LeftIndexProximal = value; break; - case HumanBodyBones.LeftIndexIntermediate: m_LeftIndexIntermediate = value; break; - case HumanBodyBones.LeftIndexDistal: m_LeftIndexDistal = value; break; - case HumanBodyBones.LeftMiddleProximal: m_LeftMiddleProximal = value; break; - case HumanBodyBones.LeftMiddleIntermediate: m_LeftMiddleIntermediate = value; break; - case HumanBodyBones.LeftMiddleDistal: m_LeftMiddleDistal = value; break; - case HumanBodyBones.LeftRingProximal: m_LeftRingProximal = value; break; - case HumanBodyBones.LeftRingIntermediate: m_LeftRingIntermediate = value; break; - case HumanBodyBones.LeftRingDistal: m_LeftRingDistal = value; break; - case HumanBodyBones.LeftLittleProximal: m_LeftLittleProximal = value; break; - case HumanBodyBones.LeftLittleIntermediate: m_LeftLittleIntermediate = value; break; - case HumanBodyBones.LeftLittleDistal: m_LeftLittleDistal = value; break; - case HumanBodyBones.RightThumbProximal: m_RightThumbProximal = value; break; - case HumanBodyBones.RightThumbIntermediate: m_RightThumbIntermediate = value; break; - case HumanBodyBones.RightThumbDistal: m_RightThumbDistal = value; break; - case HumanBodyBones.RightIndexProximal: m_RightIndexProximal = value; break; - case HumanBodyBones.RightIndexIntermediate: m_RightIndexIntermediate = value; break; - case HumanBodyBones.RightIndexDistal: m_RightIndexDistal = value; break; - case HumanBodyBones.RightMiddleProximal: m_RightMiddleProximal = value; break; - case HumanBodyBones.RightMiddleIntermediate: m_RightMiddleIntermediate = value; break; - case HumanBodyBones.RightMiddleDistal: m_RightMiddleDistal = value; break; - case HumanBodyBones.RightRingProximal: m_RightRingProximal = value; break; - case HumanBodyBones.RightRingIntermediate: m_RightRingIntermediate = value; break; - case HumanBodyBones.RightRingDistal: m_RightRingDistal = value; break; - case HumanBodyBones.RightLittleProximal: m_RightLittleProximal = value; break; - case HumanBodyBones.RightLittleIntermediate: m_RightLittleIntermediate = value; break; - case HumanBodyBones.RightLittleDistal: m_RightLittleDistal = value; break; - #endregion - } - } - } - - /// - /// Animator から Bone を割り当てる - /// - /// - public bool AssignBonesFromAnimator() - { - var animator = GetComponent(); - if (animator == null) - { - return false; - } - var avatar = animator.avatar; - if (avatar == null) - { - return false; - } - if (!avatar.isValid) - { - return false; - } - if (!avatar.isHuman) - { - return false; - } - - var keys = (UnityEngine.HumanBodyBones[])Enum.GetValues(typeof(UnityEngine.HumanBodyBones)); - - AssignBones(keys.Select(x => - { - if (x == HumanBodyBones.LastBone) - { - return (HumanBodyBones.LastBone, null); - } - return ((HumanBodyBones)Enum.Parse(typeof(HumanBodyBones), x.ToString(), true), animator.GetBoneTransform(x)); - })); - - return true; - } - } -} diff --git a/Assets/MeshUtility/Runtime/Humanoid.cs.meta b/Assets/MeshUtility/Runtime/Humanoid.cs.meta deleted file mode 100644 index 53fc0f6d..00000000 --- a/Assets/MeshUtility/Runtime/Humanoid.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 889d98e41c0e8ff48bae50d1a729c2df -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Runtime/HumanoidLoader.cs b/Assets/MeshUtility/Runtime/HumanoidLoader.cs deleted file mode 100644 index 2a5d5252..00000000 --- a/Assets/MeshUtility/Runtime/HumanoidLoader.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace MeshUtility -{ - public static class HumanoidLoader - { - public static Avatar LoadHumanoidAvatar(Transform root, IEnumerable<(Transform, HumanBodyBones)> boneMap) - { - var description = new HumanDescription - { - skeleton = root.GetComponentsInChildren() - .Select(x => x.ToSkeletonBone()).ToArray(), - human = boneMap - .Select(x => new HumanBone - { - boneName = x.Item1.name, - humanName = s_humanTranitBoneNameMap[x.Item2], - limit = new HumanLimit - { - useDefaultValues = true, - } - }).ToArray(), - - armStretch = 0.05f, - legStretch = 0.05f, - upperArmTwist = 0.5f, - lowerArmTwist = 0.5f, - upperLegTwist = 0.5f, - lowerLegTwist = 0.5f, - feetSpacing = 0, - hasTranslationDoF = false, - }; - - return AvatarBuilder.BuildHumanAvatar(root.gameObject, description); - } - - static SkeletonBone ToSkeletonBone(this Transform t) - { - var sb = new SkeletonBone(); - sb.name = t.name; - sb.position = t.localPosition; - sb.rotation = t.localRotation; - sb.scale = t.localScale; - return sb; - } - - static HumanBodyBones TraitToHumanBone(string x) - { - return (HumanBodyBones)Enum.Parse(typeof(HumanBodyBones), x.Replace(" ", ""), true); - } - - static readonly Dictionary s_humanTranitBoneNameMap = - HumanTrait.BoneName.ToDictionary( - x => TraitToHumanBone(x), - x => x); - } -} diff --git a/Assets/MeshUtility/Runtime/HumanoidLoader.cs.meta b/Assets/MeshUtility/Runtime/HumanoidLoader.cs.meta deleted file mode 100644 index 02965556..00000000 --- a/Assets/MeshUtility/Runtime/HumanoidLoader.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 12453a111483e4145852e3b057e065d9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Runtime/MeshExtensions.cs b/Assets/MeshUtility/Runtime/MeshExtensions.cs deleted file mode 100644 index aa458d52..00000000 --- a/Assets/MeshUtility/Runtime/MeshExtensions.cs +++ /dev/null @@ -1,85 +0,0 @@ -using UnityEngine; -using System.Linq; - - -namespace MeshUtility -{ - public static class MeshExtensions - { - public static Mesh Copy(this Mesh src, bool copyBlendShape) - { - var dst = new Mesh(); - dst.name = src.name + "(copy)"; -#if UNITY_2017_3_OR_NEWER - dst.indexFormat = src.indexFormat; -#endif - - dst.vertices = src.vertices; - dst.normals = src.normals; - dst.tangents = src.tangents; - dst.colors = src.colors; - dst.uv = src.uv; - dst.uv2 = src.uv2; - dst.uv3 = src.uv3; - dst.uv4 = src.uv4; - dst.boneWeights = src.boneWeights; - dst.bindposes = src.bindposes; - - dst.subMeshCount = src.subMeshCount; - for (int i = 0; i < dst.subMeshCount; ++i) - { - dst.SetIndices(src.GetIndices(i), src.GetTopology(i), i); - } - - dst.RecalculateBounds(); - - if (copyBlendShape) - { - var vertices = src.vertices; - var normals = src.normals; -#if VRM_NORMALIZE_BLENDSHAPE_TANGENT - var tangents = src.tangents.Select(x => (Vector3)x).ToArray(); -#else - Vector3[] tangents = null; -#endif - - for (int i = 0; i < src.blendShapeCount; ++i) - { - src.GetBlendShapeFrameVertices(i, 0, vertices, normals, tangents); - dst.AddBlendShapeFrame( - src.GetBlendShapeName(i), - src.GetBlendShapeFrameWeight(i, 0), - vertices, - normals, - tangents - ); - } - } - - return dst; - } - - public static void ApplyRotationAndScale(this Mesh src, Matrix4x4 m) - { - m.SetColumn(3, new Vector4(0, 0, 0, 1)); // remove translation - src.ApplyMatrix(m); - } - - public static void ApplyMatrix(this Mesh src, Matrix4x4 m) - { - src.vertices = src.vertices.Select(x => m.MultiplyPoint(x)).ToArray(); - if (src.normals != null && src.normals.Length > 0) - { - src.normals = src.normals.Select(x => m.MultiplyVector(x)).ToArray(); - } - if (src.tangents != null && src.tangents.Length > 0) - { - src.tangents = src.tangents.Select(x => - { - var t = m.MultiplyVector((Vector3)x); - return new Vector4(t.x, t.y, t.z, x.w); - }).ToArray(); - } - } - } -} diff --git a/Assets/MeshUtility/Runtime/MeshExtensions.cs.meta b/Assets/MeshUtility/Runtime/MeshExtensions.cs.meta deleted file mode 100644 index 7485178c..00000000 --- a/Assets/MeshUtility/Runtime/MeshExtensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4181f0b5e9a271b45b3e995a38202780 -timeCreated: 1532506262 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Runtime/MeshIntegrationResult.cs b/Assets/MeshUtility/Runtime/MeshIntegrationResult.cs deleted file mode 100644 index 91742fc8..00000000 --- a/Assets/MeshUtility/Runtime/MeshIntegrationResult.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -namespace MeshUtility -{ - [System.Serializable] - public class MeshIntegrationResult - { - public List SourceSkinnedMeshRenderers = new List(); - public List SourceMeshRenderers = new List(); - public SkinnedMeshRenderer IntegratedRenderer; - } -} diff --git a/Assets/MeshUtility/Runtime/MeshIntegrationResult.cs.meta b/Assets/MeshUtility/Runtime/MeshIntegrationResult.cs.meta deleted file mode 100644 index 5f32450b..00000000 --- a/Assets/MeshUtility/Runtime/MeshIntegrationResult.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e1c66a21d479b3e4a92eedd622d27f4f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Runtime/MeshIntegrator.cs b/Assets/MeshUtility/Runtime/MeshIntegrator.cs deleted file mode 100644 index 34ba7005..00000000 --- a/Assets/MeshUtility/Runtime/MeshIntegrator.cs +++ /dev/null @@ -1,253 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace MeshUtility -{ - public class MeshIntegrator - { - public struct SubMesh - { - public List Indices; - public Material Material; - } - - public class BlendShape - { - public int VertexOffset; - public string Name; - public float FrameWeight; - public Vector3[] Positions; - public Vector3[] Normals; - public Vector3[] Tangents; - } - -// public List Renderers { get; private set; } - public List Positions { get; private set; } - public List Normals { get; private set; } - public List UV { get; private set; } - public List Tangents { get; private set; } - public List BoneWeights { get; private set; } - - public List SubMeshes - { - get; - private set; - } - - public List BindPoses { get; private set; } - public List Bones { get; private set; } - - public List BlendShapes { get; private set; } - public void AddBlendShapesToMesh(Mesh mesh) - { - Dictionary map = new Dictionary(); - - foreach (var x in BlendShapes) - { - BlendShape bs = null; - if (!map.TryGetValue(x.Name, out bs)) - { - bs = new BlendShape(); - bs.Positions = new Vector3[Positions.Count]; - bs.Normals = new Vector3[Normals.Count]; - bs.Tangents = new Vector3[Tangents.Count]; - bs.Name = x.Name; - bs.FrameWeight = x.FrameWeight; - map.Add(x.Name, bs); - } - - var j = x.VertexOffset; - for (int i = 0; i < x.Positions.Length; ++i, ++j) - { - bs.Positions[j] = x.Positions[i]; - bs.Normals[j] = x.Normals[i]; - bs.Tangents[j] = x.Tangents[i]; - } - } - - foreach (var kv in map) - { - //Debug.LogFormat("AddBlendShapeFrame: {0}", kv.Key); - mesh.AddBlendShapeFrame(kv.Key, kv.Value.FrameWeight, - kv.Value.Positions, kv.Value.Normals, kv.Value.Tangents); - } - } - - public MeshIntegrator() - { -// Renderers = new List(); - - Positions = new List(); - Normals = new List(); - UV = new List(); - Tangents = new List(); - BoneWeights = new List(); - - SubMeshes = new List(); - - BindPoses = new List(); - Bones = new List(); - - BlendShapes = new List(); - } - - static BoneWeight AddBoneIndexOffset(BoneWeight bw, int boneIndexOffset) - { - if (bw.weight0 > 0) bw.boneIndex0 += boneIndexOffset; - if (bw.weight1 > 0) bw.boneIndex1 += boneIndexOffset; - if (bw.weight2 > 0) bw.boneIndex2 += boneIndexOffset; - if (bw.weight3 > 0) bw.boneIndex3 += boneIndexOffset; - return bw; - } - - public void Push(MeshRenderer renderer) - { - var meshFilter = renderer.GetComponent(); - if (meshFilter == null) - { - Debug.LogWarningFormat("{0} has no mesh filter", renderer.name); - return; - } - var mesh = meshFilter.sharedMesh; - if (mesh == null) - { - Debug.LogWarningFormat("{0} has no mesh", renderer.name); - return; - } - - var indexOffset = Positions.Count; - var boneIndexOffset = Bones.Count; - - Positions.AddRange(mesh.vertices - .Select(x => renderer.transform.TransformPoint(x)) - ); - Normals.AddRange(mesh.normals - .Select(x => renderer.transform.TransformVector(x)) - ); - UV.AddRange(mesh.uv); - Tangents.AddRange(mesh.tangents - .Select(t => - { - var v = renderer.transform.TransformVector(t.x, t.y, t.z); - return new Vector4(v.x, v.y, v.z, t.w); - }) - ); - - var self = renderer.transform; - var bone = self.parent; - if (bone == null) - { - Debug.LogWarningFormat("{0} is root gameobject.", self.name); - return; - } - var bindpose = bone.worldToLocalMatrix; - - BoneWeights.AddRange(Enumerable.Range(0, mesh.vertices.Length) - .Select(x => new BoneWeight() - { - boneIndex0 = Bones.Count, - weight0 = 1, - }) - ); - - BindPoses.Add(bindpose); - Bones.Add(bone); - - for (int i = 0; i < mesh.subMeshCount; ++i) - { - var indices = mesh.GetIndices(i).Select(x => x + indexOffset); - var mat = renderer.sharedMaterials[i]; - var sameMaterialSubMeshIndex = SubMeshes.FindIndex(x => ReferenceEquals(x.Material, mat)); - if (sameMaterialSubMeshIndex >= 0) - { - SubMeshes[sameMaterialSubMeshIndex].Indices.AddRange(indices); - } - else - { - SubMeshes.Add(new SubMesh - { - Indices = indices.ToList(), - Material = mat, - }); - } - } - } - - public void Push(SkinnedMeshRenderer renderer) - { - var mesh = renderer.sharedMesh; - if (mesh == null) - { - Debug.LogWarningFormat("{0} has no mesh", renderer.name); - return; - } - -// Renderers.Add(renderer); - - var indexOffset = Positions.Count; - var boneIndexOffset = Bones.Count; - - Positions.AddRange(mesh.vertices); - Normals.AddRange(mesh.normals); - UV.AddRange(mesh.uv); - Tangents.AddRange(mesh.tangents); - - if (mesh.vertexCount == mesh.boneWeights.Length) - { - BoneWeights.AddRange(mesh.boneWeights.Select(x => AddBoneIndexOffset(x, boneIndexOffset)).ToArray()); - BindPoses.AddRange(mesh.bindposes); - Bones.AddRange(renderer.bones); - } - else - { - // Bone Count 0 の SkinnedMeshRenderer - var rigidBoneWeight = new BoneWeight - { - boneIndex0 = boneIndexOffset, - weight0 = 1f, - }; - BoneWeights.AddRange(Enumerable.Range(0, mesh.vertexCount).Select(x => rigidBoneWeight).ToArray()); - BindPoses.Add(renderer.transform.localToWorldMatrix); - Bones.Add(renderer.transform); - } - - for (int i = 0; i < mesh.subMeshCount; ++i) - { - var indices = mesh.GetIndices(i).Select(x => x + indexOffset); - var mat = renderer.sharedMaterials[i]; - var sameMaterialSubMeshIndex = SubMeshes.FindIndex(x => ReferenceEquals(x.Material, mat)); - if (sameMaterialSubMeshIndex >= 0) - { - SubMeshes[sameMaterialSubMeshIndex].Indices.AddRange(indices); - } - else - { - SubMeshes.Add(new SubMesh - { - Indices = indices.ToList(), - Material = mat, - }); - } - } - - for (int i = 0; i < mesh.blendShapeCount; ++i) - { - var positions = (Vector3[])mesh.vertices.Clone(); - var normals = (Vector3[])mesh.normals.Clone(); - var tangents = mesh.tangents.Select(x => (Vector3)x).ToArray(); - - mesh.GetBlendShapeFrameVertices(i, 0, positions, normals, tangents); - BlendShapes.Add(new BlendShape - { - VertexOffset = indexOffset, - FrameWeight = mesh.GetBlendShapeFrameWeight(i, 0), - Name = mesh.GetBlendShapeName(i), - Positions = positions, - Normals = normals, - Tangents = tangents, - }); - } - } - } -} \ No newline at end of file diff --git a/Assets/MeshUtility/Runtime/MeshIntegrator.cs.meta b/Assets/MeshUtility/Runtime/MeshIntegrator.cs.meta deleted file mode 100644 index 15921c89..00000000 --- a/Assets/MeshUtility/Runtime/MeshIntegrator.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 547dd57b50bf4820a570336659345084 -timeCreated: 1560168946 \ No newline at end of file diff --git a/Assets/MeshUtility/Runtime/MeshIntegratorUtility.cs b/Assets/MeshUtility/Runtime/MeshIntegratorUtility.cs deleted file mode 100644 index cfb1742e..00000000 --- a/Assets/MeshUtility/Runtime/MeshIntegratorUtility.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace MeshUtility -{ - public static class MeshIntegratorUtility - { - /// - /// go を root としたヒエラルキーから Renderer を集めて、統合された Mesh 作成する - /// - /// - /// BlendShapeを保持するSkinnedMeshRendererのみ/BlendShapeを保持しないSkinnedMeshRenderer + MeshRenderer - /// - public static MeshIntegrationResult Integrate(GameObject go, bool onlyBlendShapeRenderers) - { - var result = new MeshIntegrationResult(); - - var meshNode = new GameObject(); - if (onlyBlendShapeRenderers) - { - meshNode.name = "MeshIntegrator(BlendShape)"; - } - else - { - meshNode.name = "MeshIntegrator"; - } - meshNode.transform.SetParent(go.transform, false); - - // レンダラから情報を集める - var integrator = new MeshUtility.MeshIntegrator(); - - if (onlyBlendShapeRenderers) - { - foreach (var x in EnumerateSkinnedMeshRenderer(go.transform, true)) - { - integrator.Push(x); - result.SourceSkinnedMeshRenderers.Add(x); - } - } - else - { - foreach (var x in EnumerateSkinnedMeshRenderer(go.transform, false)) - { - integrator.Push(x); - result.SourceSkinnedMeshRenderers.Add(x); - } - - foreach (var x in EnumerateMeshRenderer(go.transform)) - { - integrator.Push(x); - result.SourceMeshRenderers.Add(x); - } - } - - var mesh = new Mesh(); - mesh.name = "integrated"; - - if (integrator.Positions.Count > ushort.MaxValue) - { - Debug.LogFormat("exceed 65535 vertices: {0}", integrator.Positions.Count); - mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32; - } - - mesh.vertices = integrator.Positions.ToArray(); - mesh.normals = integrator.Normals.ToArray(); - mesh.uv = integrator.UV.ToArray(); - mesh.tangents = integrator.Tangents.ToArray(); - mesh.boneWeights = integrator.BoneWeights.ToArray(); - mesh.subMeshCount = integrator.SubMeshes.Count; - for (var i = 0; i < integrator.SubMeshes.Count; ++i) - { - mesh.SetIndices(integrator.SubMeshes[i].Indices.ToArray(), MeshTopology.Triangles, i); - } - mesh.bindposes = integrator.BindPoses.ToArray(); - - if (onlyBlendShapeRenderers) - { - integrator.AddBlendShapesToMesh(mesh); - } - - var integrated = meshNode.AddComponent(); - integrated.sharedMesh = mesh; - integrated.sharedMaterials = integrator.SubMeshes.Select(x => x.Material).ToArray(); - integrated.bones = integrator.Bones.ToArray(); - result.IntegratedRenderer = integrated; - - return result; - } - - public static IEnumerable EnumerateSkinnedMeshRenderer(Transform root, bool hasBlendShape) - { - foreach (var x in Traverse(root)) - { - var renderer = x.GetComponent(); - if (renderer != null && - renderer.gameObject.activeInHierarchy && - renderer.sharedMesh != null && - renderer.enabled && - renderer.sharedMesh.blendShapeCount > 0 == hasBlendShape) - { - yield return renderer; - } - } - } - - public static IEnumerable EnumerateMeshRenderer(Transform root) - { - foreach (var x in Traverse(root)) - { - var renderer = x.GetComponent(); - var filter = x.GetComponent(); - - if (renderer != null && - filter != null && - renderer.gameObject.activeInHierarchy && - filter.sharedMesh != null) - { - yield return renderer; - } - } - } - - private static IEnumerable Traverse(Transform parent) - { - if (parent.gameObject.activeSelf) - { - yield return parent; - - foreach (Transform child in parent) - { - foreach (var x in Traverse(child)) - { - yield return x; - } - } - } - } - } -} \ No newline at end of file diff --git a/Assets/MeshUtility/Runtime/MeshIntegratorUtility.cs.meta b/Assets/MeshUtility/Runtime/MeshIntegratorUtility.cs.meta deleted file mode 100644 index b9075e71..00000000 --- a/Assets/MeshUtility/Runtime/MeshIntegratorUtility.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: a982d9d30c0145038245b0214dc2f2e4 -timeCreated: 1560190306 \ No newline at end of file diff --git a/Assets/MeshUtility/Runtime/MeshUtility.asmdef b/Assets/MeshUtility/Runtime/MeshUtility.asmdef deleted file mode 100644 index f161fcaf..00000000 --- a/Assets/MeshUtility/Runtime/MeshUtility.asmdef +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "MeshUtility" -} diff --git a/Assets/MeshUtility/Runtime/MeshUtility.asmdef.meta b/Assets/MeshUtility/Runtime/MeshUtility.asmdef.meta deleted file mode 100644 index 4085faa9..00000000 --- a/Assets/MeshUtility/Runtime/MeshUtility.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 71ab1919192903d44971eedbc26b24d1 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Runtime/UnityExtensions.cs b/Assets/MeshUtility/Runtime/UnityExtensions.cs deleted file mode 100644 index a772980d..00000000 --- a/Assets/MeshUtility/Runtime/UnityExtensions.cs +++ /dev/null @@ -1,319 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEngine; -#if UNITY_EDITOR -using UnityEditor; -#endif - - -namespace MeshUtility -{ - public struct PosRot - { - public Vector3 Position; - public Quaternion Rotation; - - public static PosRot FromGlobalTransform(Transform t) - { - return new PosRot - { - Position = t.position, - Rotation = t.rotation, - }; - } - } - - public class BlendShape - { - public string Name; - - public BlendShape(string name) - { - Name = name; - } - - public List Positions = new List(); - public List Normals = new List(); - public List Tangents = new List(); - } - - public static class UnityExtensions - { - public static Vector4 ReverseZ(this Vector4 v) - { - return new Vector4(v.x, v.y, -v.z, v.w); - } - - public static Vector3 ReverseZ(this Vector3 v) - { - return new Vector3(v.x, v.y, -v.z); - } - - [Obsolete] - public static Vector2 ReverseY(this Vector2 v) - { - return new Vector2(v.x, -v.y); - } - - public static Vector2 ReverseUV(this Vector2 v) - { - return new Vector2(v.x, 1.0f - v.y); - } - - public static Quaternion ReverseZ(this Quaternion q) - { - float angle; - Vector3 axis; - q.ToAngleAxis(out angle, out axis); - return Quaternion.AngleAxis(-angle, ReverseZ(axis)); - } - - public static Matrix4x4 Matrix4x4FromColumns(Vector4 c0, Vector4 c1, Vector4 c2, Vector4 c3) - { -#if UNITY_2017_1_OR_NEWER - return new Matrix4x4(c0, c1, c2, c3); -#else - var m = default(Matrix4x4); - m.SetColumn(0, c0); - m.SetColumn(1, c1); - m.SetColumn(2, c2); - m.SetColumn(3, c3); - return m; -#endif - } - - public static Matrix4x4 Matrix4x4FromRotation(Quaternion q) - { -#if UNITY_2017_1_OR_NEWER - return Matrix4x4.Rotate(q); -#else - var m = default(Matrix4x4); - m.SetTRS(Vector3.zero, q, Vector3.one); - return m; -#endif - } - - public static Matrix4x4 ReverseZ(this Matrix4x4 m) - { - m.SetTRS(m.ExtractPosition().ReverseZ(), m.ExtractRotation().ReverseZ(), m.ExtractScale()); - return m; - } - - public static Matrix4x4 MatrixFromArray(float[] values) - { - var m = new Matrix4x4(); - m.m00 = values[0]; - m.m10 = values[1]; - m.m20 = values[2]; - m.m30 = values[3]; - m.m01 = values[4]; - m.m11 = values[5]; - m.m21 = values[6]; - m.m31 = values[7]; - m.m02 = values[8]; - m.m12 = values[9]; - m.m22 = values[10]; - m.m32 = values[11]; - m.m03 = values[12]; - m.m13 = values[13]; - m.m23 = values[14]; - m.m33 = values[15]; - return m; - } - - // https://forum.unity.com/threads/how-to-assign-matrix4x4-to-transform.121966/ - public static Quaternion ExtractRotation(this Matrix4x4 matrix) - { - Vector3 forward; - forward.x = matrix.m02; - forward.y = matrix.m12; - forward.z = matrix.m22; - - Vector3 upwards; - upwards.x = matrix.m01; - upwards.y = matrix.m11; - upwards.z = matrix.m21; - - return Quaternion.LookRotation(forward, upwards); - } - - public static Vector3 ExtractPosition(this Matrix4x4 matrix) - { - Vector3 position; - position.x = matrix.m03; - position.y = matrix.m13; - position.z = matrix.m23; - return position; - } - - public static Vector3 ExtractScale(this Matrix4x4 matrix) - { - Vector3 scale; - scale.x = new Vector4(matrix.m00, matrix.m10, matrix.m20, matrix.m30).magnitude; - scale.y = new Vector4(matrix.m01, matrix.m11, matrix.m21, matrix.m31).magnitude; - scale.z = new Vector4(matrix.m02, matrix.m12, matrix.m22, matrix.m32).magnitude; - return scale; - } - - public static string RelativePathFrom(this Transform self, Transform root) - { - var path = new List(); - for (var current = self; current != null; current = current.parent) - { - if (current == root) - { - return String.Join("/", path.ToArray()); - } - - path.Insert(0, current.name); - } - - throw new Exception("no RelativePath"); - } - - public static Transform GetChildByName(this Transform self, string childName) - { - foreach (Transform child in self) - { - if (child.name == childName) - { - return child; - } - } - - throw new KeyNotFoundException(); - } - - public static Transform GetFromPath(this Transform self, string path) - { - var current = self; - - var split = path.Split('/'); - - foreach (var childName in split) - { - current = current.GetChildByName(childName); - } - - return current; - } - - public static IEnumerable GetChildren(this Transform self) - { - foreach (Transform child in self) - { - yield return child; - } - } - - public static IEnumerable Traverse(this Transform t) - { - yield return t; - foreach (Transform x in t) - { - foreach (Transform y in x.Traverse()) - { - yield return y; - } - } - } - - [Obsolete("Use FindDescendant(name)")] - public static Transform FindDescenedant(this Transform t, string name) - { - return FindDescendant(t, name); - } - - public static Transform FindDescendant(this Transform t, string name) - { - return t.Traverse().First(x => x.name == name); - } - - public static IEnumerable Ancestors(this Transform t) - { - yield return t; - if (t.parent != null) - { - foreach (Transform x in t.parent.Ancestors()) - { - yield return x; - } - } - } - - public static float[] ToArray(this Quaternion q) - { - return new float[] { q.x, q.y, q.z, q.w }; - } - - public static float[] ToArray(this Vector3 v) - { - return new float[] { v.x, v.y, v.z }; - } - - public static float[] ToArray(this Vector4 v) - { - return new float[] { v.x, v.y, v.z, v.w }; - } - - public static float[] ToArray(this Color c) - { - return new float[] { c.r, c.g, c.b, c.a }; - } - - public static void ReverseZRecursive(this Transform root) - { - var globalMap = root.Traverse().ToDictionary(x => x, x => PosRot.FromGlobalTransform(x)); - - foreach (var x in root.Traverse()) - { - x.position = globalMap[x].Position.ReverseZ(); - x.rotation = globalMap[x].Rotation.ReverseZ(); - } - } - - public static Mesh GetSharedMesh(this Transform t) - { - var meshFilter = t.GetComponent(); - if (meshFilter != null) - { - return meshFilter.sharedMesh; - } - - var skinnedMeshRenderer = t.GetComponent(); - if (skinnedMeshRenderer != null) - { - return skinnedMeshRenderer.sharedMesh; - } - - return null; - } - - public static Material[] GetSharedMaterials(this Transform t) - { - var renderer = t.GetComponent(); - if (renderer != null) - { - return renderer.sharedMaterials; - } - - return new Material[] { }; - } - - public static bool Has(this Transform transform, T t) where T : Component - { - return transform.GetComponent() == t; - } - - public static T GetOrAddComponent(this GameObject go) where T : Component - { - var c = go.GetComponent(); - if (c != null) - { - return c; - } - return go.AddComponent(); - } - } -} diff --git a/Assets/MeshUtility/Runtime/UnityExtensions.cs.meta b/Assets/MeshUtility/Runtime/UnityExtensions.cs.meta deleted file mode 100644 index 07785c58..00000000 --- a/Assets/MeshUtility/Runtime/UnityExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5294813527b3278458026afc820dd63d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/Runtime/UnityPath.cs b/Assets/MeshUtility/Runtime/UnityPath.cs deleted file mode 100644 index 24404741..00000000 --- a/Assets/MeshUtility/Runtime/UnityPath.cs +++ /dev/null @@ -1,435 +0,0 @@ -using System; -using System.IO; -using UnityEngine; -using System.Collections.Generic; -#if UNITY_EDITOR -using UnityEditor; -#endif - - -namespace MeshUtility -{ - /// - /// relative path from Unity project root. - /// For AssetDatabase. - /// - public struct UnityPath - { - #region UnityPath - public string Value - { - get; - private set; - } - - public override string ToString() - { - return string.Format("unity://{0}", Value); - } - - public bool IsNull - { - get { return Value == null; } - } - - public bool IsUnderAssetsFolder - { - get - { - if (IsNull) - { - return false; - } - return Value == "Assets" || Value.StartsWith("Assets/"); - } - } - - public bool IsStreamingAsset - { - get - { - if (IsNull) - { - return false; - } - - return FullPath.StartsWith(Application.streamingAssetsPath + "/"); - } - } - - public string FileName - { - get { return Path.GetFileName(Value); } - } - - public string FileNameWithoutExtension - { - get { return Path.GetFileNameWithoutExtension(Value); } - } - - public string Extension - { - get { return Path.GetExtension(Value); } - } - - public UnityPath Parent - { - get - { - if (IsNull) - { - return default(UnityPath); - } - - return new UnityPath(Path.GetDirectoryName(Value)); - } - } - - public bool HasParent - { - get - { - return !string.IsNullOrEmpty(Value); - } - } - - static readonly char[] EscapeChars = new char[] - { - '\\', - '/', - ':', - '*', - '?', - '"', - '<', - '>', - '|', - }; - - static string EscapeFilePath(string path) - { - foreach (var x in EscapeChars) - { - path = path.Replace(x, '+'); - } - return path; - } - - public UnityPath Child(string name) - { - if (IsNull) - { - throw new NotImplementedException(); - } - else if (Value == "") - { - return new UnityPath(name); - } - else - { - return new UnityPath(Value + "/" + name); - } - } - - public override int GetHashCode() - { - if (IsNull) - { - return 0; - } - return Value.GetHashCode(); - } - - public override bool Equals(object obj) - { - if(obj is UnityPath) - { - var rhs = (UnityPath)obj; - if(Value==null && rhs.Value == null) - { - return true; - } - else if (Value == null) - { - return false; - } - else if (rhs.Value == null) - { - return false; - } - else - { - return Value == rhs.Value; - } - } - else - { - return false; - } - } - - /// - /// Remove extension and add suffix - /// - /// - /// - /// - public UnityPath GetAssetFolder(string suffix) - { - if (!IsUnderAssetsFolder) - { - throw new NotImplementedException(); - } - - return new UnityPath( - string.Format("{0}/{1}{2}", - Parent.Value, - FileNameWithoutExtension, - suffix - )); - } - - UnityPath(string value) : this() - { - Value = value.Replace("\\", "/"); - } - - /// - /// - /// - /// Relative from unity current path. GetParent(Application.dataPath) - /// - public static UnityPath FromUnityPath(string unityPath) - { - if (String.IsNullOrEmpty(unityPath)) - { - return new UnityPath - { - Value="" - }; - } - return FromFullpath(Path.GetFullPath(unityPath)); - } - #endregion - - #region FullPath - static string s_basePath; - static string BaseFullPath - { - get - { - if (string.IsNullOrEmpty(s_basePath)) - { - s_basePath = Path.GetFullPath(Application.dataPath + "/..").Replace("\\", "/"); - } - return s_basePath; - } - } - - static string AssetFullPath - { - get - { - return BaseFullPath + "/Assets"; - } - } - - public string FullPath - { - get - { - if (IsNull) - { - throw new NotImplementedException(); - } - return Path.Combine(BaseFullPath, Value).Replace("\\", "/"); - } - } - - public bool IsFileExists - { - get { return File.Exists(FullPath); } - } - - public bool IsDirectoryExists - { - get { return Directory.Exists(FullPath); } - } - - /// - /// - /// - /// C:/path/to/file - /// - public static UnityPath FromFullpath(string fullPath) - { - if(fullPath == null) - { - fullPath = ""; - } - fullPath = fullPath.Replace("\\", "/"); - - if (fullPath == BaseFullPath) { - return new UnityPath - { - Value="" - }; - } - else if(fullPath.StartsWith(BaseFullPath + "/")) - { - return new UnityPath(fullPath.Substring(BaseFullPath.Length + 1)); - } - else - { - return default(UnityPath); - } - } - - public static bool IsUnderAssetFolder(string fullPath) - { - return fullPath.Replace("\\", "/").StartsWith(AssetFullPath); - } - #endregion - - [Obsolete("Use TraverseDir()")] - public IEnumerable TravserseDir() - { - return TraverseDir(); - } - - public IEnumerable TraverseDir() - { - if (IsDirectoryExists) - { - yield return this; - - foreach(var child in ChildDirs) - { - foreach(var x in child.TraverseDir()) - { - yield return x; - } - } - } - } - - public IEnumerable ChildDirs - { - get - { - foreach(var x in Directory.GetDirectories(FullPath)) - { - yield return UnityPath.FromFullpath(x); - } - } - } - - public IEnumerable ChildFiles - { - get - { - foreach (var x in Directory.GetFiles(FullPath)) - { - yield return UnityPath.FromFullpath(x); - } - } - } - -#if UNITY_EDITOR - public T GetImporter() where T : AssetImporter - { - return AssetImporter.GetAtPath(Value) as T; - } - - public static UnityPath FromAsset(UnityEngine.Object asset) - { - return new UnityPath(AssetDatabase.GetAssetPath(asset)); - } - - public void ImportAsset() - { - if (!IsUnderAssetsFolder) - { - throw new NotImplementedException(); - } - AssetDatabase.ImportAsset(Value); - } - - public void EnsureFolder() - { - if (IsNull) - { - throw new NotImplementedException(); - } - - if (HasParent) - { - Parent.EnsureFolder(); - } - - if (!IsDirectoryExists) - { - var parent = Parent; - // ensure parent - parent.ImportAsset(); - // create - AssetDatabase.CreateFolder( - parent.Value, - Path.GetFileName(Value) - ); - ImportAsset(); - } - } - - public UnityEngine.Object[] GetSubAssets() - { - if (!IsUnderAssetsFolder) - { - throw new NotImplementedException(); - } - - return AssetDatabase.LoadAllAssetsAtPath(Value); - } - - public void CreateAsset(UnityEngine.Object o) - { - if (!IsUnderAssetsFolder) - { - throw new NotImplementedException(); - } - - AssetDatabase.CreateAsset(o, Value); - } - - public void AddObjectToAsset(UnityEngine.Object o) - { - if (!IsUnderAssetsFolder) - { - throw new NotImplementedException(); - } - - AssetDatabase.AddObjectToAsset(o, Value); - } - - public T LoadAsset() where T : UnityEngine.Object - { - if (!IsUnderAssetsFolder) - { - throw new NotImplementedException(); - } - - return AssetDatabase.LoadAssetAtPath(Value); - } - - public UnityPath GenerateUniqueAssetPath() - { - if (!IsUnderAssetsFolder) - { - throw new NotImplementedException(); - } - - return new UnityPath(AssetDatabase.GenerateUniqueAssetPath(Value)); - } - #endif - } -} diff --git a/Assets/MeshUtility/Runtime/UnityPath.cs.meta b/Assets/MeshUtility/Runtime/UnityPath.cs.meta deleted file mode 100644 index f64923d8..00000000 --- a/Assets/MeshUtility/Runtime/UnityPath.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7b7af908694806c469d62ce0b5b2f06a -timeCreated: 1532326996 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MeshUtility/package.json b/Assets/MeshUtility/package.json deleted file mode 100644 index 1bb826ba..00000000 --- a/Assets/MeshUtility/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "com.vrmc.meshutility", - "version": "0.61.0", - "displayName": "MeshUtility", - "unity": "2018.4", - "description": "MeshUtility is a package for mesh separation, etc. \n\nCheck out the latest information here: ", - "keywords": [ - "mesh" - ], - "author": { - "name": "VRM Consortium" - } -} diff --git a/Assets/MeshUtility/package.json.meta b/Assets/MeshUtility/package.json.meta deleted file mode 100644 index e590e57a..00000000 --- a/Assets/MeshUtility/package.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8ae0f09270317494b8fe54cf2858ffc4 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/AdvancedInspector.meta b/Assets/Plugins/AdvancedInspector.meta deleted file mode 100644 index 88e09945..00000000 --- a/Assets/Plugins/AdvancedInspector.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: e2988672ababca043abe1b5c8852c4ec -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes.meta b/Assets/Plugins/AdvancedInspector/Attributes.meta deleted file mode 100644 index 37a6962f..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: f415bc03d4b29594193286c0bef51f76 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/AdvancedInspector.cs b/Assets/Plugins/AdvancedInspector/Attributes/AdvancedInspector.cs deleted file mode 100644 index 047710d5..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/AdvancedInspector.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Turn off the default Inspector in favor or the Advanced one. - /// If false, both may be draw if some members are flagged "Inspect", one after the other... - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = true)] - public class AdvancedInspectorAttribute : Attribute - { - private bool inspectDefaultItems = false; - - /// - /// If true, the Advanced Inspector inspect all the item the default Inspector does without adding the [Inspect] attribute. - /// You can still add item that Unity would not display by adding the [Inspect] attribute. - /// - public bool InspectDefaultItems - { - get { return inspectDefaultItems; } - set { inspectDefaultItems = value; } - } - - private bool showScript = true; - - /// - /// Show or hide the script field at the top of the inspector. - /// The script field allow to change the type of the object. - /// - public bool ShowScript - { - get { return showScript; } - set { showScript = value; } - } - - private bool expandable = true; - - /// - /// Is this object expandable in a in-lined context? - /// - public bool Expandable - { - get { return expandable; } - set { expandable = value; } - } - - public AdvancedInspectorAttribute() { } - - public AdvancedInspectorAttribute(bool inspectDefaultItems) - { - this.inspectDefaultItems = inspectDefaultItems; - } - - public AdvancedInspectorAttribute(bool inspectDefaultItems, bool showScript) - { - this.showScript = showScript; - this.inspectDefaultItems = inspectDefaultItems; - } - } -} diff --git a/Assets/Plugins/AdvancedInspector/Attributes/AdvancedInspector.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/AdvancedInspector.cs.meta deleted file mode 100644 index c0c82e2e..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/AdvancedInspector.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 37170739434a8a74bb0aae3f57b1ed64 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Angle.cs b/Assets/Plugins/AdvancedInspector/Attributes/Angle.cs deleted file mode 100644 index 8b80ade5..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Angle.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Turns a float/int into a spinning knob. - /// Because... Fancy. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class AngleAttribute : Attribute, IListAttribute - { - private float snap = -1; - - /// - /// Makes the control snap to the multiple of that value - /// Default; -1. Negative values turn this behaviour off. - /// - public float Snap - { - get { return snap; } - } - - public AngleAttribute() { } - - /// - /// If snap is -1, the snap is disable. - /// Snap makes the wheel "stick" to multiple of a fixed value. - /// - public AngleAttribute(float snap) - { - this.snap = snap; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Angle.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Angle.cs.meta deleted file mode 100644 index 1afd5dc4..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Angle.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ce761f6d5740bc9438033f37b24d3923 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Background.cs b/Assets/Plugins/AdvancedInspector/Attributes/Background.cs deleted file mode 100644 index e5ade555..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Background.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using UnityEngine; -using System.Reflection; -using System.Collections.Generic; - -namespace AdvancedInspector -{ - /// - /// Changes the color of the background of an expandable item. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Struct)] - public class BackgroundAttribute : Attribute, IRuntimeAttribute - { - public delegate Color BackgroundDelegate(); - public delegate Color BackgroundStaticDelegate(BackgroundAttribute background, object instance, object value); - - private Color color = Color.clear; - - /// - /// Give this item's background a color. - /// - public Color Color - { - get { return color; } - set { color = value; } - } - - #region IRuntime Implementation - private string methodName = ""; - - public string MethodName - { - get { return methodName; } - set { methodName = value; } - } - - public Type Template - { - get { return typeof(BackgroundDelegate); } - } - - public Type TemplateStatic - { - get { return typeof(BackgroundStaticDelegate); } - } - - private List delegates = new List(); - - public List Delegates - { - get { return delegates; } - set { delegates = value; } - } - - public Color Invoke(int index, object instance, object value) - { - if (delegates.Count == 0 || index >= delegates.Count) - return color; - - try - { - if (delegates[index].Target == null) - { - return (Color)delegates[index].DynamicInvoke(this, instance, value); - } - else - { - return (Color)delegates[index].DynamicInvoke(); - } - } - catch (Exception e) - { - if (e is TargetInvocationException) - e = ((TargetInvocationException)e).InnerException; - - Debug.LogError(string.Format("Invoking a method to retrieve a Background attribute failed. The exception was \"{0}\".", e.Message)); - return color; - } - } - #endregion - - public BackgroundAttribute(string methodName) - { - this.methodName = methodName; - } - - public BackgroundAttribute(Delegate method) - { - this.delegates.Add(method); - } - - public BackgroundAttribute(float r, float g, float b) - : this(r, g, b, 1) { } - - public BackgroundAttribute(float r, float g, float b, float a) - { - this.color = new Color(r, g, b, a); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Background.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Background.cs.meta deleted file mode 100644 index 71c26ea6..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Background.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4b99ed308d9ecd94eac01d3045a59165 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Bypass.cs b/Assets/Plugins/AdvancedInspector/Attributes/Bypass.cs deleted file mode 100644 index 3419ebb6..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Bypass.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Since internal Unity classes are not "Advanced Inspector" friendly, - /// this attribute force their own members to be exposed without the need of "InspectAttribute". - /// Be careful, all public property/fields will be exposed in a recursive manner. - /// This may expose stuff that were not meant to be exposed. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class BypassAttribute : Attribute, IListAttribute { } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Bypass.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Bypass.cs.meta deleted file mode 100644 index fb65f729..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Bypass.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: eae36bd4c4e7de04d920900da8944a23 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Collection.cs b/Assets/Plugins/AdvancedInspector/Attributes/Collection.cs deleted file mode 100644 index 2e9f870a..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Collection.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; - -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// When affixes to a collection, prevent this collection's size to be modified by the inspector. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class CollectionAttribute : Attribute, IListAttribute - { - private int size = -1; - - /// - /// Size of this collection. - /// Default -1; size is not controlled by code. - /// 0 means the collection's size will be handled internally. - /// > 0 indicate the same of the collection. - /// - public int Size - { - get { return size; } - set { size = value; } - } - - private bool sortable = true; - - /// - /// If true, the list can be sorted by hand. - /// - public bool Sortable - { - get { return sortable; } - set { sortable = value; } - } - - private CollectionDisplay display = CollectionDisplay.List; - - /// - /// If not default, removes the collection list and only display one item at a time. - /// - public CollectionDisplay Display - { - get { return display; } - set { display = value; } - } - - private int maxDisplayedItems = 25; - - /// - /// When a collection is very large, it get up/down arrows to scrolls in items instead of displaying them all. - /// This property controls how many items are displayed before the scrolls appears. - /// - public int MaxDisplayedItems - { - get { return maxDisplayedItems; } - set { maxDisplayedItems = value; } - } - - private int maxItemsPerRow = 6; - - /// - /// When display is using Button, this is the maximum number of button displayed per rows before creating a new one. - /// - public int MaxItemsPerRow - { - get { return maxItemsPerRow; } - set { maxItemsPerRow = value; } - } - - private Type enumType = null; - - /// - /// Bind the size of a collection to the values of an enum. - /// The name of the indexed are displayed using the enum values' names. - /// - public Type EnumType - { - get { return enumType; } - set - { - if (!value.IsEnum) - return; - - int index = 0; - foreach (object i in Enum.GetValues(value)) - { - if ((int)i != index) - return; - - index++; - } - - enumType = value; - } - } - - public CollectionAttribute() { } - - public CollectionAttribute(int size) - : this(size, true) { } - - public CollectionAttribute(Type enumType) - : this(enumType, true) { } - - public CollectionAttribute(bool sortable) - : this(-1, sortable) { } - - public CollectionAttribute(CollectionDisplay display) - : this(-1, true, display) { } - - public CollectionAttribute(int size, bool sortable) - : this(size, sortable, CollectionDisplay.List) { } - - public CollectionAttribute(Type enumType, bool sortable) - : this(enumType, sortable, CollectionDisplay.List) { } - - public CollectionAttribute(int size, CollectionDisplay display) - : this(size, true, display) { } - - public CollectionAttribute(Type enumType, CollectionDisplay display) - : this(enumType, true, display) { } - - public CollectionAttribute(int size, bool sortable, CollectionDisplay display) - { - this.size = size; - this.sortable = sortable; - this.display = display; - } - - public CollectionAttribute(Type enumType, bool sortable, CollectionDisplay display) - { - this.EnumType = enumType; - this.sortable = sortable; - this.display = display; - } - } - - /// - /// None default display should only be used on collection that contain expandable objects. - /// - public enum CollectionDisplay - { - List, - DropDown, - Button - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Collection.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Collection.cs.meta deleted file mode 100644 index 3024d617..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Collection.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fca33267bb5f8b043a4dd1079e32af1c -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Constructor.cs b/Assets/Plugins/AdvancedInspector/Attributes/Constructor.cs deleted file mode 100644 index 1b3f7438..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Constructor.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; - -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// Some object cannot be created with an empty constructor. - /// This runtime attribute lets you create the object by yourself. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class ConstructorAttribute : Attribute, IRuntimeAttribute - { - public delegate object ConstructorDelegate(); - public delegate object ConstructorStaticDelegate(ConstructorAttribute constructor, object instance, object value); - - #region IRuntime Implementation - private string methodName = ""; - - public string MethodName - { - get { return methodName; } - } - - public Type Template - { - get { return typeof(ConstructorDelegate); } - } - - public Type TemplateStatic - { - get { return typeof(ConstructorStaticDelegate); } - } - - private List delegates = new List(); - - public List Delegates - { - get { return delegates; } - set { delegates = value; } - } - - public object Invoke(int index, object instance, object value) - { - if (delegates.Count == 0 || index >= delegates.Count) - return null; - - try - { - if (delegates[index].Target == null) - { - return delegates[index].DynamicInvoke(this, instance, value); - } - else - { - return delegates[index].DynamicInvoke(); - } - } - catch (Exception e) - { - if (e is TargetInvocationException) - e = ((TargetInvocationException)e).InnerException; - - Debug.LogError(string.Format("Invoking a method from a constructor failed. The exception was \"{0}\".", e.Message)); - return null; - } - } - #endregion - - public ConstructorAttribute(string methodName) - { - this.methodName = methodName; - } - - public ConstructorAttribute(Delegate method) - { - this.delegates.Add(method); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Constructor.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Constructor.cs.meta deleted file mode 100644 index f333c05f..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Constructor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8e27defafd172764c9e999b947b2f4e6 -timeCreated: 1426031598 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/CreateDerived.cs b/Assets/Plugins/AdvancedInspector/Attributes/CreateDerived.cs deleted file mode 100644 index 3fac45f8..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/CreateDerived.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Define an exposed property that act as a object creator. - /// The field gives the user the choices of all type deriving from that property type. - /// In the case of a generic List, it offers way to add object in the list. - /// If the list is of a value type (Ex.: int), it automaticly create an entry with the default value of that type. - /// Field/Property's type sporting this attribute should derive from ComponentMonoBehaviour! - /// Otherwise, Unity's serialization will kill the polymorphism involved. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class CreateDerivedAttribute : Attribute, IListAttribute { } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/CreateDerived.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/CreateDerived.cs.meta deleted file mode 100644 index 2fcb841a..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/CreateDerived.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fe2444b9e8ef55340952cecad2cc75c0 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Descriptor.cs b/Assets/Plugins/AdvancedInspector/Attributes/Descriptor.cs deleted file mode 100644 index a452e72b..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Descriptor.cs +++ /dev/null @@ -1,262 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; - -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// A description is the information about "something". - /// It contains an optional name, description, icon, color. - /// It can be used both as a attributes or a normal object, container of information. - /// Ex.: The Toolbox is using it as object. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Class | - AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.Enum, Inherited = false)] - public class DescriptorAttribute : Attribute, IRuntimeAttribute - { - public delegate DescriptorAttribute DescriptorDelegate(); - public delegate DescriptorAttribute DescriptorStaticDelegate(DescriptorAttribute descriptor, object instance, object value); - - private static Color TRANSPARENT = new Color(0, 0, 0, 0); - - private string name = ""; - - /// - /// Give this item a name. - /// - public string Name - { - get { return name; } - set { name = value; } - } - - private string description = ""; - - /// - /// Give this item a description. - /// Usually used for tooltip. - /// - public string Description - { - get { return description; } - set { description = value; } - } - - private string url = ""; - - /// - /// Give this item an help URL. - /// - public string URL - { - get { return url; } - set { url = value; } - } - - private Texture icon = null; - - /// - /// Give this item an icon. - /// Useful in a list of items. - /// - public Texture Icon - { - get { return icon; } - set { icon = value; } - } - - private Color color = Color.clear; - - /// - /// Give this item a color. - /// Default is transparent - /// - public Color Color - { - get { return color; } - set { color = value; } - } - - #region IRuntime Implementation - private string methodName = ""; - - public string MethodName - { - get { return methodName; } - } - - public Type Template - { - get { return typeof(DescriptorDelegate); } - } - - public Type TemplateStatic - { - get { return typeof(DescriptorStaticDelegate); } - } - - private List delegates = new List(); - - public List Delegates - { - get { return delegates; } - set { delegates = value; } - } - - public DescriptorAttribute Invoke(int index, object instance, object value) - { - if (delegates.Count == 0 || index >= delegates.Count) - return this; - - try - { - if (delegates[index].Target == null) - { - return delegates[0].DynamicInvoke(this, instance, value) as DescriptorAttribute; - } - else - { - return delegates[0].DynamicInvoke() as DescriptorAttribute; - } - } - catch (Exception e) - { - if (e is TargetInvocationException) - e = ((TargetInvocationException)e).InnerException; - - Debug.LogError(string.Format("Invoking a method to retrieve a Destriptor attribute failed. The exception was \"{0}\".", e.Message)); - return null; - } - } - #endregion - - public DescriptorAttribute() { } - - #region Attributes Constructor - public DescriptorAttribute(string methodName) - { - this.methodName = methodName; - } - - public DescriptorAttribute(float r, float g, float b) - : this("", "", "", r, g, b, 1) { } - - public DescriptorAttribute(string name, string description) - : this(name, description, "", 0, 0, 0, 0) { } - - public DescriptorAttribute(string name, string description, string url) - : this(name, description, url, 0, 0, 0, 0) { } - - public DescriptorAttribute(string name, string description, string url, float r, float g, float b) - : this(name, description, url, r, g, b, 1) { } - - private DescriptorAttribute(string name, string description, string url, float r, float g, float b, float a) - { - this.name = name; - this.description = description; - this.url = url; - color = new Color(r, g, b, a); - } - #endregion - - #region Object Constructor - public DescriptorAttribute(string name, string description, Texture icon) - : this(name, description, icon, TRANSPARENT) { } - - public DescriptorAttribute(string name, string description, Texture icon, Color color) - { - this.name = name; - this.description = description; - this.icon = icon; - this.color = color; - } - #endregion - - public static DescriptorAttribute GetDescriptor(Type type) - { - object[] obj = type.GetCustomAttributes(typeof(DescriptorAttribute), true); - - if (obj.Length == 0) - return null; - else - return (obj[0] as DescriptorAttribute); - } - - public static List GetDescriptors(List types) - { - List descriptors = new List(); - - foreach (Type type in types) - descriptors.Add(GetDescriptor(type)); - - return descriptors; - } - } - - /// - /// Pairs an object with a descriptor. - /// Used by the Toolbox and the Advanced Inspector. - /// - public class DescriptorPair - { - private object value; - - public object Value - { - get { return value; } - } - - private DescriptorAttribute descriptor; - - public DescriptorAttribute Descriptor - { - get { return descriptor; } - } - - public DescriptorPair(object value, DescriptorAttribute descriptor) - { - this.value = value; - this.descriptor = descriptor; - } - - public DescriptorPair(object value, string name) - : this(value, new DescriptorAttribute(name, "")) { } - - public DescriptorPair(object value, string name, string description) - : this(value, new DescriptorAttribute(name, description)) { } - - public static bool operator ==(DescriptorPair a, DescriptorPair b) - { - // If both are null, or both are same instance, return true. - if (System.Object.ReferenceEquals(a, b)) - return true; - - // If one is null, but not both, return false. - if (((object)a == null) || ((object)b == null)) - return false; - - return a.Equals(b); - } - - public static bool operator !=(DescriptorPair a, DescriptorPair b) - { - return !(a == b); - } - - public override bool Equals(object obj) - { - DescriptorPair other = obj as DescriptorPair; - if (other == null) - return false; - - return this.Value.Equals(other.Value); - } - - public override int GetHashCode() - { - return base.GetHashCode(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Descriptor.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Descriptor.cs.meta deleted file mode 100644 index eee13f0a..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Descriptor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c543914d76893214f9fceba693c0ed76 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/DisplayAsParent.cs b/Assets/Plugins/AdvancedInspector/Attributes/DisplayAsParent.cs deleted file mode 100644 index acec32e9..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/DisplayAsParent.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Prevent a nested object from having to be unfolded. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class DisplayAsParentAttribute : Attribute { } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/DisplayAsParent.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/DisplayAsParent.cs.meta deleted file mode 100644 index 3632a07b..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/DisplayAsParent.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3fca13597b0728d41a25aa9d670f0b86 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/DontAllowSceneObject.cs b/Assets/Plugins/AdvancedInspector/Attributes/DontAllowSceneObject.cs deleted file mode 100644 index 7c8506a6..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/DontAllowSceneObject.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Prevent Scene Object from being browsed in a Object property. - /// By default, scene and asset are displayed. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class DontAllowSceneObjectAttribute : Attribute, IListAttribute { } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/DontAllowSceneObject.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/DontAllowSceneObject.cs.meta deleted file mode 100644 index 72b6f6c1..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/DontAllowSceneObject.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 819e08560dc14324ebaa532c3f65751a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Enum.cs b/Assets/Plugins/AdvancedInspector/Attributes/Enum.cs deleted file mode 100644 index f9b88281..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Enum.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Controls how an enum is handled and displayed. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class EnumAttribute : Attribute, IListAttribute - { - private bool masked = false; - - /// - /// Turns a normal enum into a bitfield. - /// Careful, your enum should be properly setup to accepted bitfield input. - /// - public bool Masked - { - get { return masked; } - set { masked = value; } - } - - private EnumDisplay display = EnumDisplay.DropDown; - - /// - /// Forces an enum to be displayed differently. - /// - public EnumDisplay Display - { - get { return display; } - set { display = value; } - } - - private int maxItemsPerRow = 6; - - /// - /// When display is using Button or Checkbox, this is the maximum number of button displayed per rows before creating a new one. - /// - public int MaxItemsPerRow - { - get { return maxItemsPerRow; } - set { maxItemsPerRow = value; } - } - - public EnumAttribute(bool masked) - { - this.masked = masked; - } - - public EnumAttribute(EnumDisplay display) - { - this.display = display; - } - - public EnumAttribute(bool masked, EnumDisplay display) - { - this.masked = masked; - this.display = display; - } - } - - public enum EnumDisplay - { - DropDown, - Button, - Checkbox - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Enum.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Enum.cs.meta deleted file mode 100644 index d47eb345..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Enum.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6bb7fceb011c74e43a49f0124591cb7e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Expandable.cs b/Assets/Plugins/AdvancedInspector/Attributes/Expandable.cs deleted file mode 100644 index b63d5c38..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Expandable.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Redefine if a field/property can be expanded or not. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true)] - public class ExpandableAttribute : Attribute, IListAttribute - { - private bool expanded = false; - - /// - /// Makes the item expanded by default. - /// - public bool Expanded - { - get { return expanded; } - set { expanded = value; } - } - - private bool expandable = true; - - /// - /// Default true, can force a field to not be expandable. - /// - public bool Expandable - { - get { return expandable; } - set { expandable = value; } - } - - public ExpandableAttribute() { } - - public ExpandableAttribute(bool expandable) - { - this.expandable = expandable; - } - - public ExpandableAttribute(bool expandable, bool expanded) - { - this.expanded = expanded; - this.expandable = expandable; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Expandable.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Expandable.cs.meta deleted file mode 100644 index 60aef708..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Expandable.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 574c9c65c35362d4c81087ea01d49be7 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/FieldEditor.cs b/Assets/Plugins/AdvancedInspector/Attributes/FieldEditor.cs deleted file mode 100644 index b5c833d9..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/FieldEditor.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Can only be placed a classed derived from FieldEditor, or a field/property taking a specific editor. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class FieldEditorAttribute : Attribute, IListAttribute - { - private string type = ""; - - /// - /// Type's name of the FieldEditor to use. - /// - public string Type - { - get { return type; } - } - - public FieldEditorAttribute(string type) - { - this.type = type; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/FieldEditor.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/FieldEditor.cs.meta deleted file mode 100644 index 7be7565f..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/FieldEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 48265bc16ba070a4f9c105cdd29d2805 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Group.cs b/Assets/Plugins/AdvancedInspector/Attributes/Group.cs deleted file mode 100644 index e95709ad..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Group.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// Allow to groups inspector items. - /// - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Method)] - public class GroupAttribute : Attribute - { - private string name = ""; - - /// - /// Name of the group. - /// - public string Name - { - get { return name; } - set { name = value; } - } - - private string description = ""; - - /// - /// Extra text for the group, displayed on the right side. - /// - public string Description - { - get { return description; } - set { description = value; } - } - - private string style = ""; - - /// - /// Style of this group. - /// Only need to be flagged on one item. - /// - public string Style - { - get { return style; } - set { style = value; } - } - - private int priority = 0; - - /// - /// Priority of this group when sorting items. - /// Only need to be flagged on one item. - /// - public int Priority - { - get { return priority; } - set { priority = value; } - } - - private bool expandable = true; - - /// - /// If false, the group is always expanded and does not have an foldout arrow. - /// - public bool Expandable - { - get { return expandable; } - set { expandable = value; } - } - - private Color color = Color.clear; - - /// - /// Give this item's background a color. - /// - public Color Color - { - get { return color; } - set { color = value; } - } - - public GroupAttribute(string name) - : this(name, "", 0) { } - - public GroupAttribute(string name, int priority) - : this(name, "", priority) { } - - public GroupAttribute(string name, string style) - : this(name, style, 0) { } - - public GroupAttribute(string name, float r, float g, float b) - : this(name, "", "", 0, r, g, b, 1) { } - - public GroupAttribute(string name, string style, int priority) - : this(name, "", style, priority, 0, 0, 0, 0) { } - - public GroupAttribute(string name, string style, float r, float g, float b) - : this(name, "", style, 0, r, g, b, 1) { } - - public GroupAttribute(string name, string style, int priority, float r, float g, float b) - : this(name, "", style, priority, r, g, b, 1) { } - - public GroupAttribute(string name, string description, string style, int priority, float r, float g, float b, float a) - { - this.name = name; - this.description = description; - this.style = style; - this.priority = priority; - this.color = new Color(r, g, b, a); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Group.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Group.cs.meta deleted file mode 100644 index 2a0b75a8..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Group.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 363188602a056ed47970a96a0f55d619 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Help.cs b/Assets/Plugins/AdvancedInspector/Attributes/Help.cs deleted file mode 100644 index ea4825d9..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Help.cs +++ /dev/null @@ -1,199 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; - -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// When a property is flagged this way, a help box is added after the inspector's field. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = true)] - public class HelpAttribute : Attribute, IRuntimeAttribute - { - public const string IsNull = "HelpAttribute.IsValueNull"; - public const string IsNullOrEmpty = "HelpAttribute.IsStringNullOrEmpty"; - public const string IsMatch = "HelpAttribute.IsRegexMatch"; - - - public delegate HelpAttribute HelpDelegate(); - public delegate HelpAttribute HelpStaticDelegate(HelpAttribute help, object instance, object value); - - private HelpType type; - - /// - /// Help type. - /// Displays a specific icon. - /// - public HelpType Type - { - get { return type; } - set { type = value; } - } - - private string message; - - /// - /// Help message. - /// - public string Message - { - get { return message; } - set { message = value; } - } - - private HelpPosition position = HelpPosition.After; - - /// - /// By default, the helpbox is drawn after the field. - /// If this is false, it is drawn before the field. - /// - public HelpPosition Position - { - get { return position; } - set { position = value; } - } - - private string regex; - - /// - /// When using the IsRegex conditional, this string is used as a regular expresion. - /// - public string Regex - { - get { return regex; } - set { regex = value; } - } - - #region IRuntime Implementation - private string methodName = ""; - - public string MethodName - { - get { return methodName; } - } - - public Type Template - { - get { return typeof(HelpDelegate); } - } - - public Type TemplateStatic - { - get { return typeof(HelpStaticDelegate); } - } - - private List delegates = new List(); - - public List Delegates - { - get { return delegates; } - set { delegates = value; } - } - - public HelpAttribute Invoke(int index, object instance, object value) - { - if (delegates.Count == 0 || index >= delegates.Count) - return this; - - try - { - if (delegates[index].Target == null) - { - return delegates[0].DynamicInvoke(this, instance, value) as HelpAttribute; - } - else - { - return delegates[0].DynamicInvoke() as HelpAttribute; - } - } - catch (Exception e) - { - if (e is TargetInvocationException) - e = ((TargetInvocationException)e).InnerException; - - Debug.LogError(string.Format("Invoking a method failed while trying to retrieve a Help attribute. The exception was \"{0}\".", e.Message)); - return null; - } - } - #endregion - - public HelpAttribute(string methodName) - : this(methodName, HelpType.None, HelpPosition.After, "") { } - - public HelpAttribute(string methodName, HelpType type, string message) - : this(methodName, type, HelpPosition.After, message) { } - - public HelpAttribute(HelpType type, string message) - : this("", type, HelpPosition.After, message) { } - - public HelpAttribute(HelpType type, HelpPosition position, string message) - : this("", type, position, message) { } - - public HelpAttribute(string methodName, HelpType type, HelpPosition position, string message) - { - this.methodName = methodName; - this.type = type; - this.position = position; - this.message = message; - } - - public HelpAttribute(Delegate method) - { - this.delegates.Add(method); - } - - private static HelpAttribute IsValueNull(HelpAttribute help, object instance, object value) - { - if (value == null || (value is UnityEngine.Object && ((UnityEngine.Object)value) == null)) - { - return help; - } - - return null; - } - - private static HelpAttribute IsStringNullOrEmpty(HelpAttribute help, object instance, object value) - { - if (value is string && string.IsNullOrEmpty((string)value)) - return help; - - return null; - } - - private static HelpAttribute IsRegexMatch(HelpAttribute help, object instance, object value) - { - if (value == null) - return null; - - string text = value.ToString(); - if (System.Text.RegularExpressions.Regex.IsMatch(text, help.regex)) - return help; - - return null; - } - } - - /// - /// Because the internal enum for help display is Editor only. - /// - public enum HelpType - { - None = 0, - Info = 1, - Warning = 2, - Error = 3, - } - - /// - /// The position where the help box should be placed. - /// - public enum HelpPosition - { - After, - Before - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Help.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Help.cs.meta deleted file mode 100644 index 1d663fe8..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Help.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d071ab40c60bc8a458f4e2578a30440e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Inspect.cs b/Assets/Plugins/AdvancedInspector/Attributes/Inspect.cs deleted file mode 100644 index 210e3558..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Inspect.cs +++ /dev/null @@ -1,195 +0,0 @@ -using System; -using System.Reflection; -using System.Collections.Generic; -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// Makes a property viewable in the Inspector of Unity. - /// Turns a method into a button in the Inspector. - /// You can input a conditional statement for your property to show up or not. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method)] - public class InspectAttribute : Attribute, IRuntimeAttribute - { - public delegate bool InspectDelegate(); - public delegate bool InspectStaticDelegate(InspectAttribute inspect, object instance, object value); - - private InspectorLevel level; - - /// - /// Inspector level are use to hide more advanced item. - /// Items under the current Inspector levels are hidden. - /// - public InspectorLevel Level - { - get { return level; } - set { level = value; } - } - - private bool condition = true; - - /// - /// Inverse the condition used by the IRuntime method. - /// - public bool Condition - { - get { return condition; } - set { condition = value; } - } - - private int priority = 0; - - /// - /// Priority of display of this item. - /// Smaller values are displayed first. Negative value are supported. - /// - public int Priority - { - get { return priority; } - set { priority = value; } - } - - #region IRuntime Implementation - private string methodName = ""; - - public string MethodName - { - get { return methodName; } - set { methodName = value; } - } - - public Type Template - { - get { return typeof(InspectDelegate); } - } - - public Type TemplateStatic - { - get { return typeof(InspectStaticDelegate); } - } - - private List delegates = new List(); - - public List Delegates - { - get { return delegates; } - set { delegates = value; } - } - - public bool Invoke(int index, object instance, object value) - { - if (delegates.Count == 0 || index >= delegates.Count) - return true; - - try - { - if (delegates[index].Target == null) - { - if (condition) - return (bool)delegates[index].DynamicInvoke(this, instance, value); - else - return !(bool)delegates[index].DynamicInvoke(this, instance, value); - } - else - { - if (condition) - return (bool)delegates[index].DynamicInvoke(); - else - return !(bool)delegates[index].DynamicInvoke(); - } - } - catch (Exception e) - { - if (e is TargetInvocationException) - e = ((TargetInvocationException)e).InnerException; - - Debug.LogError(string.Format("Invoking a method to retrieve a Inspect attribute failed. The exception was \"{0}\".", e.Message)); - return true; - } - } - #endregion - - #region Compile Time Constructor - public InspectAttribute() - : this(InspectorLevel.Basic, "", true, 0) { } - - public InspectAttribute(int priority) - : this(InspectorLevel.Basic, "", true, priority) { } - - public InspectAttribute(InspectorLevel level) - : this(level, "", true, 0) { } - - public InspectAttribute(InspectorLevel level, int priority) - : this(level, "", true, priority) { } - - public InspectAttribute(InspectorLevel level, string methodName) - : this(level, methodName, true, 0) { } - - public InspectAttribute(InspectorLevel level, string methodName, int priority) - : this(level, methodName, true, priority) { } - - public InspectAttribute(InspectorLevel level, string methodName, bool condition) - : this(level, methodName, condition, 0) { } - - public InspectAttribute(string methodName) - : this(InspectorLevel.Basic, methodName, true, 0) { } - - public InspectAttribute(string methodName, int priority) - : this(InspectorLevel.Basic, methodName, true, priority) { } - - public InspectAttribute(string methodName, bool condition) - : this(InspectorLevel.Basic, methodName, condition, 0) { } - - public InspectAttribute(string methodName, bool condition, int priority) - : this(InspectorLevel.Basic, methodName, condition, priority) { } - - public InspectAttribute(InspectorLevel level, string methodName, bool condition, int priority) - { - this.level = level; - this.condition = condition; - this.methodName = methodName; - this.priority = priority; - } - #endregion - - #region Runtime Constructor - public InspectAttribute(Delegate method) - : this(InspectorLevel.Basic, method, true, 0) { } - - public InspectAttribute(Delegate method, int priority) - : this(InspectorLevel.Basic, method, true, priority) { } - - public InspectAttribute(Delegate method, bool condition) - : this(InspectorLevel.Basic, method, condition, 0) { } - - public InspectAttribute(Delegate method, bool condition, int priority) - : this(InspectorLevel.Basic, method, condition, priority) { } - - public InspectAttribute(InspectorLevel level, Delegate method) - : this(level, method, true, 0) { } - - public InspectAttribute(InspectorLevel level, Delegate method, int priority) - : this(level, method, true, priority) { } - - public InspectAttribute(InspectorLevel level, Delegate method, bool condition, int priority) - { - this.level = level; - this.condition = condition; - this.priority = priority; - this.delegates.Add(method); - } - #endregion - } - - /// - /// You can change or add your own levels. - /// - public enum InspectorLevel - { - Basic = 0, - Advanced = 1, - Debug = 2 - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Inspect.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Inspect.cs.meta deleted file mode 100644 index f3b0b2fc..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Inspect.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b1d1add23978a924d9da822c16ecca5d -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Method.cs b/Assets/Plugins/AdvancedInspector/Attributes/Method.cs deleted file mode 100644 index df08abc8..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Method.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace AdvancedInspector -{ - /// - /// Used when inspected a method, gives control over how it is displayed or handled. - /// - [AttributeUsage(AttributeTargets.Method)] - public class MethodAttribute : Attribute - { - private MethodDisplay display = MethodDisplay.Button; - - public MethodDisplay Display - { - get { return display; } - set { display = value; } - } - - public MethodAttribute() { } - - public MethodAttribute(MethodDisplay display) - { - this.display = display; - } - } - - - /// - /// How the method is displayed. - /// - public enum MethodDisplay - { - Button, // A button - Invoke // Invoke it so it draws its own stuff. - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Method.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Method.cs.meta deleted file mode 100644 index 7738c797..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Method.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d18c976511db4614f89166425f46b342 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/NoPicker.cs b/Assets/Plugins/AdvancedInspector/Attributes/NoPicker.cs deleted file mode 100644 index 0619ccec..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/NoPicker.cs +++ /dev/null @@ -1,13 +0,0 @@ -using UnityEngine; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - /// - /// Removes the object picking field from a selectable object. - /// Useful when the object is set internally, should be edited but not changed. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class NoPicker : Attribute, IListAttribute { } -} diff --git a/Assets/Plugins/AdvancedInspector/Attributes/NoPicker.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/NoPicker.cs.meta deleted file mode 100644 index 00643d66..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/NoPicker.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 76bfee0f7aa5c3e429aae6af201d0f66 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/RangeValue.cs b/Assets/Plugins/AdvancedInspector/Attributes/RangeValue.cs deleted file mode 100644 index a0331216..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/RangeValue.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Similar to Unity's "Range" attribute but for the Advanced Inspector. - /// However, Unity's version is flagged to be "Field Only", while this one can be placed on Properties. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class RangeValueAttribute : Attribute, IListAttribute - { - private float min; - - /// - /// Min value, the current value cannot go below that. - /// - public float Min - { - get { return min; } - set { min = value; } - } - - private float max; - - /// - /// Max value, the current value cannot go above that. - /// - public float Max - { - get { return max; } - set { max = value; } - } - - public RangeValueAttribute(float min, float max) - { - this.min = min; - this.max = max; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/RangeValue.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/RangeValue.cs.meta deleted file mode 100644 index 780732c1..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/RangeValue.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 214bf4d5f010cd14f8f02b9debfca40d -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/ReadOnly.cs b/Assets/Plugins/AdvancedInspector/Attributes/ReadOnly.cs deleted file mode 100644 index 145f1167..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/ReadOnly.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; - -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// Makes a Property read only (cannot be modified) - /// It's grayed out in the inspector, even if there's a setter. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false)] - public class ReadOnlyAttribute : Attribute, IListAttribute, IRuntimeAttribute - { - public delegate bool ReadOnlyDelegate(); - public delegate bool ReadOnlyStaticDelegate(ReadOnlyAttribute readOnly, object instance, object value); - - #region IRuntime Implementation - private string methodName = ""; - - public string MethodName - { - get { return methodName; } - } - - public Type Template - { - get { return typeof(ReadOnlyDelegate); } - } - - public Type TemplateStatic - { - get { return typeof(ReadOnlyStaticDelegate); } - } - - private List delegates = new List(); - - public List Delegates - { - get { return delegates; } - set { delegates = value; } - } - - public bool Invoke(int index, object instance, object value) - { - if (delegates.Count == 0 || index >= delegates.Count) - return true; - - try - { - if (delegates[index].Target == null) - { - return (bool)delegates[index].DynamicInvoke(this, instance, value); - } - else - { - return (bool)delegates[index].DynamicInvoke(); - } - } - catch (Exception e) - { - if (e is TargetInvocationException) - e = ((TargetInvocationException)e).InnerException; - - Debug.LogError(string.Format("Invoking a method to retrieve a ReadOnly attribute failed. The exception was \"{0}\".", e.Message)); - return false; - } - } - #endregion - - public ReadOnlyAttribute() { } - - public ReadOnlyAttribute(Delegate method) - { - this.delegates.Add(method); - } - - public ReadOnlyAttribute(string methodName) - { - this.methodName = methodName; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/ReadOnly.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/ReadOnly.cs.meta deleted file mode 100644 index d0993047..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/ReadOnly.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 807b8f48dfd4f724d979f453c48556e1 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Restrict.cs b/Assets/Plugins/AdvancedInspector/Attributes/Restrict.cs deleted file mode 100644 index 43d48f76..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Restrict.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// Restrict an object field to a list of object define by a delegate from the owner. - /// In essence, turn any field into a drop down list of choices. - /// Attributes cannot recieve a delegate, instead you pass the name of the method. - /// The method itself is resolved when creating the field to know which instance to invoke. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class RestrictAttribute : Attribute, IListAttribute, IRuntimeAttribute - { - public delegate IList RestrictDelegate(); - public delegate IList RestrictStaticDelegate(RestrictAttribute restrict, object instance, object value); - - private RestrictDisplay display = RestrictDisplay.DropDown; - - /// - /// Should this restricted field use the toolbox instead of a drop down popup. - /// - public RestrictDisplay Display - { - get { return display; } - set { display = value; } - } - - private int maxItemsPerRow = 6; - - /// - /// When display is using Button, limits the number of items per row. - /// - public int MaxItemsPerRow - { - get { return maxItemsPerRow; } - set { maxItemsPerRow = value; } - } - - #region IRuntime Implementation - private string methodName = ""; - - public string MethodName - { - get { return methodName; } - } - - public Type Template - { - get { return typeof(RestrictDelegate); } - } - - public Type TemplateStatic - { - get { return typeof(RestrictStaticDelegate); } - } - - private List delegates = new List(); - - public List Delegates - { - get { return delegates; } - set { delegates = value; } - } - - public IList Invoke(int index, object instance, object value) - { - if (delegates.Count == 0 || index >= delegates.Count) - return null; - - try - { - if (delegates[index].Target == null) - { - return delegates[index].DynamicInvoke(this, instance, value) as IList; - } - else - { - return delegates[index].DynamicInvoke() as IList; - } - } - catch (Exception e) - { - if (e is TargetInvocationException) - e = ((TargetInvocationException)e).InnerException; - - Debug.LogError(string.Format("Invoking a method to retrieve a Restrict attribute data failed. The exception was \"{0}\".", e.Message)); - return null; - } - } - #endregion - - public RestrictAttribute(string methodName) - : this(methodName, RestrictDisplay.DropDown) { } - - public RestrictAttribute(string methodName, RestrictDisplay display) - { - this.methodName = methodName; - this.display = display; - } - - public RestrictAttribute(Delegate method) - : this(method, RestrictDisplay.DropDown) { } - - public RestrictAttribute(Delegate method, RestrictDisplay display) - { - this.delegates.Add(method); - this.display = display; - } - } - - public enum RestrictDisplay - { - DropDown, - Toolbox, - Button - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Restrict.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Restrict.cs.meta deleted file mode 100644 index 05cc475f..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Restrict.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f427a8594327b11458d6ebc38c5fc6b6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/RuntimeResolve.cs b/Assets/Plugins/AdvancedInspector/Attributes/RuntimeResolve.cs deleted file mode 100644 index 16a56fc4..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/RuntimeResolve.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// Forces a field to display a FieldEditor related to its current runtime type instead of the field type. - /// The Runtime version supply the type itself. Useful when the field value is null or for an unknown object picker. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class RuntimeResolveAttribute : Attribute, IListAttribute, IRuntimeAttribute - { - public delegate Type RuntimeResolveDelegate(); - public delegate Type RuntimeResolveStaticDelegate(RuntimeResolveAttribute runtimeResolve, object instance, object value); - - #region IRuntime Implementation - private string methodName = ""; - - public string MethodName - { - get { return methodName; } - } - - public Type Template - { - get { return typeof(RuntimeResolveDelegate); } - } - - public Type TemplateStatic - { - get { return typeof(RuntimeResolveStaticDelegate); } - } - - private List delegates = new List(); - - public List Delegates - { - get { return delegates; } - set { delegates = value; } - } - - public Type Invoke(int index, object instance, object value) - { - if (delegates.Count == 0 || index >= delegates.Count) - return null; - - try - { - if (delegates[index].Target == null) - { - return delegates[index].DynamicInvoke(this, instance, value) as Type; - } - else - { - return delegates[index].DynamicInvoke() as Type; - } - } - catch (Exception e) - { - if (e is TargetInvocationException) - e = ((TargetInvocationException)e).InnerException; - - Debug.LogError(string.Format("Invoking a method from a RuntimeResolve attribute failed. The exception was \"{0}\".", e.Message)); - return null; - } - } - #endregion - - public RuntimeResolveAttribute() { } - - public RuntimeResolveAttribute(string methodName) - { - this.methodName = methodName; - } - - public RuntimeResolveAttribute(Delegate method) - { - this.delegates.Add(method); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/RuntimeResolve.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/RuntimeResolve.cs.meta deleted file mode 100644 index 8e5deeb7..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/RuntimeResolve.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c41d12d2aa0e9824c828bab3957ce2ea -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Space.cs b/Assets/Plugins/AdvancedInspector/Attributes/Space.cs deleted file mode 100644 index 02972663..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Space.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Add a space after the current fields. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method)] - public class SpacingAttribute : Attribute - { - private int before = 0; - - /// - /// Size of the space to add before the item. - /// Default is 0. - /// - public int Before - { - get { return before; } - set { before = value; } - } - - private int after = 0; - - /// - /// Size of the space to add after the item. - /// Default is 1. - /// - public int After - { - get { return after; } - set { after = value; } - } - - public SpacingAttribute() { } - - public SpacingAttribute(int after) - { - this.after = after; - } - - public SpacingAttribute(int before, int after) - { - this.after = after; - this.before = before; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Space.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Space.cs.meta deleted file mode 100644 index 3c698339..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Space.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 342298f826c259a4f8efdca9740e39a6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Style.cs b/Assets/Plugins/AdvancedInspector/Attributes/Style.cs deleted file mode 100644 index 5ffa27ac..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Style.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Allow to change the style of an field item. - /// - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Method)] - public class StyleAttribute : Attribute - { - private string style = ""; - - /// - /// Name of the style to use. - /// Must be findable by GUI.skin.Find() - /// - public string Style - { - get { return style; } - set { style = value; } - } - - private bool label = true; - - /// - /// Force or prevent the field's label from being displayed. - /// - public bool Label - { - get { return label; } - set { label = value; } - } - - public StyleAttribute(string style) - : this(style, true) { } - - public StyleAttribute(string style, bool label) - { - this.style = style; - this.label = label; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Style.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Style.cs.meta deleted file mode 100644 index fcb288c0..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Style.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e4345a0f2d3a3744d90ee1c995161357 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Tab.cs b/Assets/Plugins/AdvancedInspector/Attributes/Tab.cs deleted file mode 100644 index a7efea4d..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Tab.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// The tabs allows to create a collection of tabs at the top based on an Enum's values. - /// Hides or shows items that are part of the selected tab. - /// - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Method)] - public class TabAttribute : Attribute - { - private Enum tab; - - public Enum Tab - { - get { return tab; } - set { tab = value; } - } - - public TabAttribute(object tab) - { - this.tab = (Enum)tab; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Tab.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Tab.cs.meta deleted file mode 100644 index 4c19797c..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Tab.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b3a31f241bcc75944a1919a273e85010 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/TextField.cs b/Assets/Plugins/AdvancedInspector/Attributes/TextField.cs deleted file mode 100644 index 555fa1cb..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/TextField.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// This allows control over how a string field is displayed. - /// Only useful on string field. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class TextFieldAttribute : Attribute, IListAttribute - { - private const string TITLE = "Select Path..."; - private const string PATH = ""; - private const string EXTENSION = ""; - - private string title = ""; - - /// - /// Title of the modal dialog - /// - public string Title - { - get { return title; } - set { title = value; } - } - - private string path = "C:\\"; - - /// - /// Default file/folder path - /// - public string Path - { - get { return path; } - set { path = value; } - } - - private string extension = ""; - - /// - /// Force the file dialog to show only specific file type. - /// - public string Extension - { - get { return extension; } - set { extension = value; } - } - - private TextFieldType type; - - /// - /// What type of control is this string. - /// - public TextFieldType Type - { - get { return type; } - set { type = value; } - } - - public TextFieldAttribute(TextFieldType type) - : this(type, TITLE, PATH, EXTENSION) { } - - public TextFieldAttribute(TextFieldType type, string title) - : this(type, title, PATH, EXTENSION) { } - - public TextFieldAttribute(TextFieldType type, string title, string path) - : this(type, title, path, EXTENSION) { } - - public TextFieldAttribute(TextFieldType type, string title, string path, string extension) - { - this.type = type; - this.title = title; - this.path = path; - this.extension = extension; - } - } - - public enum TextFieldType - { - Standard, - Password, - Area, - Tag, - File, - Folder - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/TextField.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/TextField.cs.meta deleted file mode 100644 index 9aeb2b82..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/TextField.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ce81aa34d03e9e84a981812d142a46a1 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Title.cs b/Assets/Plugins/AdvancedInspector/Attributes/Title.cs deleted file mode 100644 index 2330db37..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Title.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Linq; -using System.Text; - -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// Similar to Unity "Header" attribute, but can be place on any members and be set at runtime. - /// - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method)] - public class TitleAttribute : Attribute, IRuntimeAttribute - { - public delegate TitleAttribute TitleDelegate(); - public delegate TitleAttribute TitleStaticDelegate(TitleAttribute title, object instance, object value); - - private string message; - - /// - /// The title message - /// - public string Message - { - get { return message; } - set { message = value; } - } - - private FontStyle style = FontStyle.Bold; - - /// - /// The font style. - /// - public FontStyle Style - { - get { return style; } - set { style = value; } - } - - #region IRuntime Implementation - private string methodName = ""; - - public string MethodName - { - get { return methodName; } - } - - public Type Template - { - get { return typeof(TitleDelegate); } - } - - public Type TemplateStatic - { - get { return typeof(TitleStaticDelegate); } - } - - private List delegates = new List(); - - public List Delegates - { - get { return delegates; } - set { delegates = value; } - } - - public TitleAttribute Invoke(int index, object instance, object value) - { - if (delegates.Count == 0 || index >= delegates.Count) - return this; - - try - { - if (delegates[index].Target == null) - { - return delegates[0].DynamicInvoke(this, instance, value) as TitleAttribute; - } - else - { - return delegates[0].DynamicInvoke() as TitleAttribute; - } - } - catch (Exception e) - { - if (e is TargetInvocationException) - e = ((TargetInvocationException)e).InnerException; - - Debug.LogError(string.Format("Invoking a method failed while trying to retrieve a Title attribute. The exception was \"{0}\".", e.Message)); - return null; - } - } - #endregion - - public TitleAttribute(string methodName) - { - this.methodName = methodName; - } - - public TitleAttribute(FontStyle style, string message) - { - this.style = style; - this.message = message; - } - - public TitleAttribute(Delegate method) - { - this.delegates.Add(method); - } - } -} diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Title.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Title.cs.meta deleted file mode 100644 index f0377be3..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Title.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 50a11bb467421824c95d21c7fb6d8073 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Toolbar.cs b/Assets/Plugins/AdvancedInspector/Attributes/Toolbar.cs deleted file mode 100644 index 8044b984..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Toolbar.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; - -namespace AdvancedInspector -{ - /// - /// Allow to groups inspector items. - /// - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Method)] - public class ToolbarAttribute : Attribute - { - public const string ToolbarStyle = "Toolbar"; - - private string name = ""; - - /// - /// Name of the toolbar, used to group items. - /// If Label is true, the name is displayed. - /// - public string Name - { - get { return name; } - set { name = value; } - } - - private string style = ""; - - /// - /// Style of this toolbar. Defaul; "Toolbar" - /// Only need to be flagged on one item. - /// - public string Style - { - get { return style; } - set { style = value; } - } - - private bool label = false; - - /// - /// Show or hide the toolbar label - /// Only need to be flagged on one item. - /// - public bool Label - { - get { return label; } - set { label = value; } - } - - private bool flexible = false; - - /// - /// This specific item will have a Flexible Space before - /// - public bool Flexible - { - get { return flexible; } - set { flexible = value; } - } - - private int priority = 0; - - /// - /// Priority of this toolbar when sorting items. - /// Only need to be flagged on one item. - /// - public int Priority - { - get { return priority; } - set { priority = value; } - } - - public ToolbarAttribute(string name) - : this(name, "", false, false, 0) { } - - public ToolbarAttribute(string name, int priority) - : this(name, "", false, false, priority) { } - - public ToolbarAttribute(string name, string style) - : this(name, style, false, false, 0) { } - - public ToolbarAttribute(string name, string style, int priority) - : this(name, style, false, false, priority) { } - - public ToolbarAttribute(string name, bool label) - : this(name, "", label, false, 0) { } - - public ToolbarAttribute(string name, bool label, int priority) - : this(name, "", label, false, priority) { } - - public ToolbarAttribute(string name, string style, bool label) - : this(name, style, label, false, 0) { } - - public ToolbarAttribute(string name, string style, bool label, int priority) - : this(name, style, label, false, priority) { } - - public ToolbarAttribute(string name, string style, bool label, bool flexible) - : this(name, style, label, flexible, 0) { } - - public ToolbarAttribute(string name, string style, bool label, bool flexible, int priority) - { - this.name = name; - this.style = style; - this.label = label; - this.flexible = flexible; - this.priority = priority; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Toolbar.cs.meta b/Assets/Plugins/AdvancedInspector/Attributes/Toolbar.cs.meta deleted file mode 100644 index 1b49b862..00000000 --- a/Assets/Plugins/AdvancedInspector/Attributes/Toolbar.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 03350da06d5fe9643b20b6796771ad56 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Core.meta b/Assets/Plugins/AdvancedInspector/Core.meta deleted file mode 100644 index c6c63969..00000000 --- a/Assets/Plugins/AdvancedInspector/Core.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 0d71452a5ed8d3c4a9a83a9e27d4d2bd -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/AdvancedInspector/Core/ActionBinding.cs b/Assets/Plugins/AdvancedInspector/Core/ActionBinding.cs deleted file mode 100644 index 55573bbd..00000000 --- a/Assets/Plugins/AdvancedInspector/Core/ActionBinding.cs +++ /dev/null @@ -1,744 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; - -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// This class represent an event, and allows the Inspector to bind it to another method. - /// Arguments can be sent to the invoked method from a static field, internal from the code invoking, or from another method returned value. - /// - [Serializable, AdvancedInspector] - public class ActionBinding : ICopiable - { - [SerializeField] - private string[] internalParameters = new string[0]; - - [SerializeField] - private GameObject gameObject; - - [Inspect] - public GameObject GameObject - { - get { return gameObject; } - set - { - if (gameObject != value) - { - gameObject = value; - Component = null; - } - } - } - - [SerializeField] - private Component component; - - [Inspect, Restrict("GetComponents")] - public Component Component - { - get { return component; } - set - { - if (component != value) - { - component = value; - Method = null; - } - } - } - - private IList GetComponents() - { - List components = new List(); - if (gameObject == null) - return components; - - foreach (Component component in gameObject.GetComponents(typeof(Component))) - components.Add(new DescriptorPair(component, new DescriptorAttribute(component.GetType().Name, ""))); - - return components; - } - - [SerializeField] - private string method; - - [Inspect, Restrict("GetMethods", RestrictDisplay.Toolbox)] - public MethodInfo Method - { - get { return GetMethodInfo(); } - set - { - if (value == null) - { - parameters = new BindingParameter[0]; - method = ""; - return; - } - - MethodInfo info = GetMethodInfo(); - if (info != value) - { - method = value.Name; - ParameterInfo[] param = value.GetParameters(); - parameters = new BindingParameter[param.Length]; - for (int i = 0; i < param.Length; i++) - { - parameters[i] = new BindingParameter(internalParameters.Length > i); - parameters[i].Type = param[i].ParameterType; - if (internalParameters.Length > i) - parameters[i].binding = BindingParameter.BindingType.Internal; - } - } - } - } - - private IList GetMethods() - { - List methods = new List(); - if (gameObject == null || component == null) - return methods; - - foreach (MethodInfo info in component.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)) - { - if (info.IsGenericMethod || info.IsConstructor || info.IsFinal || info.IsSpecialName || info.DeclaringType == typeof(object) || info.DeclaringType == typeof(Component)) - continue; - - if (!IsMethodValid(info)) - continue; - - ParameterInfo[] param = info.GetParameters(); - - methods.Add(new DescriptorPair(info, new DescriptorAttribute(GetParamNames(info.Name, param), ""))); - } - - foreach (PropertyInfo info in component.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)) - { - if (!info.CanWrite || info.DeclaringType == typeof(object) || info.DeclaringType == typeof(UnityEngine.Object) || info.DeclaringType == typeof(Component)) - continue; - - MethodInfo method = info.GetSetMethod(); - if (method == null || !IsMethodValid(method)) - continue; - - ParameterInfo[] param = method.GetParameters(); - - methods.Add(new DescriptorPair(method, new DescriptorAttribute(GetParamNames(info.Name, param), ""))); - } - - return methods; - } - - private bool IsMethodValid(MethodInfo info) - { - ParameterInfo[] param = info.GetParameters(); - - bool valid = true; - for (int i = 0; i < param.Length; i++) - { - if (!BindingParameter.IsValidType(param[i].ParameterType)) - { - valid = false; - break; - } - - if (internalParameters.Length > i) - { - Type type = Type.GetType(internalParameters[i]); - if (!type.IsAssignableFrom(param[i].ParameterType)) - { - valid = false; - break; - } - } - } - - return valid; - } - - private string GetParamNames(string name, ParameterInfo[] param) - { - string paramName = name + " ("; - for (int i = 0; i < param.Length; i++) - { - paramName += param[i].ParameterType.Name; - if (i < param.Length - 1) - paramName += ", "; - } - paramName += ")"; - - return paramName; - } - - private MethodInfo GetMethodInfo() - { - if (gameObject == null || component == null || string.IsNullOrEmpty(method)) - return null; - - Type[] types = new Type[parameters.Length]; - for (int i = 0; i < parameters.Length; i++) - types[i] = parameters[i].Type; - - return component.GetType().GetMethod(method, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy, null, types, null); - } - - [Inspect, Collection(0, false), SerializeField] - private BindingParameter[] parameters = new BindingParameter[0]; - - public event ActionEventHandler OnInvoke; - - /// - /// Parameter-less method constructor. - /// - public ActionBinding() { } - - /// - /// The array of types is the method definition. - /// Method with the wrong parameters are not selectable. - /// - public ActionBinding(Type[] types) - { - internalParameters = new string[types.Length]; - for (int i = 0; i < types.Length; i++) - internalParameters[i] = types[i].AssemblyQualifiedName; - } - - /// - /// Invoke the method. - /// Be careful to pass the proper type as args, otherwise they will be ignored. - /// Args are only retained if the parameter is flagged as internal. - /// - public void Invoke(params object[] args) - { - if (gameObject == null || component == null || string.IsNullOrEmpty(method)) - return; - - MethodInfo info = GetMethodInfo(); - if (info == null) - return; - - object[] values = new object[parameters.Length]; - for (int i = 0; i < parameters.Length; i++) - { - if (args.Length > i && parameters[i].binding == BindingParameter.BindingType.Internal) - values[i] = args[i]; - else - values[i] = parameters[i].Value; - } - - info.Invoke(component, values); - - if (OnInvoke != null) - OnInvoke(this, values); - } - - public override string ToString() - { - string supplied = "("; - for (int i = 0; i < internalParameters.Length; i++) - { - supplied += Type.GetType(internalParameters[i]).Name; - if (i < internalParameters.Length - 1) - supplied += ", "; - } - - supplied += ")"; - - if (component != null) - return component.GetType().Name + " : " + method + " : " + supplied; - else - return supplied; - } - - public bool Copiable(object destination) - { - ActionBinding action = destination as ActionBinding; - if (action == null) - return false; - - if (action.internalParameters.Length != internalParameters.Length) - return false; - - for (int i = 0; i < internalParameters.Length; i++) - if (internalParameters[i] != action.internalParameters[i]) - return false; - - return true; - } - - /// - /// The binding parameter define how each of the argument of the invoked method is handled. - /// - [Serializable, AdvancedInspector] - public class BindingParameter : ICopy, ICopiable - { - [Inspect(-1), Restrict("RestrictBinding")] - public BindingType binding; - - private IList RestrictBinding() - { - List list = new List(); - if (canBeInternal) - list.Add(BindingType.Internal); - - list.Add(BindingType.Static); - list.Add(BindingType.External); - return list; - } - - private bool canBeInternal = true; - - private bool CanBeInternal - { - get { return canBeInternal; } - } - - #region Values - [SerializeField] - private BindingValueType type; - - [SerializeField] - private string qualifiedTypeName; - - public Type Type - { - get - { - if (string.IsNullOrEmpty(qualifiedTypeName)) - return null; - else - return Type.GetType(qualifiedTypeName); - } - - set - { - if (value == typeof(bool)) - type = BindingValueType.Boolean; - else if (value == typeof(Bounds)) - type = BindingValueType.Bounds; - else if (value == typeof(Color)) - type = BindingValueType.Color; - else if (value == typeof(float)) - type = BindingValueType.Float; - else if (value == typeof(int)) - type = BindingValueType.Integer; - else if (value == typeof(Rect)) - type = BindingValueType.Rect; - else if (typeof(UnityEngine.Object).IsAssignableFrom(value)) - type = BindingValueType.Reference; - else if (value == typeof(string)) - type = BindingValueType.String; - else if (value == typeof(Vector2)) - type = BindingValueType.Vector2; - else if (value == typeof(Vector3)) - type = BindingValueType.Vector3; - else if (value == typeof(Vector4)) - type = BindingValueType.Vector4; - else - type = BindingValueType.None; - - if (type != BindingValueType.None) - qualifiedTypeName = value.AssemblyQualifiedName; - else - qualifiedTypeName = ""; - } - } - - [Inspect(-2)] - public string BoundType - { - get - { - if (Type == null) - return ""; - - return Type.Name; - } - } - - [SerializeField] - private bool boolValue = false; - [SerializeField] - private int intValue = 0; - [SerializeField] - private float floatValue = 0; - [SerializeField] - private string stringValue = ""; - [SerializeField] - private Vector2 vector2Value = Vector2.zero; - [SerializeField] - private Vector3 vector3Value = Vector3.zero; - [SerializeField] - private Vector4 vector4Value = Vector4.zero; - [SerializeField] - private Color colorValue = Color.black; - [SerializeField] - private Rect rectValue = new Rect(0, 0, 0, 0); - [SerializeField] - private Bounds boundsValue = new Bounds(Vector3.zero, Vector3.zero); - [SerializeField] - private UnityEngine.Object referenceValue = new UnityEngine.Object(); - #endregion - - [Inspect("IsStatic")] - [RuntimeResolve("GetRuntimeType")] - public object Value - { - get - { - if (binding == BindingType.External) - { - object value = Invoke(); - if (value.GetType().IsAssignableFrom(Type)) - return value; - - System.ComponentModel.TypeConverter converter = System.ComponentModel.TypeDescriptor.GetConverter(Type); - return converter.ConvertTo(value, Type); - } - - switch (type) - { - case BindingValueType.Boolean: - return boolValue; - case BindingValueType.Bounds: - return boundsValue; - case BindingValueType.Color: - return colorValue; - case BindingValueType.Float: - return floatValue; - case BindingValueType.Integer: - return intValue; - case BindingValueType.Rect: - return rectValue; - case BindingValueType.Reference: - return referenceValue; - case BindingValueType.String: - return stringValue; - case BindingValueType.Vector2: - return vector2Value; - case BindingValueType.Vector3: - return vector3Value; - case BindingValueType.Vector4: - return vector4Value; - default: - return null; - } - } - - set - { - if (value == null && type != BindingValueType.Reference) - return; - - switch (type) - { - case BindingValueType.Boolean: - boolValue = (bool)value; - break; - case BindingValueType.Bounds: - boundsValue = (Bounds)value; - break; - case BindingValueType.Color: - colorValue = (Color)value; - break; - case BindingValueType.Float: - floatValue = (float)value; - break; - case BindingValueType.Integer: - intValue = (int)value; - break; - case BindingValueType.Rect: - rectValue = (Rect)value; - break; - case BindingValueType.Reference: - referenceValue = (UnityEngine.Object)value; - break; - case BindingValueType.String: - stringValue = (string)value; - break; - case BindingValueType.Vector2: - vector2Value = (Vector2)value; - break; - case BindingValueType.Vector3: - vector3Value = (Vector3)value; - break; - case BindingValueType.Vector4: - vector4Value = (Vector4)value; - break; - default: - return; - } - } - } - - [SerializeField] - private GameObject gameObject; - - [Inspect("IsExternal")] - public GameObject GameObject - { - get { return gameObject; } - set - { - if (gameObject != value) - { - gameObject = value; - Component = null; - } - } - } - - [SerializeField] - private Component component; - - [Inspect("IsExternal")] - [Restrict("GetComponents")] - public Component Component - { - get { return component; } - set - { - if (component != value) - { - component = value; - Method = null; - } - } - } - - private IList GetComponents() - { - List components = new List(); - if (gameObject == null) - return components; - - foreach (Component component in gameObject.GetComponents(typeof(Component))) - components.Add(new DescriptorPair(component, new DescriptorAttribute(component.GetType().Name, ""))); - - return components; - } - - [SerializeField] - private string method; - - [Inspect("IsExternal")] - [Restrict("GetMethods", RestrictDisplay.Toolbox)] - public MethodInfo Method - { - get { return GetMethodInfo(); } - set - { - if (value == null) - { - method = ""; - return; - } - - MethodInfo info = GetMethodInfo(); - if (info != value) - method = value.Name; - } - } - - private IList GetMethods() - { - List methods = new List(); - if (gameObject == null || component == null) - return methods; - - foreach (MethodInfo info in component.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)) - { - if (info.IsGenericMethod || info.IsConstructor || info.IsFinal || info.IsSpecialName) - continue; - - if (!IsMethodValid(info)) - continue; - - string paramName = info.ReturnType.Name + " " + info.Name + "()"; - methods.Add(new DescriptorPair(info, new DescriptorAttribute(paramName, ""))); - } - - foreach (PropertyInfo info in component.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)) - { - if (!info.CanRead) - continue; - - MethodInfo method = info.GetGetMethod(); - if (method == null || !IsMethodValid(method)) - continue; - - string paramName = method.ReturnType.Name + " " + info.Name + "()"; - methods.Add(new DescriptorPair(method, new DescriptorAttribute(paramName, ""))); - } - - return methods; - } - - private bool IsMethodValid(MethodInfo info) - { - ParameterInfo[] param = info.GetParameters(); - if (param.Length > 0) - return false; - - if (info.ReturnType == null || info.ReturnType == typeof(void)) - return false; - - System.ComponentModel.TypeConverter converter = System.ComponentModel.TypeDescriptor.GetConverter(info.ReturnType); - if (!Type.IsAssignableFrom(info.ReturnType) && !converter.CanConvertTo(Type)) - return false; - - return true; - } - - private MethodInfo GetMethodInfo() - { - if (gameObject == null || component == null || string.IsNullOrEmpty(method)) - return null; - - return component.GetType().GetMethod(method, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy); - } - - private bool IsStatic() - { - return binding == BindingType.Static; - } - - private bool IsExternal() - { - return binding == BindingType.External; - } - - private Type GetRuntimeType() - { - return Type; - } - - public BindingParameter() { } - - public BindingParameter(bool canBeInternal) - { - this.canBeInternal = canBeInternal; - } - - public static bool IsValidType(Type type) - { - if (type == typeof(bool)) - return true; - else if (type == typeof(Bounds)) - return true; - else if (type == typeof(Color)) - return true; - else if (type == typeof(float)) - return true; - else if (type == typeof(int)) - return true; - else if (type == typeof(Rect)) - return true; - else if (typeof(UnityEngine.Object).IsAssignableFrom(type)) - return true; - else if (type == typeof(string)) - return true; - else if (type == typeof(Vector2)) - return true; - else if (type == typeof(Vector3)) - return true; - else if (type == typeof(Vector4)) - return true; - - return false; - } - - public enum BindingType - { - Internal, - Static, - External - } - - private enum BindingValueType - { - None, - - Boolean, - Integer, - Float, - String, - Vector2, - Vector3, - Vector4, - Color, - Rect, - Bounds, - Reference - } - - private object Invoke() - { - if (gameObject == null || component == null || string.IsNullOrEmpty(method)) - return null; - - MethodInfo info = GetMethodInfo(); - if (info == null) - return null; - - return info.Invoke(component, new object[0]); - } - - public bool Copiable(object destination) - { - BindingParameter target = destination as BindingParameter; - if (target == null) - return false; - - if (target.type != type) - return false; - - if (!target.canBeInternal && binding == BindingType.Internal) - return false; - - return true; - } - - public object Copy(object destination) - { - BindingParameter target = destination as BindingParameter; - - BindingParameter copy = new BindingParameter(); - if (target != null) - copy.canBeInternal = target.canBeInternal; - else - copy.canBeInternal = canBeInternal; - - copy.binding = binding; - copy.boolValue = boolValue; - copy.boundsValue = boundsValue; - copy.colorValue = colorValue; - copy.component = component; - copy.floatValue = floatValue; - copy.gameObject = gameObject; - copy.intValue = intValue; - copy.method = method; - copy.qualifiedTypeName = qualifiedTypeName; - copy.rectValue = rectValue; - copy.referenceValue = referenceValue; - copy.stringValue = stringValue; - copy.type = type; - copy.vector2Value = vector2Value; - copy.vector3Value = vector3Value; - copy.vector4Value = vector4Value; - - return copy; - } - - public override string ToString() - { - return type.ToString(); - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Core/ActionBinding.cs.meta b/Assets/Plugins/AdvancedInspector/Core/ActionBinding.cs.meta deleted file mode 100644 index 1b2c79dc..00000000 --- a/Assets/Plugins/AdvancedInspector/Core/ActionBinding.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3dda590f8ffeb5848b2e6775c1caa63a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Core/ComponentMonoBehaviour.cs b/Assets/Plugins/AdvancedInspector/Core/ComponentMonoBehaviour.cs deleted file mode 100644 index e5d04884..00000000 --- a/Assets/Plugins/AdvancedInspector/Core/ComponentMonoBehaviour.cs +++ /dev/null @@ -1,199 +0,0 @@ -using UnityEngine; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -namespace AdvancedInspector -{ - /// - /// ScriptableObject are not serializable within the scope of a GameObject. - /// Therefore, they are improper to prefab, copy and so on. - /// This class' goal is to provide a polymorphic solution and give an easy way of handling up front. - /// - /// Derived from Object; no polymorphism supported. - /// Derived from ScriptableObject; cannot be prefabed, copied, duplicated or instanced. - /// Derived from MonoBehaviour; can only live on a GameObject. - /// - /// A ComponentMonoBehaviour is created from another MonoBehaviour; its parent. - /// A parent can be another ComponentMonoBehaviour. - /// If the parent is destroyed, the subcomponent is destroyed too. - /// If a subcomponent is found without a parent, it's destroyed too. - /// - [AdvancedInspector] - public abstract class ComponentMonoBehaviour : MonoBehaviour - { - [SerializeField] - private MonoBehaviour owner; - - /// - /// The owner of a "subcomponent". - /// Use to know if this component lost its parent. - /// If so, the AdvancedInspector will delete any unused component. - /// - public MonoBehaviour Owner - { - get { return owner; } - set - { - if (value != null) - owner = value; - } - } - - /// - /// A subcomponent is not visible the normal way in the Inspector. - /// It's shown as being part of another item. - /// - protected virtual void Reset() - { - hideFlags = HideFlags.HideInInspector; - } - - /// - /// Called when the inspector is about to destroy this one. - /// Loop in all the internal and destroy sub-components. - /// - public void Erase() - { - foreach (FieldInfo info in GetFields(GetType(), false)) - { - object value = info.GetValue(this); - - if (value is ComponentMonoBehaviour) - { - ComponentMonoBehaviour component = value as ComponentMonoBehaviour; - - if (component.Owner == Owner) - component.Erase(); - } - } - - DestroyImmediate(this, true); - } - - /// - /// Instanciate an existing Component on the same owner GameObject - /// - public ComponentMonoBehaviour Instantiate() - { - return Instantiate(gameObject, Owner); - } - - /// - /// Instanciate an existing Component on the same owner GameObject but with a new onwer. - /// - public ComponentMonoBehaviour Instantiate(MonoBehaviour owner) - { - return Instantiate(gameObject, owner); - } - - /// - /// Instanciate an existing Component on the target GameObject. - /// - public ComponentMonoBehaviour Instantiate(GameObject go, MonoBehaviour owner) - { - return CopyObject(go, owner, this) as ComponentMonoBehaviour; - } - - private static object CopyObject(GameObject go, MonoBehaviour owner, object original) - { - if (original == null) - return null; - - Type type = original.GetType(); - - if (type == typeof(string)) - - return ((string)original).Clone(); - else if (type.Namespace == "System") - return original; - else if (typeof(IList).IsAssignableFrom(type)) - return CopyList(go, owner, (IList)original); - else if (typeof(ComponentMonoBehaviour).IsAssignableFrom(type) && ((ComponentMonoBehaviour)original).Owner == owner) - return CopyComponent(go, owner, (ComponentMonoBehaviour)original); - else if (typeof(Component).IsAssignableFrom(type)) - return original; - else if (typeof(ScriptableObject).IsAssignableFrom(type)) - return ScriptableObject.Instantiate((ScriptableObject)original); - else if (typeof(UnityEngine.Object).IsAssignableFrom(type)) - return original; - else if (type.IsClass) - return CopyClass(go, owner, original); - else - return original; - } - - private static IList CopyList(GameObject go, MonoBehaviour owner, IList original) - { - Type type = original.GetType(); - IList copy; - - if (type.IsArray) - { - copy = Array.CreateInstance(type.GetElementType(), original.Count); - for (int i = 0; i < original.Count; i++) - copy[i] = CopyObject(go, owner, original[i]); - } - else - { - copy = Activator.CreateInstance(type) as IList; - for (int i = 0; i < original.Count; i++) - copy.Add(CopyObject(go, owner, original[i])); - - } - - return copy; - } - - private static ComponentMonoBehaviour CopyComponent(GameObject go, MonoBehaviour owner, ComponentMonoBehaviour original) - { - Type type = original.GetType(); - ComponentMonoBehaviour copy = go.AddComponent(original.GetType()) as ComponentMonoBehaviour; - - foreach (FieldInfo info in GetFields(type, false)) - { - if (info.IsLiteral) - continue; - - info.SetValue(copy, CopyObject(go, copy, info.GetValue(original))); - } - - copy.Owner = owner; - - return copy; - } - - private static object CopyClass(GameObject go, MonoBehaviour owner, object original) - { - Type type = original.GetType(); - object copy = Activator.CreateInstance(type); - - foreach (FieldInfo info in GetFields(type, false)) - { - if (info.IsLiteral) - continue; - - info.SetValue(copy, CopyObject(go, owner, info.GetValue(original))); - } - - return copy; - } - - private static List GetFields(Type type, bool recursive) - { - List infos; - - if (recursive) - infos = type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance).ToList(); - else - infos = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy).ToList(); - - if (type.BaseType != null && type.BaseType != typeof(object)) - infos.AddRange(GetFields(type.BaseType, true)); - - return infos; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Core/ComponentMonoBehaviour.cs.meta b/Assets/Plugins/AdvancedInspector/Core/ComponentMonoBehaviour.cs.meta deleted file mode 100644 index d987b370..00000000 --- a/Assets/Plugins/AdvancedInspector/Core/ComponentMonoBehaviour.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d411934b81db62841acf60342a15b9c3 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Core/RangeFloat.cs b/Assets/Plugins/AdvancedInspector/Core/RangeFloat.cs deleted file mode 100644 index f7442db6..00000000 --- a/Assets/Plugins/AdvancedInspector/Core/RangeFloat.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace AdvancedInspector -{ - [Serializable] - public struct RangeFloat - { - public float min; - public float max; - - public RangeFloat(float min, float max) - { - this.min = min; - this.max = max; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Core/RangeFloat.cs.meta b/Assets/Plugins/AdvancedInspector/Core/RangeFloat.cs.meta deleted file mode 100644 index a2c19ce3..00000000 --- a/Assets/Plugins/AdvancedInspector/Core/RangeFloat.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: bee2349f549bbc341bd8f823cb45ccbf -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Core/RangeInt.cs b/Assets/Plugins/AdvancedInspector/Core/RangeInt.cs deleted file mode 100644 index bfe55c58..00000000 --- a/Assets/Plugins/AdvancedInspector/Core/RangeInt.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace AdvancedInspector -{ - [Serializable] - public struct RangeInt - { - public int min; - public int max; - - public RangeInt(int min, int max) - { - this.min = min; - this.max = max; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Core/RangeInt.cs.meta b/Assets/Plugins/AdvancedInspector/Core/RangeInt.cs.meta deleted file mode 100644 index 3b73338c..00000000 --- a/Assets/Plugins/AdvancedInspector/Core/RangeInt.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6c92ce2aa7de2a7438784b0cc719f9ac -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Core/UDictionary.cs b/Assets/Plugins/AdvancedInspector/Core/UDictionary.cs deleted file mode 100644 index 5322154f..00000000 --- a/Assets/Plugins/AdvancedInspector/Core/UDictionary.cs +++ /dev/null @@ -1,230 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Runtime.InteropServices; -using System.Runtime.Serialization; -using System.Text; - -using UnityEngine; - -namespace AdvancedInspector -{ - [Serializable] - [ComVisible(false)] - [DebuggerDisplay("Count = {Count}")] - public class UDictionary : IDictionary, ICollection>, IEnumerable>, IDictionary, ICollection, IEnumerable, ISerializable, IDeserializationCallback, ISerializationCallbackReceiver - { - [SerializeField] - private List keys = new List(); - - [SerializeField] - private List values = new List(); - - [NonSerialized] - private Dictionary dictionary = new Dictionary(); - - #region Implementation of ISerializationCallbackReceiver - public void OnAfterDeserialize() - { - dictionary.Clear(); - for (int i = 0; i < keys.Count; i++) - if (keys[i] != null && (!(keys[i] is UnityEngine.Object) || ((UnityEngine.Object)(object)keys[i]))) - dictionary.Add(keys[i], values[i]); - } - - public void OnBeforeSerialize() - { - keys.Clear(); - values.Clear(); - foreach (KeyValuePair pair in dictionary) - { - if (pair.Key == null || (pair.Key is UnityEngine.Object && !((UnityEngine.Object)(object)pair.Key))) - continue; - - keys.Add(pair.Key); - values.Add(pair.Value); - } - } - #endregion - - #region Implementation of ISerializable - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - dictionary.GetObjectData(info, context); - } - #endregion - - #region Implementation of IDeserializationCallback - public void OnDeserialization(object sender) - { - dictionary.OnDeserialization(sender); - } - #endregion - - #region Implementation IDictionary - public bool IsFixedSize - { - get { return false; } - } - - public ICollection Keys - { - get { return dictionary.Keys; } - } - - ICollection IDictionary.Keys - { - get { return dictionary.Keys; } - } - - public ICollection Values - { - get { return dictionary.Values; } - } - - ICollection IDictionary.Values - { - get { return dictionary.Values; } - } - - public TValue this[TKey key] - { - get { return dictionary[key]; } - set { dictionary[key] = value; } - } - - object IDictionary.this[object key] - { - get - { - if (!(key is TKey)) - return null; - - return dictionary[(TKey)key]; - } - set - { - if (!(key is TKey)) - return; - - if (!(value is TValue) && value != null) - return; - - dictionary[(TKey)key] = (TValue)value; - } - } - - public void Add(TKey key, TValue value) - { - dictionary.Add(key, value); - } - - void IDictionary.Add(object key, object value) - { - if (!(key is TKey)) - return; - - if (!(value is TValue) && value != null) - return; - - dictionary.Add((TKey)key, (TValue)value); - } - - public bool ContainsKey(TKey key) - { - return dictionary.ContainsKey(key); - } - - bool IDictionary.Contains(object key) - { - if (!(key is TKey)) - return false; - - return dictionary.ContainsKey((TKey)key); - } - - public bool Remove(TKey key) - { - return dictionary.Remove(key); - } - - void IDictionary.Remove(object key) - { - if (!(key is TKey)) - return; - - dictionary.Remove((TKey)key); - } - - public bool TryGetValue(TKey key, out TValue value) - { - return dictionary.TryGetValue(key, out value); - } - - IDictionaryEnumerator IDictionary.GetEnumerator() - { - return ((IDictionary)dictionary).GetEnumerator(); - } - #endregion - - #region Implementation ICollection - public int Count - { - get { return dictionary.Count; } - } - - public bool IsReadOnly - { - get { return false; } - } - - public bool IsSynchronized - { - get { return false; } - } - - public object SyncRoot - { - get { return null; } - } - - public void Add(KeyValuePair item) - { - dictionary.Add(item.Key, item.Value); - } - - public void Clear() - { - dictionary.Clear(); - } - - public bool Contains(KeyValuePair item) - { - return dictionary.ContainsKey(item.Key) && dictionary[item.Key].Equals(item.Value); - } - - void ICollection.CopyTo(Array array, int index) { } - - void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) { } - - public bool Remove(KeyValuePair item) - { - return dictionary.Remove(item.Key); - } - #endregion - - #region Implementation of IEnumerable - public IEnumerator> GetEnumerator() - { - return dictionary.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return dictionary.GetEnumerator(); - } - #endregion - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Core/UDictionary.cs.meta b/Assets/Plugins/AdvancedInspector/Core/UDictionary.cs.meta deleted file mode 100644 index f39539f9..00000000 --- a/Assets/Plugins/AdvancedInspector/Core/UDictionary.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9e2fe3e177768eb42ac8308f4f3e3c6a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Event.meta b/Assets/Plugins/AdvancedInspector/Event.meta deleted file mode 100644 index 135b7127..00000000 --- a/Assets/Plugins/AdvancedInspector/Event.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: cfb5bf0cc1004984c86ae71dfdef427c -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/AdvancedInspector/Event/EventHandlers.cs b/Assets/Plugins/AdvancedInspector/Event/EventHandlers.cs deleted file mode 100644 index 9c0418d4..00000000 --- a/Assets/Plugins/AdvancedInspector/Event/EventHandlers.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; - -namespace AdvancedInspector -{ - public delegate void GenericEventHandler(); - - public delegate void SenderEventHandler(object sender); - - public delegate void BoolEventHandler(object sender, bool value); - public delegate void IntEventHandler(object sender, int value); - public delegate void FloatEventHandler(object sender, float value); - public delegate void StringEventHandler(object sender, string value); - public delegate void ObjectEventHandler(object sender, object value); - public delegate void Vector2EventHandler(object sender, Vector2 value); - public delegate void Vector3EventHandler(object sender, Vector3 value); - public delegate void Vector4EventHandler(object sender, Vector4 value); - - public delegate void CollisionEventHandler(object sender, Collision value); - public delegate void ColliderEventHandler(object sender, Collider value); - - public delegate void ActionEventHandler(object sender, object[] args); -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Event/EventHandlers.cs.meta b/Assets/Plugins/AdvancedInspector/Event/EventHandlers.cs.meta deleted file mode 100644 index 4c6c1268..00000000 --- a/Assets/Plugins/AdvancedInspector/Event/EventHandlers.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ada727c2815079443b04c23643983797 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Interface.meta b/Assets/Plugins/AdvancedInspector/Interface.meta deleted file mode 100644 index 16d6ab7f..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: f1b6b242a5028dc4b8f87041356c7c93 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/AdvancedInspector/Interface/ICopiable.cs b/Assets/Plugins/AdvancedInspector/Interface/ICopiable.cs deleted file mode 100644 index 8498e056..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/ICopiable.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace AdvancedInspector -{ - /// - /// Give an object the power to detect if it can be clone to the target location. - /// - public interface ICopiable - { - /// - /// Should return true if the object can be copied to replace the object destination. - /// - bool Copiable(object destination); - } -} diff --git a/Assets/Plugins/AdvancedInspector/Interface/ICopiable.cs.meta b/Assets/Plugins/AdvancedInspector/Interface/ICopiable.cs.meta deleted file mode 100644 index fe1413d4..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/ICopiable.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5be419eaa25267d4abffe1323b92fdba -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Interface/ICopy.cs b/Assets/Plugins/AdvancedInspector/Interface/ICopy.cs deleted file mode 100644 index d3584276..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/ICopy.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace AdvancedInspector -{ - /// - /// Give an object the power to handle it's own copying over an target destination. - /// - public interface ICopy - { - /// - /// Should return a copy of itself. The overriden destination object is passed in case important fields are not to be replaced. - /// - object Copy(object destination); - } -} diff --git a/Assets/Plugins/AdvancedInspector/Interface/ICopy.cs.meta b/Assets/Plugins/AdvancedInspector/Interface/ICopy.cs.meta deleted file mode 100644 index e96268ea..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/ICopy.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c3c8bf575d7676a4bb245bda97724449 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Interface/IDataChanged.cs b/Assets/Plugins/AdvancedInspector/Interface/IDataChanged.cs deleted file mode 100644 index 65e93a85..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/IDataChanged.cs +++ /dev/null @@ -1,24 +0,0 @@ -using UnityEngine; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - /// - /// Define an interface called when the Inspector has performed changes. - /// The event works the other way around, as a way to notify the Inspector something changed and needs to be refreshed. - /// - public interface IDataChanged - { - /// - /// Fired when the Inspector changed. - /// - void DataChanged(); - - /// - /// Should be fired internal by the object when the fields structure changed. - /// Ex.: Added an object to a list. - /// - event GenericEventHandler OnDataChanged; - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Interface/IDataChanged.cs.meta b/Assets/Plugins/AdvancedInspector/Interface/IDataChanged.cs.meta deleted file mode 100644 index 957af94f..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/IDataChanged.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d075315f0f1460743ac06aafae48b280 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Interface/IInspectorRunning.cs b/Assets/Plugins/AdvancedInspector/Interface/IInspectorRunning.cs deleted file mode 100644 index c2038537..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/IInspectorRunning.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace AdvancedInspector -{ - /// - /// When implementing this, gives the object ability to draw the header and footer of the Inspector's space. - /// - public interface IInspectorRunning - { - /// - /// Draw at the top of the inspector, in this order; - /// - This - /// - Class Helpbox - /// - Tabs - /// rest of the fields - /// - void OnHeaderGUI(); - - /// - /// Draw at the bottom of the inspector, in this order; - /// - Helpbox - /// - This - /// - void OnFooterGUI(); - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Interface/IInspectorRunning.cs.meta b/Assets/Plugins/AdvancedInspector/Interface/IInspectorRunning.cs.meta deleted file mode 100644 index ad85b3be..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/IInspectorRunning.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 94767ceadd7c79e4da722e9aa451f87e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Interface/IListAttribute.cs b/Assets/Plugins/AdvancedInspector/Interface/IListAttribute.cs deleted file mode 100644 index 2f020402..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/IListAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace AdvancedInspector -{ - /// - /// Define an attribute that can be passed down to list/array elements. - /// - public interface IListAttribute { } -} diff --git a/Assets/Plugins/AdvancedInspector/Interface/IListAttribute.cs.meta b/Assets/Plugins/AdvancedInspector/Interface/IListAttribute.cs.meta deleted file mode 100644 index d180ca1e..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/IListAttribute.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fec0fc7a00e58804ab5c94aa860790b7 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Interface/IPreview.cs b/Assets/Plugins/AdvancedInspector/Interface/IPreview.cs deleted file mode 100644 index 9dcf487c..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/IPreview.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using UnityEngine; - -namespace AdvancedInspector -{ - /// - /// Implements the method required to display an inspector preview. - /// - public interface IPreview - { - /// - /// This should return instance(s) of the following type; - /// GameObject - /// Mesh - /// Material - /// Texture - /// Cubemap - /// If return null or empty array, preview is turned off. - /// - UnityEngine.Object[] Preview { get; } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Interface/IPreview.cs.meta b/Assets/Plugins/AdvancedInspector/Interface/IPreview.cs.meta deleted file mode 100644 index 841448df..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/IPreview.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: bea75a5ed3255024b904a3ebfddcb15b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Interface/IRuntimeAttribute.cs b/Assets/Plugins/AdvancedInspector/Interface/IRuntimeAttribute.cs deleted file mode 100644 index 10710819..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/IRuntimeAttribute.cs +++ /dev/null @@ -1,44 +0,0 @@ -using UnityEngine; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -namespace AdvancedInspector -{ - /// - /// Define an attribute that stores a method name - /// Which should be turned into a delegate at runtime. - /// - public interface IRuntimeAttribute : IRuntimeAttribute - { - /// - /// Invoke the internal delegates and returns the requested values. - /// T should be the same type as the Delegate return type. - /// - T Invoke(int index, object instance, object value); - } - - public interface IRuntimeAttribute - { - /// - /// Name of the MethodInfo to retrieve at runtime. - /// - string MethodName { get; } - - /// - /// Prototype template of the delegate to create - /// - Type Template { get; } - - /// - /// Prototype template for static external delegate - /// - Type TemplateStatic { get; } - - /// - /// List of delegates to invoke. - /// - List Delegates { get; set; } - } -} \ No newline at end of file diff --git a/Assets/Plugins/AdvancedInspector/Interface/IRuntimeAttribute.cs.meta b/Assets/Plugins/AdvancedInspector/Interface/IRuntimeAttribute.cs.meta deleted file mode 100644 index 54a67e7e..00000000 --- a/Assets/Plugins/AdvancedInspector/Interface/IRuntimeAttribute.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a59d020caab68e44bbc71d13e9f12fc1 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/AdvancedInspector/Utility.meta b/Assets/Plugins/AdvancedInspector/Utility.meta deleted file mode 100644 index d7968f20..00000000 --- a/Assets/Plugins/AdvancedInspector/Utility.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 24d4e9172de017a4b805b56622be50d7 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/AdvancedInspector/Utility/TypeUtility.cs b/Assets/Plugins/AdvancedInspector/Utility/TypeUtility.cs deleted file mode 100644 index a445b8e9..00000000 --- a/Assets/Plugins/AdvancedInspector/Utility/TypeUtility.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; - -namespace AdvancedInspector -{ - public class TypeUtility - { - public static Type GetTypeByName(string name) - { - foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) - { - foreach (Type type in assembly.GetTypes()) - { - if (type.Name == name) - return type; - } - } - - return null; - } - } -} diff --git a/Assets/Plugins/AdvancedInspector/Utility/TypeUtility.cs.meta b/Assets/Plugins/AdvancedInspector/Utility/TypeUtility.cs.meta deleted file mode 100644 index dd719c2c..00000000 --- a/Assets/Plugins/AdvancedInspector/Utility/TypeUtility.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2053e8109e8ace34897756007aa622d2 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector.meta b/Assets/Plugins/Editor/AdvancedInspector.meta deleted file mode 100644 index 95d6ec65..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 5fc2dde4e518f4743be154c3078ef7c9 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.XML b/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.XML deleted file mode 100644 index a2386fed..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.XML +++ /dev/null @@ -1,1630 +0,0 @@ - - - - AdvancedInspector - - - - - A collection of static method made to handle the drawing of the Advanced Inspector. - In most cases, you won't have to deal with this class. - - - - - This EditorWindow can recieve and send Toolbox inputs. - - - - - Called when the Toolbox shortcut is pressed. - The implementation should call CreateToolbox if the condition are right. - - - - - Called when the associated toolbox is closed. - Only called when Ok/Cancel or Enter/Escape is pressed. - There's no reliable way of trapping the "click outside the popup" event. - - - - - IModal Implementation. - - - - - IModal Implementation. - - - - - Called by an Editor to have a collection of InspectorField to be displayed. - Uniformized entry point of inspector drawing. - - - - - Called by an Editor to have a collection of InspectorField to be displayed. - Uniformized entry point of inspector drawing. - - - - - Called by an Editor to have a collection of InspectorField to be displayed. - Uniformized entry point of inspector drawing. - - - - - Entry point of the inspection of a Property based editor. - - - - - Unity doesn't always properly init it's array/list if a serialization reload didn't occur. - - - - - Draw the arrow icon that allow to browse sub-object property. - - - - - Draw the control of an sortable list. - Return true if a list has been modified and requires a redraw. - - - - - Draw the - button for a Dictionary - - - - - Draw the "Restricted" enum, which is a runtime list provide by a method. - - - - - Draw the +/- icon to control the creation and deletion of user created object. - - - - - Draw the + icon of a List - - - - - Draw the + icon of a Dictionary - - - - - Draw the left side of a field, the label. - - - - - Width of the label part. - - - - - Draw the help box bellow the field. - - - - - Help box at the top or bottom of the whole inspector. - - - - - This method is invoked to build a list of proper delegate to invoke. - - - - - Get the list of valid derivaton from a specific type. - Used to create derived object, should always be from ComponentMonoBehaviour but is not enforced. - - - - - Group box style - - - - - When complex operation are performed, the Inspector blocks repaint. - - - - - Current complexity level. - - - - - How the fields are sorted. - - - - - Raised if the inspector needs a redraw. - - - - - Used for internal callback from a modal windows. - - - - - Used for internal callback from a modal windows. - - - - - Field sorting enum. - - - - - No sorting, using the order found in code. - - - - - Alphabethic sorting A, B, C... - - - - - Anti-alphabethic sorting, C, B, A... - - - - - When a specific type is encounter by the Inspector, we check if someone defined an field editor for it. - When it occurs, all the field drawing is left to the custom editor. - - - - - Minimum field height - - - - - Button Height - - - - - Standard float-in-vector label width - - - - - The draw call from the Inspector. - - - - - Called after the label is drawn. - Useful to add dragging modifier. - - - - - Event raised when someone click a label. - - - - - Event raised when someone double click a label. - - - - - Fired when someone click and drag the label with modified key (control/shift/alt) pressed. - A normal drag performs a copy/paste. - - - - - Event raised when someone right-click a label. - The GenenicMenu is empty and can add new items in it. - - - - - Get the value of a field. - Flag "Show Mixed Value" automaticly and return null if a multi-selection has different values. - - - - - Override if you want to prevent a type from being expandable at any time. - Override the Expandable attributes. - - - - - If true and no fieldeditor is found for a specific type, this fieldeditor is used for the derived type. - - - - - List of type this FieldEditor edit. - - - - - Base class of BehaviourEditor, ScriptableEditor and ExternalEditor. - - - - - Preview is handled internally and is turned on and off using IPreview interface. - - - - - In case of value type, we need to know the parent. - - - - - List of fields held by this inspector. - - - - - When a value changed internally, this forces the fields to be refreshed. - - - - - Unity's OnEnable. - - - - - Unity's OnDisable - - - - - Start the Scene View picking tool. - Type can define the component we seek on a GameObject. - - - - - Stop the picking tool before it has resolved. - - - - - Preview Draw - - - - - Override this method if you want to draw on the scene view. - Don't forget to call the base. - - - - - Preview Settings - - - - - Data Changed, repaint. - - - - - Unity's Default Margins. False if running in Advanced Inspector. - - - - - Default Inspector entry point. - - - - - Similar to "DrawDefaultInspector", except this is the Advanced one. - - - - - Force this field to rebuild the list of its children. - If you implement an editor specific to a type, you should only need to override this method. - Consider clearing existing fields before adding new one. - - - - - Is the Inspector currently in picking mode? - - - - - Return true if this editor is using advanced features. - - - - - We use our own targets list because we can draw object not deriving from UnityEngine.Object. - - - - - List of fields held by this inspector. - - - - - Override this if you implement your own inspector and doesn't want it to be expandable. - - - - - If true, will test if the type of in the inspector object has "AdvancedInspector" attributes. - Default; false; - - - - - Behaviour Editor is the entry point for all MonoBehaviour in Advanced Inspector. - - - - - Unity's OnEnable. - - - - - Should we check for the [AdvancedInspectorAttribute]? - - - - - Similar to a standard PropertyInspector, but can be called from outside the scope of a Inspector. - Useful to build your own EditorWindow with an integrated inspector. - Call the method Draw with a Rect of the region to draw on. - - - - - Define a control that can be drawn in an EditorWindow. - - - - - Draw the control. Return if the parent EditorWindow should repaint the window. - - - - - In the event an internal process of the Control want a repaint of the window outside the Drawing scope. - - - - - IControl implementation - - - - - If false, the Inspector won't draw the expander and won't reserve space on the left of the labels. - - - - - Can the separator be dragged around? - - - - - Where is the separator? - In PerPixel, the value is in pixel from the top or the left. - Otherwise, it's in %. - - - - - IControl implementation - - - - - Scriptable Editor is the entry point for all ScriptableObject in Advanced Inspector. - - - - - Unity's OnEnable. - - - - - Should we check for the [AdvancedInspectorAttribute]? - - - - - Pooled information about a PropertyInfo and translated for the Inspector. - - - - - This constructor is used as a duplication. - Note that this field is free and not parented to anything. - Use with great care! - - - - - Entry point for a generic manually created field. - - - - - Entry point for a generic manually created field. - - - - - Entry point for a generic indexed serialized created field. - - - - - Entry point for a generic serialized created field. - - - - - Entry point for an empty field with no editor. - - - - - Entry point of a group. - - - - - Entry point of a toolbar. - - - - - Entry point for a indexed field. - You should not create this manually. - - - - - Entry point of a Dictionary item. - - - - - Entry point for a non-member related field. - Useful to draw a single FieldEditor. - - - - - Script entry point. - - - - - Entry point for a Field created from a path and Object ids. - - - - - Entry point for a method field. (Button) - - - - - Entry point for a method field. (Button) - - - - - Entry point for a standard field. - - - - - Entry point for a standard field. - - - - - Entry point for a standard field. - - - - - Entry point for a standard property. - - - - - Entry point for a standard property. - - - - - Entry point for a standard property. - - - - - Compares if two InspectorField contains the same data. - - - - - Compares if two InspectorField contains the same data. - - - - - Compares if two InspectorField contains the same data. - - - - - HashCode - - - - - - IComparable implementation - - - - - IComparable implementation - - - - - Force a new attribute to be added a runtime. - - - - - Get an attribute by type that was applied to the original item. - - - - - Get an attribute by type that was applied to the original item. - - - - - Get all the attributes by type that were applied to the original item. - - - - - Get all the attributes by type that were applied to the original item. - - - - - Return true if the memberinfo of this field is sporting that specific attribute type. - - - - - Return true if the memberinfo of this field is sporting that specific attribute type. - - - - - Add this field to the watch list, which is displayed on the Watch window. - - - - - Force the selection of the serialized instances of this field. - - - - - Attempt to save this field value in play mode the next time it is stopped. - - - - - Apply this field modification to its prefab parent. - - - - - Revert any modification of this field and retreived the original value of its prefab parent. - - - - - Record the object state for undo purpose. - - - - - Copy the current value of this field to the clipboard. - - - - - Return true if the passed value can be copied over this field. - - - - - Paste the clipboard data to this field. - Careful, you should do a type test before. - - - - - The current value of this field. - If not a field, returns null. - If multi object, return null if all the value aren't the same. - - - - - The current value of this field. - If not a field, returns null. - If multi object, return null if all the value aren't the same. - - - - - The value of this field, based on a specific object instance. - - - - - The value of this field, based on a specific object instance. - - - - - Get all instances value. - - - - - Get all instances value. - - - - - Reset this field to its default value. - Object = null - Value Type = default(T) - - - - - Set the value of this field. - Support undo. When calling this, assume undo will be "Set Value MyField" - - - - - Set the value of this field, based on a specific object instance. - Does not support undo, should be recorded before calling. - - - - - Flags the related serialized instance as dirty. - - - - - Reparse the internal sub-fields of this field. - Useful when a list or an object changed. - - - - - Sort all children fields. - - - - - Get a MemberInfo from a serializable path. - The "Path" property from a InspectorField is a valid path. - - - - - Get a value from a serializable path. - The "Path" property from a InspectorField is a valid path. - - - - - Set a value by a serializable path. - The "Path" property from a InspectorField is a valid path. - - - - - Return a list of indexed field. Work with List and Array. - - - - - Return a list of keyed field. Work with IDictionary. - - - - - Get fields from an object. - - - - - Get fields from an object. - - - - - Get fields from an object. Bypass ignore Inspect and Expandable attributes. - - - - - The object owning this specific field. - - - - - The serialized object owning this specific field. - May not be the same as the instance, or even the currently Selected item in the Inspector. - - - - - The prefab parent to this object. - - - - - The member info of this field. - PropertyInfo, FieldInfo or MethodInfo. Otherwise null. - - - - - The attributes of this field, manually and by reflection. - - - - - Used only for the Script object reference at the top, or hidden Unity property. - - - - - Get the parents GameObjects in cases of components. Useful for undoes. - - - - - The parent field in case of nesting. - Null if directly at the top. - - - - - Subfields, such as field in an expandable object, or a list. - - - - - Fields used for edition, are not drawn by the Inspector automaticly. - - - - - Indentation depth of this field. - - - - - Is this field a method, field, property or a group? - - - - - External editor are sometimes used to browse non-Unity object. - Sadly, undo only works on valid Unity objects. - Also return false if one of the serializable parent became null or none. - - - - - The type of this field. - In most case, would return the FieldInfo.FieldType or PropertyInfo.PropertyType - In case of a group, it returns null. - If this field is flagged as Runtime-Resolved, it returns the type of the current value. - - - - - In case of a collection, returns the base type. - Ex.: int[] or List(int), base type if int. - In a dictionary, return the value type. - - - - - In case of a dictionary, returns the key type. - Return null otherwise. - - - - - The Inspect Attribute that made this field visible. - - - - - The Override Editor assigned to this field. - No field can be drawn without one. - - - - - A restrictor turns any field into a drop down list of specific choices. - - - - - Is this field part of a group? - - - - - Is this field part of a toolbar? - - - - - Is this field visibility controlled by a tab? - - - - - In cases of tabs, this is the currently selected tab enum value. - - - - - The Descriptor assigned to this field. Name, tooltip, icon, etc. - In case of multi-objects, there is no runtime invokation and the descriptor returned is the one on the member. - - - - - Returns true if the item inspected is static. - - - - - Readonly field cannot be edited. - In case of multi-objects, if any is readonly, all are. - - - - - Is this field animated. Only works for fields, not property. - - - - - The Help data being drawn after the field. - Does not work in multi-object edition. - - - - - This field is a bypass field, and sub-field automaticly recieve that flag. - - - - - Can this field be expanded? - It display the arrow button. - - - - - Is this field open and displaying internal fields? - - - - - Was this field erased? - - - - - Is this object display as being part of the parent? - - - - - Can this object field display the "+" sign to create a derived object from the base type? - - - - - Name of the label of that field. - Can be modified by Descriptor. - - - - - The color of the editable field. - - - - - The color of the background (ex.: Expandable box) - - - - - Priority of a field, used when sorting. - - - - - The order at which this field was found in the code. - If an indexed field, return the index. - - - - - If false, this field does not draw its label. - Useful for toolbar. - - - - - The specific style this field is draw with. - - - - - Internal path to this specific field. - Used to keep persistant data across selection. - - - - - Many thing can prevent a field from being drawn. Ex.: InspectAttribute can hide it. - If internal data from Unity return an exception on read, we skip it. - - - - - Return false is any of the serialized parent have the hide flag "Not Editable". - - - - - Return true if the item is different from it's prefab parent. - Always return false if it's a non-value type and not a ref (UnityEngine.Object). - - - - - Return true when editing multiple object that doesn't have the same value. - Always return true if they are objects and not the same instance. - - - - - Return true if all instances are of the same type. - Which mean they are expandable even in multi-objects edition - - - - - Index of the field in a list or array. - Return -1 if not part of a collection. - - - - - Is this a collection? (array or list) - - - - - When in a dictionary, the key of this value. - - - - - Is this a dictionary? (UDictionary) - - - - - Returns the current number of children. - In case of list, returns the number of items in it. - In case of multiples list, return -1 if all list doesn't have the same number of items. - - - - - Test if the current type overload ToString properly. - - - - - Type of InspectorField. - - - - - Empty unset field - - - - - Field containing a FieldInfo - - - - - Field containing a PropertyInfo - - - - - Field containing a MethodInfo - - - - - The InspectorField is only a wrapper around a SerializedProperty object. - To use in case of hidden property in the Unity API. - - - - - Field that is a group of other field. - - - - - Field that is drawn as a toolbar. (horizontal group) - - - - - Unlinked field just stores a value internally and is not bound to an object. - - - - - The top field, the reference towards the original script. - - - - - Handles the Advanced Inspector preferences. - - - - - Returns true if the control is valid in the current Event context. - - - - - Returns true if the control is valid in the current Event context. - - - - - The style collection used for the different element. - - - - - If true, all classes that do not have a Custom Editor are drawn by Advanced Inspector. - - - - - The control for scrolling numbers. - - - - - The control to copy-paste by drag. - - - - - The control modifier used when clicking on an expansion arrow. Expand/Collapse sub-nodes. - - - - - Usually to open the contextual menu, you do Right-Click. - In some cases, people may not have access to a proper right-click, so they can do CTRL+Click for example. - - - - - Extra indentation applied to boxes. - - - - - The maximum number of displayed item in a collection. Trigger the large collection arrow display beyond that. - - - - - The accepted control that involves dragging. - - - - - The control is turned off. - - - - - Single drag. - - - - - Alt+Drag - - - - - Control+Drag - - - - - Shift+Drag - - - - - The modifier keys involded in non-dragging action. - - - - - Alt Key - - - - - Control Key - - - - - Shift Key - - - - - This class handles the rendering and input of the Preview zone. - - - - - Object to be previewed - Supported type; - GameObject - Mesh - Material - Texture - - - - - The different internal style. - - - - - No boxes, no nothing. Clean, similar to Unity default. - - - - - Round boxes. - - - - - Unity flat style - - - - - A wrapper recongnized by the internal inspector so that non-UnityEngine.Object can be inspected. - - - - - Force Unity's "Selection" to use a non-unity object. - - - - - Is this object selected by Unity's Selection? - - - - - Get currenty Unity's Selection - - - - - Object to Inspector - - - - - A copy/paste buffer. - Does not use the System buffer, as it's limited to a string and Unity does not provide a uniformed string serialization. - - - - - Create an instance of type - Works with values, list, array, scriptableObject, string - Components are ignored. - - - - - Create an instance of type - Works with values, list, array, scriptableObject, string - Components are ignored. - - The owner MonoBeahviour is used in case of the creation of a ComponentMonoBehaviour for its internal binding. - - - - - Perform a deep copy if an object. - Does not perform copies of Components or GameObject - Values are returned as is (ex.: 14) - strings are cloned. - List/Array are enumerated and copied. - Everything else is deep copied by fields. - - - - - Test if the current clipboard data can be converted into a specific type. - Ex.: int to string - - - - - Test if the current clipboard data can be converted into a specific type. - Ex.: int to string - - - - - Return true if an object is convertable to a type. - - - - - In case of any normal object, returns deep copy of that object. - In case of a Component, returns the original so you can apply it on a GameObject yourself (sorry) - In case of a UnityEngine.Object, create a new one and perforce a Serialization Copy. - - - - - Type of the current data in the clipboard. - - - - - A separator holds two control side by side and divide them with a draggable line. - It can be horizontal or vertical. - - - - - Draw the whole region holding the two control and the separator. - The separator pass down the proper region to Draw of the sub-controls. - Returns true if the window needs to be repainted. - - - - - Targeted object - - - - - Is on top of the target - - - - - Selecttion dragged - - - - - Extends Enum with some bitfields related method. - - - - - Add a value to a bitfield. - - - - - Remove a value from a bitfield. - - - - - Test if a bitfield has a value. - - - - - Gets an attribute on an enum field value - - The type of the attribute you want to retrieve - The enum value - The attribute of type T that exists on the enum value - - - - Extends Enum with some bitfields related method. - - - - - Returns the nearest parent class that is generic. - - - - - The DateTime dialog is a date picker that is day/week accurate. - - - - - Define a popup window that return a result. - Base class for IModal implementation. - - - - - Top title bar height - - - - - The object that invoked this modal. - - - - - Internal modal result. - - - - - Default constructor. - - - - - Invoked by Unity when the user click outside the window. - - - - - Called when pressing Escape or Cancel. - - - - - Called when pressing Enter or Ok. - - - - - Does this specific modal type exist? - - - - - Usually you should not override this. - - - - - Implement your draw items here. - - - - - Result of this modal window. - - - - - Height of dialog - - - - - Width of dialog - - - - - Create this dialog. - - - - - Draw the dialog region. - - - - - Modified DateTime if Result is Ok - - - - - The toolbox is a generic way of display a selection to the user. - Any EditorWindow that implement IToolbox will call it when CTRL+Q is request it. - It is up to the window to fill the content of the Toolbox. - - - - - Add an item to the toolbox list. - - - - - Create a toolbox for this IModal. - - - - - Create a toolbox for this IModal. - - - - - IControl implementation - - - - - List of items visible by this toolbox. - - - - - The current selection. - - - - - The search term entered in the search field. - - - - - Result returned by a Modal Window - - - - - No result, no action taken - - - - - Ok or Enter - - - - - Cancel or Escape - - - - - An error occured - - - - - User clicked outside the modal - - - - - A control that is a list of item that can be nested. - Support drag and drop, editing and sorting. - - - - - Refresh the list of visible item when the items list has changed. - - - - - Refresh the list of visible item when the items list has changed. - - - - - Current selected tags. - - - - - Number of visible nodes. - - - - diff --git a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.XML.meta b/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.XML.meta deleted file mode 100644 index 55a2b378..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.XML.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e96c4a7c78e365541b0512e981e9e981 -timeCreated: 1426031802 -licenseType: Store -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.dll b/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.dll deleted file mode 100644 index 86f31e26..00000000 Binary files a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.dll and /dev/null differ diff --git a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.dll.meta b/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.dll.meta deleted file mode 100644 index 196bd820..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 09b9181468d6b774aa9b3e4e0654892d -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.pdb b/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.pdb deleted file mode 100644 index 7cfacf7d..00000000 Binary files a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.pdb and /dev/null differ diff --git a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.pdb.meta b/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.pdb.meta deleted file mode 100644 index f65772af..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/AdvancedInspector.pdb.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 454ad4bbaca47654ba1ba02c97f6efab -timeCreated: 1426031799 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Editor/AdvancedInspector/Examples.meta b/Assets/Plugins/Editor/AdvancedInspector/Examples.meta deleted file mode 100644 index c595a197..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/Examples.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: bbde48e2fa9194d469ae2a4b99c3729a -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/Examples/ExternalInspectorWindow.cs b/Assets/Plugins/Editor/AdvancedInspector/Examples/ExternalInspectorWindow.cs deleted file mode 100644 index e1a7cdac..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/Examples/ExternalInspectorWindow.cs +++ /dev/null @@ -1,76 +0,0 @@ -using UnityEngine; -using UnityEditor; - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -using AdvancedInspector; - -public class ExternalInspectorWindow : EditorWindow -{ - private ExternalEditor editor; - - private GameObject go; - private Component component; - - [MenuItem("Window/Advanced Insector Example")] - public static void Init() - { - ExternalInspectorWindow window = EditorWindow.GetWindow(); - window.wantsMouseMove = true; - window.editor = ExternalEditor.CreateInstance(); - - window.editor.DraggableSeparator = false; - window.editor.DivisionSeparator = 150; - } - - private void OnSelectionChange() - { - go = Selection.activeGameObject; - Repaint(); - } - - private void OnGUI() - { - if (go == null) - { - GUILayout.Label("Select a GameObject..."); - component = null; - editor.Instances = new object[0]; - } - else - { - Component[] components = go.GetComponents(typeof(Component)); - GUIContent[] contents = new GUIContent[components.Length + 1]; - contents[0] = new GUIContent("None"); - int index = -1; - for (int i = 0; i < components.Length; i++) - { - contents[i + 1] = new GUIContent(components[i].GetType().Name); - if (components[i] == component) - index = i + 1; - } - - EditorGUI.BeginChangeCheck(); - index = EditorGUILayout.Popup(new GUIContent("Select a component: "), index, contents); - if (EditorGUI.EndChangeCheck()) - { - if (index == 0) - { - component = null; - editor.Instances = new object[0]; - } - else - { - component = components[index - 1]; - editor.Instances = new object[] { component }; - } - } - } - - if (editor.Draw(new Rect(0, 16, position.width, position.height - 16))) - Repaint(); - } -} diff --git a/Assets/Plugins/Editor/AdvancedInspector/Examples/ExternalInspectorWindow.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/Examples/ExternalInspectorWindow.cs.meta deleted file mode 100644 index a7870aa5..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/Examples/ExternalInspectorWindow.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c9740780a68d7d744b5281622bbd706b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI.meta b/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI.meta deleted file mode 100644 index 8c84ce35..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: a52feea1ebf19884bb717531c7fd0cac -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUI.cs b/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUI.cs deleted file mode 100644 index 4219fa75..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUI.cs +++ /dev/null @@ -1,196 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using UnityEngine; -using UnityEditor; - -using UniToolsEditor; - -namespace AdvancedInspector -{ - public static class ExtraGUI - { - private static Texture knob; - - private static Texture Knob - { - get - { - if (knob == null) - { - knob = Helper.Load(EditorResources.Knob); - knob.filterMode = FilterMode.Trilinear; - } - - return knob; - } - } - - private static Texture knobBack; - - private static Texture KnobBack - { - get - { - if (knobBack == null) - knobBack = Helper.Load(EditorResources.KnobBack); - - return knobBack; - } - } - - private static Vector2 mousePosition; - - public static float FloatAngle(Rect rect, float value) - { - return FloatAngle(rect, value, -1, -1, -1); - } - - public static float FloatAngle(Rect rect, float value, float snap) - { - return FloatAngle(rect, value, snap, -1, -1); - } - - public static float FloatAngle(Rect rect, float value, float snap, float min, float max) - { - int id = GUIUtility.GetControlID(FocusType.Passive, rect); - - Rect knobRect = new Rect(rect.x, rect.y, rect.height, rect.height); - - float delta; - if (min != max) - delta = ((max - min) / 360); - else - delta = 1; - - if (Event.current != null) - { - if (Event.current.type == EventType.MouseDown && knobRect.Contains(Event.current.mousePosition)) - { - GUIUtility.hotControl = id; - mousePosition = Event.current.mousePosition; - } - else if (Event.current.type == EventType.MouseUp && GUIUtility.hotControl == id) - GUIUtility.hotControl = 0; - else if (Event.current.type == EventType.MouseDrag && GUIUtility.hotControl == id) - { - Vector2 move = mousePosition - Event.current.mousePosition; - value += delta * (-move.x - move.y); - - if (snap > 0) - { - float mod = value % snap; - - if (mod < (delta * 3) || Mathf.Abs(mod - snap) < (delta * 3)) - value = Mathf.Round(value / snap) * snap; - } - - mousePosition = Event.current.mousePosition; - GUI.changed = true; - } - } - - GUI.DrawTexture(knobRect, KnobBack); - Matrix4x4 matrix = GUI.matrix; - - if (min != max) - GUIUtility.RotateAroundPivot(value * (360 / (max - min)), knobRect.center); - else - GUIUtility.RotateAroundPivot(value, knobRect.center); - - GUI.DrawTexture(knobRect, Knob); - GUI.matrix = matrix; - - Rect label = new Rect(rect.x + rect.height + 9, rect.y + (rect.height / 2) - 9, rect.height, 18); - value = EditorGUI.FloatField(label, value); - - if (min != max) - value = Mathf.Clamp(value, min, max); - - return value; - } - - public static int IntAngle(Rect rect, int value) - { - return IntAngle(rect, value, -1, -1, -1); - } - - public static int IntAngle(Rect rect, int value, int snap) - { - return IntAngle(rect, value, snap, -1, -1); - } - - public static int IntAngle(Rect rect, int value, int snap, int min, int max) - { - int id = GUIUtility.GetControlID(FocusType.Passive, rect); - - Rect knobRect = new Rect(rect.x, rect.y, rect.height, rect.height); - - int delta; - if (min != max) - delta = ((max - min) / 360); - else - delta = 1; - - if (Event.current != null) - { - if (Event.current.type == EventType.MouseDown && knobRect.Contains(Event.current.mousePosition)) - { - GUIUtility.hotControl = id; - mousePosition = Event.current.mousePosition; - } - else if (Event.current.type == EventType.MouseUp && GUIUtility.hotControl == id) - GUIUtility.hotControl = 0; - else if (Event.current.type == EventType.MouseDrag && GUIUtility.hotControl == id) - { - Vector2 move = mousePosition - Event.current.mousePosition; - value += delta * (-(int)move.x - (int)move.y); - - if (snap > 0) - { - float mod = value % snap; - - if (mod < (delta * 3) || Mathf.Abs(mod - snap) < (delta * 3)) - value = (int)Mathf.Round(value / snap) * snap; - } - - mousePosition = Event.current.mousePosition; - GUI.changed = true; - } - } - - GUI.DrawTexture(knobRect, KnobBack); - Matrix4x4 matrix = GUI.matrix; - - if (min != max) - GUIUtility.RotateAroundPivot(value * (360 / (max - min)), knobRect.center); - else - GUIUtility.RotateAroundPivot(value, knobRect.center); - - GUI.DrawTexture(knobRect, Knob); - GUI.matrix = matrix; - - Rect label = new Rect(rect.x + rect.height + 9, rect.y + (rect.height / 2) - 9, rect.height, 18); - value = EditorGUI.IntField(label, value); - - if (min != max) - value = Mathf.Clamp(value, min, max); - - return value; - } - - public static int CycleButton(Rect rect, int selected, GUIContent[] contents, GUIStyle style) - { - if (GUI.Button(rect, contents[selected], style)) - { - selected++; - if (selected >= contents.Length) - selected = 0; - } - - return selected; - } - } -} diff --git a/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUI.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUI.cs.meta deleted file mode 100644 index 82b25bc2..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUI.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e020a2d8f59a2864999a0b1bce4e072e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUILayout.cs b/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUILayout.cs deleted file mode 100644 index 608a45f5..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUILayout.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using UnityEngine; -using UnityEditor; - -namespace AdvancedInspector -{ - public static class ExtraGUILayout - { - public static float FloatAngle(float value) - { - return FloatAngle(value, -1, -1, -1); - } - - public static float FloatAngle(float value, float snap) - { - return FloatAngle(value, snap, -1, -1); - } - - public static float FloatAngle(float value, float snap, float min, float max) - { - Rect rect = GUILayoutUtility.GetRect(128, 512, 32, 32); - rect.x += 8; - return ExtraGUI.FloatAngle(rect, value, snap, min, max); - } - - public static int IntAngle(int value) - { - return IntAngle(value, -1, -1, -1); - } - - public static int IntAngle(int value, int snap) - { - return IntAngle(value, snap, -1, -1); - } - - public static int IntAngle(int value, int snap, int min, int max) - { - Rect rect = GUILayoutUtility.GetRect(128, 512, 32, 32); - rect.x += 8; - return ExtraGUI.IntAngle(rect, value, snap, min, max); - } - - public static int CycleButton(int selected, GUIContent[] contents, GUIStyle style) - { - if (GUILayout.Button(contents[selected], style)) - { - selected++; - if (selected >= contents.Length) - selected = 0; - } - - return selected; - } - } -} diff --git a/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUILayout.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUILayout.cs.meta deleted file mode 100644 index 37dfd46d..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/ExtraGUI/ExtraGUILayout.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5a5c459bbc6263843ad47a5a586832ce -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors.meta deleted file mode 100644 index 4977dd9e..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: ab0ea0ba2acfe2e4ebd1654a33714ef2 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/AnimationCurveEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/AnimationCurveEditor.cs deleted file mode 100644 index e5514427..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/AnimationCurveEditor.cs +++ /dev/null @@ -1,29 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class AnimationCurveEditor : FieldEditor - { - public override Type[] EditedTypes - { - get { return new Type[] { typeof(AnimationCurve) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - AnimationCurve curve = GetValue(field) as AnimationCurve; - if (curve == null && !field.Mixed) - curve = new AnimationCurve(); - - EditorGUI.BeginChangeCheck(); - - AnimationCurve result = EditorGUILayout.CurveField(curve); - - if (EditorGUI.EndChangeCheck()) - field.SetValue(result); - } - } -} diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/AnimationCurveEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/AnimationCurveEditor.cs.meta deleted file mode 100644 index 5a6ec81d..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/AnimationCurveEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 175374f05b4f81243bd565df4b3842ac -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BooleanEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BooleanEditor.cs deleted file mode 100644 index f4d25a86..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BooleanEditor.cs +++ /dev/null @@ -1,30 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class BooleanEditor : FieldEditor - { - public override Type[] EditedTypes - { - get { return new Type[] { typeof(bool) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - object value = GetValue(field); - - EditorGUI.BeginChangeCheck(); - bool result; - if (style != null) - result = EditorGUILayout.Toggle((bool)value, style); - else - result = EditorGUILayout.Toggle((bool)value); - - if (EditorGUI.EndChangeCheck()) - field.SetValue(result); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BooleanEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BooleanEditor.cs.meta deleted file mode 100644 index 7013dc4e..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BooleanEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 3ed44e8dcffbde44eb2efd1c009248c6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BoundsEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BoundsEditor.cs deleted file mode 100644 index 773201e1..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BoundsEditor.cs +++ /dev/null @@ -1,134 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class BoundsEditor : FieldEditor - { - public override bool Expandable - { - get { return false; } - } - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(Bounds) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - float labelWidth = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = VECTOR_FIELD_WIDTH; - - Bounds[] values = field.GetValues(); - - float[] centerX = new float[values.Length]; - float[] centerY = new float[values.Length]; - float[] centerZ = new float[values.Length]; - float[] extendX = new float[values.Length]; - float[] extendY = new float[values.Length]; - float[] extendZ = new float[values.Length]; - - for (int i = 0; i < values.Length; i++) - { - centerX[i] = values[i].center.x; - centerY[i] = values[i].center.y; - centerZ[i] = values[i].center.z; - extendX[i] = values[i].extents.x; - extendY[i] = values[i].extents.y; - extendZ[i] = values[i].extents.z; - } - - GUILayout.BeginHorizontal(); - float result; - EditorGUILayout.LabelField("Center: ", GUILayout.Width(48)); - if (FloatEditor.DrawFloat("X", centerX, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Center X"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Vector3 center = values[i].center; - center.x = result; - values[i].center = center; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("Y", centerY, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Center Y"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Vector3 center = values[i].center; - center.y = result; - values[i].center = center; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("Z", centerZ, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Center Z"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Vector3 center = values[i].center; - center.z = result; - values[i].center = center; - field.SetValue(field.Instances[i], values[i]); - } - } - GUILayout.EndHorizontal(); - - GUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Extend: ", GUILayout.Width(48)); - if (FloatEditor.DrawFloat("X", extendX, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Extend X"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Vector3 extents = values[i].extents; - extents.x = result; - values[i].extents = extents; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("Y", extendY, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Extend Y"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Vector3 extents = values[i].extents; - extents.y = result; - values[i].extents = extents; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("Z", extendZ, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Extend Z"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Vector3 extents = values[i].extents; - extents.z = result; - values[i].extents = extents; - field.SetValue(field.Instances[i], values[i]); - } - } - GUILayout.EndHorizontal(); - - EditorGUILayout.Space(); - - EditorGUIUtility.labelWidth = labelWidth; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BoundsEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BoundsEditor.cs.meta deleted file mode 100644 index a51cf2ca..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/BoundsEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1c18b641c92f5f44eb38e807d2feed74 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/CharEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/CharEditor.cs deleted file mode 100644 index 2a82f0ea..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/CharEditor.cs +++ /dev/null @@ -1,40 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class CharEditor : FieldEditor - { - public override Type[] EditedTypes - { - get { return new Type[] { typeof(char) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - GUILayout.BeginHorizontal(); - - object value = GetValue(field); - string text = ""; - if (value != null) - text = value.ToString(); - - EditorGUI.BeginChangeCheck(); - - string result = EditorGUILayout.TextField(text); - - char c; - if (result.Length == 0) - c = '\0'; - else - c = result[0]; - - if (EditorGUI.EndChangeCheck()) - field.SetValue(c); - - GUILayout.EndHorizontal(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/CharEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/CharEditor.cs.meta deleted file mode 100644 index e9be5d8b..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/CharEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b97d572b1c98e564f91d1a16c55cabc3 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ColorEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ColorEditor.cs deleted file mode 100644 index c8974082..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ColorEditor.cs +++ /dev/null @@ -1,49 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class ColorEditor : FieldEditor - { - public override bool Expandable - { - get { return false; } - } - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(Color), typeof(Color32) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - object o = GetValue(field); - Type type = o.GetType(); - - Color color; - if (type == typeof(Color32)) - { - Color32 color32 = (Color32)o; - color = color32; - } - else - color = (Color)o; - - EditorGUI.BeginChangeCheck(); - color = EditorGUILayout.ColorField(color); - - if (EditorGUI.EndChangeCheck()) - { - if (type == typeof(Color32)) - { - Color32 color32 = color; - field.SetValue(color32); - } - else - field.SetValue(color); - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ColorEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ColorEditor.cs.meta deleted file mode 100644 index e2813cf6..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ColorEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 95ebae573d4fa724eb1787d862581a82 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/DateTimeEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/DateTimeEditor.cs deleted file mode 100644 index de120b87..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/DateTimeEditor.cs +++ /dev/null @@ -1,69 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -using UniToolsEditor; - -namespace AdvancedInspector -{ - public class DateTimeEditor : FieldEditor, IModal - { - private InspectorField field; - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(DateTime) }; } - } - - private static Texture calendar; - - internal static Texture Calendar - { - get - { - if (calendar == null) - calendar = Helper.Load(EditorResources.Calendar); - - return calendar; - } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - DateTime time = field.GetValue(); - if (time == DateTime.MinValue) - time = DateTime.Now; - - string title = time.ToString(); - if (field.Mixed) - title = " - - - "; - - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.Space(); - if (GUILayout.Button(Calendar, GUIStyle.none, GUILayout.Width(18), GUILayout.Height(18))) - { - this.field = field; - DateTimeDialog.Create(this, time, GUIUtility.GUIToScreenPoint(Event.current.mousePosition)); - } - - TextAnchor anchor = GUI.skin.label.alignment; - GUI.skin.label.alignment = TextAnchor.MiddleLeft; - GUILayout.Label(title); - GUI.skin.label.alignment = anchor; - - GUILayout.FlexibleSpace(); - EditorGUILayout.EndHorizontal(); - } - - public void ModalRequest(bool shift) { } - - public void ModalClosed(ModalWindow window) - { - if (window.Result != WindowResult.Ok) - return; - - field.SetValue(((DateTimeDialog)window).Time); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/DateTimeEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/DateTimeEditor.cs.meta deleted file mode 100644 index f247aa3f..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/DateTimeEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e4176afc2bf64fb4cb22c40d470180a7 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/EnumEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/EnumEditor.cs deleted file mode 100644 index 627aba7c..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/EnumEditor.cs +++ /dev/null @@ -1,192 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace AdvancedInspector -{ - public class EnumEditor : FieldEditor - { - public override bool EditDerived - { - get { return true; } - } - - public override bool Expandable - { - get { return false; } - } - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(Enum) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - EnumAttribute display = field.GetAttribute(); - - EditorGUI.showMixedValue = field.Mixed; - - EditorGUI.BeginChangeCheck(); - - object result = null; - long value = Convert.ToInt64(GetValue(field)); - if (display == null || !display.Masked) - { - if (display == null || display.Display == EnumDisplay.DropDown) - result = DrawDropDown(field.Type, value, style, false); - else if (display.Display == EnumDisplay.Button) - result = DrawEnum(field.Type, value, display.MaxItemsPerRow, style == null ? EditorStyles.toolbarButton : style); - else if (display.Display == EnumDisplay.Checkbox) - result = DrawEnum(field.Type, value, display.MaxItemsPerRow, style == null ? EditorStyles.toggle : style); - } - else - { - if (display == null || display.Display == EnumDisplay.DropDown) - result = DrawDropDown(field.Type, value, style, true); - else if (display.Display == EnumDisplay.Button) - result = DrawMasked(field.Type, value, display.MaxItemsPerRow, style == null ? EditorStyles.toolbarButton : style); - else if (display.Display == EnumDisplay.Checkbox) - result = DrawMasked(field.Type, value, display.MaxItemsPerRow, style == null ? EditorStyles.toggle : style); - } - - if (EditorGUI.EndChangeCheck()) - field.SetValue(result); - } - - private int SelectedIndex(Array values, long value) - { - for (int i = 0; i < values.Length; i++) - if (Convert.ToInt64(values.GetValue(i)) == value) - return i; - - return 0; - } - - private string[] GetNames(Type type) - { - Array values = Enum.GetValues(type); - List names = Enum.GetNames(type).ToList(); - - for (int i = 0; i < names.Count; i++) - { - DescriptorAttribute descriptor = ((Enum)values.GetValue(i)).GetAttribute(); - if (descriptor != null && !string.IsNullOrEmpty(descriptor.Name)) - names[i] = descriptor.Name; - else - names[i] = ObjectNames.NicifyVariableName(names[i]); - } - - return names.ToArray(); - } - - private object DrawDropDown(Type type, long value, GUIStyle style, bool masked) - { - string[] names = GetNames(type); - Array values = Enum.GetValues(type); - - if (masked) - { - if (style == null) - value = EditorGUILayout.MaskField(Convert.ToInt32(value), names); - else - value = EditorGUILayout.MaskField(Convert.ToInt32(value), names, style); - - return Enum.ToObject(type, value); - } - else - { - int selected = SelectedIndex(values, value); - - if (style == null) - selected = EditorGUILayout.Popup(selected, names); - else - selected = EditorGUILayout.Popup(selected, names, style); - - return Enum.ToObject(type, values.GetValue(selected)); - } - } - - private object DrawEnum(Type type, long value, int max, GUIStyle style) - { - if (max < 1) - max = 6; - - string[] names = GetNames(type); - Array values = Enum.GetValues(type); - - int rows = Mathf.CeilToInt((float)names.Length / (float)max); - int count = (names.Length / rows); - if (count * rows < names.Length) - count++; - - int selected = SelectedIndex(values, value); - - GUILayout.BeginVertical(); - - for (int i = 0; i < rows; i++) - { - GUILayout.BeginHorizontal(); - - for (int j = count * i; j < count * (i + 1); j++) - { - if (j >= names.Length) - break; - - if (selected == j) - GUILayout.Toggle(true, names[j], style); - else if (GUILayout.Toggle(false, names[j], style)) - selected = j; - } - - GUILayout.EndHorizontal(); - } - - GUILayout.EndVertical(); - - return Enum.ToObject(type, values.GetValue(selected)); - } - - private object DrawMasked(Type type, long value, int max, GUIStyle style) - { - if (max < 1) - max = 6; - - Array values = Enum.GetValues(type); - string[] names = GetNames(type); - - int rows = Mathf.CeilToInt((float)names.Length / (float)max); - int count = (names.Length / rows); - if (count * rows < names.Length) - count++; - - int result = 0; - - GUILayout.BeginVertical(); - - for (int i = 0; i < rows; i++) - { - GUILayout.BeginHorizontal(); - - for (int j = count * i; j < count * (i + 1); j++) - { - if (j >= names.Length) - break; - - int v = (int)values.GetValue(j); - if (GUILayout.Toggle(((int)value & v) == v, names[j], style)) - result |= v; - } - - GUILayout.EndHorizontal(); - } - - GUILayout.EndVertical(); - - return Enum.ToObject(type, result); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/EnumEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/EnumEditor.cs.meta deleted file mode 100644 index e8d95004..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/EnumEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 60d56c7709f5e334c837239c33327bbd -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/FloatEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/FloatEditor.cs deleted file mode 100644 index d139c02f..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/FloatEditor.cs +++ /dev/null @@ -1,208 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class FloatEditor : FieldEditor - { - public override Type[] EditedTypes - { - get { return new Type[] { typeof(float), typeof(decimal), typeof(double) }; } - } - - public override void OnLabelDraw(InspectorField field, Rect rect) - { - if (InspectorPreferences.IsDragControl(InspectorPreferences.ValueScroll)) - EditorGUIUtility.AddCursorRect(rect, MouseCursor.ResizeHorizontal); - } - - public override void OnLabelClick(InspectorField field) - { - EditorGUIUtility.SetWantsMouseJumping(1); - } - - public override void OnLabelDragged(InspectorField field) - { - if (InspectorPreferences.IsDragControl(InspectorPreferences.ValueScroll)) - { - object result = field.GetValues()[0]; - double sensitivity = CalculateDragSensitivity(result); - result = Convert.ToDouble(result) + (double)(sensitivity * HandleUtility.niceMouseDelta); - - RangeValueAttribute rangeValue = field.GetAttribute(); - if (rangeValue != null) - result = Math.Min(Math.Max((double)result, rangeValue.Min), rangeValue.Max); - - RangeAttribute range = field.GetAttribute(); - if (range != null) - result = Math.Min(Math.Max((double)result, range.min), range.max); - - try - { - result = Convert.ChangeType(result, field.Type); - field.SetValue(result); - } - catch (Exception) - { - return; - } - } - } - - private static double CalculateDragSensitivity(object value) - { - double number = Convert.ToDouble(value); - - if (!double.IsInfinity(number) && !double.IsNaN(number)) - return (Math.Max(1d, Math.Pow(Math.Abs(number), 0.5d)) * 0.03d); - - return 0d; - } - - public override void Draw(InspectorField field, GUIStyle style) - { - RangeValueAttribute rangeValue = field.GetAttribute(); - RangeAttribute range = field.GetAttribute(); - - if (range != null && rangeValue == null) - rangeValue = new RangeValueAttribute(range.min, range.max); - - AngleAttribute angle = field.GetAttribute(); - - object result; - if (DrawFloatingNumber(new GUIContent(""), field.GetValues(), rangeValue, angle, style, out result)) - field.SetValue(result); - } - - public static bool DrawFloat(string label, float[] values, out float result, params GUILayoutOption[] options) - { - return DrawFloat(label, values, null, null, null, out result, options); - } - - public static bool DrawFloat(string label, float[] values, GUIStyle style, out float result, params GUILayoutOption[] options) - { - return DrawFloat(label, values, null, null, style, out result, options); - } - - public static bool DrawFloat(string label, float[] values, RangeValueAttribute range, AngleAttribute angle, GUIStyle style, out float result, params GUILayoutOption[] options) - { - object genericResult; - object[] genericValues = new object[values.Length]; - for (int i = 0; i < values.Length; i++) - genericValues[i] = values[i]; - - bool changed = DrawFloatingNumber(new GUIContent(label), genericValues, range, angle, style, out genericResult, options); - - try - { - result = (float)genericResult; - } - catch (Exception) - { - result = values[0]; - return false; - } - - return changed; - } - - public static bool DrawFloatingNumber(GUIContent label, object[] values, RangeValueAttribute range, AngleAttribute angle, GUIStyle style, out object result, params GUILayoutOption[] options) - { - result = 0; - - EditorGUI.showMixedValue = false; - result = values[0]; - Type type = result.GetType(); - for (int i = 1; i < values.Length; i++) - { - if (values[i].Equals(result)) - continue; - - EditorGUI.showMixedValue = true; - break; - } - - EditorGUI.BeginChangeCheck(); - EditorGUILayout.BeginHorizontal(); - - if (!string.IsNullOrEmpty(label.text)) - { - int size = (int)GUI.skin.label.CalcSize(label).x; - if (size > 4) - size = Mathf.Max(size, 15); - - GUILayout.Label(label, GUI.skin.label, GUILayout.Width(size)); - - Event e = Event.current; - Rect labelRect = GUILayoutUtility.GetLastRect(); - int id = EditorGUIUtility.GetControlID(FocusType.Passive, labelRect); - - if (InspectorPreferences.IsDragControl(InspectorPreferences.ValueScroll)) - { - if (e.type == EventType.Repaint) - { - EditorGUIUtility.AddCursorRect(labelRect, MouseCursor.ResizeHorizontal); - } - else if (e.type == EventType.MouseDown && labelRect.Contains(e.mousePosition) && e.button == 0) - { - GUIUtility.hotControl = id; - GUIUtility.keyboardControl = id; - EditorGUIUtility.SetWantsMouseJumping(1); - e.Use(); - } - else if (e.type == EventType.MouseDrag && GUIUtility.hotControl == id) - { - double sensitivity = CalculateDragSensitivity(result); - result = Convert.ToDecimal(result) + (decimal)(sensitivity * HandleUtility.niceMouseDelta); - - if (range != null) - result = Math.Min(Math.Max((double)result, (double)range.Min), (double)range.Max); - - GUI.changed = true; - e.Use(); - } - else if (e.type == EventType.MouseUp && GUIUtility.hotControl == id) - { - GUIUtility.hotControl = 0; - EditorGUIUtility.SetWantsMouseJumping(0); - e.Use(); - } - } - } - - if (angle != null) - { - if (range != null) - result = ExtraGUILayout.FloatAngle((float)result, angle.Snap, range.Min, range.Max); - else - result = ExtraGUILayout.FloatAngle((float)result, angle.Snap); - } - else - { - if (range != null) - result = EditorGUILayout.Slider((float)result, range.Min, range.Max, options); - else - { - if (style != null) - result = EditorGUILayout.TextField(result.ToString(), style, options); - else - result = EditorGUILayout.TextField(result.ToString(), options); - } - } - - try - { - result = Convert.ChangeType(result, type); - } - catch (Exception) - { - return false; - } - - EditorGUILayout.EndHorizontal(); - return EditorGUI.EndChangeCheck(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/FloatEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/FloatEditor.cs.meta deleted file mode 100644 index edfb7b23..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/FloatEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4724a82f5fd3d9e44a50d524deae4259 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GradientEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GradientEditor.cs deleted file mode 100644 index 09910618..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GradientEditor.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; -using System.Reflection; - -namespace AdvancedInspector -{ - public class GradientEditor : FieldEditor - { - private static MethodInfo gradientField; - - public GradientEditor() - { - // Because Unity does not expose this EditorGUI. - gradientField = typeof(EditorGUILayout).GetMethod("GradientField", BindingFlags.NonPublic | BindingFlags.Static, null, new Type[] { typeof(Gradient), typeof(GUILayoutOption).MakeArrayType() }, null); - } - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(Gradient) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - object value = GetValue(field); - - try - { - //Always throw "ExitGUIException" - gradientField.Invoke(null, new object[] { value, null }); - } - catch (Exception) { } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GradientEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GradientEditor.cs.meta deleted file mode 100644 index 275d4027..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GradientEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 96cba1c5f2f4273468699cb64ae8726e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GuidEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GuidEditor.cs deleted file mode 100644 index 43fd51c9..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GuidEditor.cs +++ /dev/null @@ -1,25 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class GuidEditor : FieldEditor - { - public override Type[] EditedTypes - { - get { return new Type[] { typeof(Guid) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - // GetValue returns null if multi-selection and different values - Guid id = field.GetValue(); - if (id == Guid.Empty) - GUILayout.Label("GUID: --------------"); - else - GUILayout.Label("GUID: " + id.ToString()); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GuidEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GuidEditor.cs.meta deleted file mode 100644 index 15843f11..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/GuidEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 054dd34a1ddeb8b46848fcc673189bab -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/IntegerEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/IntegerEditor.cs deleted file mode 100644 index c88f59f2..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/IntegerEditor.cs +++ /dev/null @@ -1,195 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class IntegerEditor : FieldEditor - { - public override Type[] EditedTypes - { - get { return new Type[] { typeof(int), typeof(byte), typeof(short), typeof(long), typeof(uint), typeof(ushort), typeof(ulong), typeof(sbyte) }; } - } - - public override void OnLabelDraw(InspectorField field, Rect rect) - { - if (InspectorPreferences.IsDragControl(InspectorPreferences.ValueScroll)) - EditorGUIUtility.AddCursorRect(rect, MouseCursor.ResizeHorizontal); - } - - public override void OnLabelClick(InspectorField field) - { - EditorGUIUtility.SetWantsMouseJumping(1); - } - - public override void OnLabelDragged(InspectorField field) - { - if (InspectorPreferences.IsDragControl(InspectorPreferences.ValueScroll)) - { - object result = field.GetValues()[0]; - long value = Convert.ToInt64(result); - result = (long)Math.Round(value + (CalculateDragSensitivity(value) * HandleUtility.niceMouseDelta * 0.1f)); - - RangeValueAttribute rangeValue = field.GetAttribute(); - if (rangeValue != null) - result = Math.Min(Math.Max((long)result, (long)rangeValue.Min), (long)rangeValue.Max); - - RangeAttribute range = field.GetAttribute(); - if (range != null) - result = Math.Min(Math.Max((long)result, (long)range.min), (long)range.max); - - try - { - result = Convert.ChangeType(result, field.Type); - field.SetValue(result); - } - catch (Exception) - { - return; - } - } - } - - private static double CalculateDragSensitivity(object value) - { - return Math.Max(1, Math.Pow(Math.Abs((long)value), 0.5d) * 0.03d); - } - - public override void Draw(InspectorField field, GUIStyle style) - { - AngleAttribute angle = field.GetAttribute(); - - RangeValueAttribute rangeValue = field.GetAttribute(); - RangeAttribute range = field.GetAttribute(); - - if (range != null && rangeValue == null) - rangeValue = new RangeValueAttribute(range.min, range.max); - - object result; - if (DrawIntegerNumber(GUIContent.none, field.GetValues(), rangeValue, angle, style, out result)) - field.SetValue(result); - } - - public static bool DrawInt(string label, int[] values, out int result, params GUILayoutOption[] options) - { - return DrawInt(label, values, null, out result, options); - } - - public static bool DrawInt(string label, int[] values, GUIStyle style, out int result, params GUILayoutOption[] options) - { - object genericResult; - object[] genericValues = new object[values.Length]; - for (int i = 0; i < values.Length; i++) - genericValues[i] = values[i]; - - bool changed = DrawIntegerNumber(new GUIContent(label), genericValues, null, null, style, out genericResult, options); - - try - { - result = (int)genericResult; - } - catch (Exception) - { - result = values[0]; - return false; - } - - return changed; - } - - public static bool DrawIntegerNumber(GUIContent label, object[] values, RangeValueAttribute range, AngleAttribute angle, GUIStyle style, out object result, params GUILayoutOption[] options) - { - EditorGUI.showMixedValue = false; - result = values[0]; - Type type = result.GetType(); - for (int i = 1; i < values.Length; i++) - { - if (values[i].Equals(result)) - continue; - - EditorGUI.showMixedValue = true; - break; - } - - EditorGUI.BeginChangeCheck(); - EditorGUILayout.BeginHorizontal(); - - if (!string.IsNullOrEmpty(label.text)) - { - int size = (int)GUI.skin.label.CalcSize(label).x; - if (size > 4) - size = Mathf.Max(size, 15); - - GUILayout.Label(label, GUI.skin.label, GUILayout.Width(size)); - - Event e = Event.current; - Rect labelRect = GUILayoutUtility.GetLastRect(); - int id = EditorGUIUtility.GetControlID(FocusType.Passive, labelRect); - - if (InspectorPreferences.IsDragControl(InspectorPreferences.ValueScroll)) - { - if (e.type == EventType.Repaint) - { - EditorGUIUtility.AddCursorRect(labelRect, MouseCursor.ResizeHorizontal); - } - else if (e.type == EventType.MouseDown && labelRect.Contains(e.mousePosition) && e.button == 0) - { - GUIUtility.hotControl = id; - GUIUtility.keyboardControl = id; - EditorGUIUtility.SetWantsMouseJumping(1); - e.Use(); - } - else if (e.type == EventType.MouseDrag && GUIUtility.hotControl == id) - { - long value = Convert.ToInt64(result); - result = (long)Math.Round(value + (CalculateDragSensitivity(value) * HandleUtility.niceMouseDelta * 0.1f)); - if (range != null) - result = Math.Min(Math.Max((long)result, (long)range.Min), (long)range.Max); - - GUI.changed = true; - e.Use(); - } - else if (e.type == EventType.MouseUp && GUIUtility.hotControl == id) - { - GUIUtility.hotControl = 0; - EditorGUIUtility.SetWantsMouseJumping(0); - e.Use(); - } - } - } - - if (angle != null) - { - if (range != null) - result = ExtraGUILayout.IntAngle((int)result, (int)angle.Snap, (int)range.Min, (int)range.Max); - else - result = ExtraGUILayout.IntAngle((int)result, (int)angle.Snap); - } - else - { - if (range != null) - result = EditorGUILayout.IntSlider((int)result, (int)range.Min, (int)range.Max, options); - else - { - if (style != null) - result = EditorGUILayout.TextField(result.ToString(), style, options); - else - result = EditorGUILayout.TextField(result.ToString(), options); - } - } - - try - { - result = Convert.ChangeType(result, type); - } - catch (Exception) - { - return false; - } - - EditorGUILayout.EndHorizontal(); - return EditorGUI.EndChangeCheck(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/IntegerEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/IntegerEditor.cs.meta deleted file mode 100644 index 21f570b6..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/IntegerEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2c1396463f395614b976eb98c848bfa5 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/LayerMaskEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/LayerMaskEditor.cs deleted file mode 100644 index a007f1b6..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/LayerMaskEditor.cs +++ /dev/null @@ -1,104 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; -using System.Collections.Generic; - -namespace AdvancedInspector -{ - public class LayerMaskEditor : FieldEditor - { - private static List names; - private static List masks; - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(LayerMask) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - names = new List(); - masks = new List(); - - for (int i = 0; i < 32; i++) - { - string name = LayerMask.LayerToName(i); - - if (!string.IsNullOrEmpty(name)) - { - names.Add(name); - masks.Add(1 << i); - } - } - - object value = field.GetValue(); - - bool isMask = value is LayerMask; - - int mask; - if (isMask) - mask = (int)(LayerMask)value; - else - mask = (int)value; - - int result; - if (DrawLayerMaskField(mask, style, out result)) - { - if (isMask) - field.SetValue((LayerMask)result); - else - field.SetValue(result); - } - } - - public static bool DrawLayerMaskField(int aMask, GUIStyle style, out int result) - { - int val = aMask; - int maskVal = 0; - for (int i = 0; i < names.Count; i++) - { - if (masks[i] != 0) - { - if ((val & masks[i]) == masks[i]) - maskVal |= 1 << i; - } - else if (val == 0) - maskVal |= 1 << i; - } - - EditorGUI.BeginChangeCheck(); - - int newMaskVal; - if (style != null) - newMaskVal = EditorGUILayout.MaskField(maskVal, names.ToArray(), style); - else - newMaskVal = EditorGUILayout.MaskField(maskVal, names.ToArray()); - - int changes = maskVal ^ newMaskVal; - - for (int i = 0; i < masks.Count; i++) - { - if ((changes & (1 << i)) != 0) - { - if ((newMaskVal & (1 << i)) != 0) - { - if (masks[i] == 0) - { - val = 0; - break; - } - else - val |= masks[i]; - } - else - val &= ~masks[i]; - } - } - - result = val; - - return EditorGUI.EndChangeCheck(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/LayerMaskEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/LayerMaskEditor.cs.meta deleted file mode 100644 index 404c93c3..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/LayerMaskEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 8da80cb340d7b8b4b817f05fbae4e554 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/MonoEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/MonoEditor.cs deleted file mode 100644 index 92083794..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/MonoEditor.cs +++ /dev/null @@ -1,78 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UniToolsEditor; - -namespace AdvancedInspector -{ - public class MonoEditor : FieldEditor - { - public override bool EditDerived - { - get { return false; } - } - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(UnityEditor.MonoScript) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - if (field.SerializedProperty == null || field.SerializedProperty.serializedObject == null) - return; - - Type type = field.SerializedInstances[0].GetType(); - if (typeof(ComponentMonoBehaviour).IsAssignableFrom(type)) - GUILayout.Label(type.Name); - else - { - EditorGUI.BeginChangeCheck(); - - field.SerializedProperty.serializedObject.Update(); - EditorGUILayout.PropertyField(field.SerializedProperty, new GUIContent("")); - field.SerializedProperty.serializedObject.ApplyModifiedProperties(); - - if (EditorGUI.EndChangeCheck()) - { - if (field.Parent != null) - field.Parent.RefreshFields(); - else - AdvancedInspectorControl.Editor.Instances = new object[] { field.SerializedProperty.serializedObject.targetObject }; - } - } - - DrawObjectSelector(field); - } - - private void DrawObjectSelector(InspectorField field) - { - MonoBehaviour behaviour = field.GetValue() as MonoBehaviour; - if (behaviour == null) - return; - - List components = new List(behaviour.gameObject.GetComponents(field.BaseType)); - if (components.Count == 1) - return; - - int index = components.IndexOf(behaviour); - string[] texts = new string[components.Count]; - - for (int i = 0; i < components.Count; i++) - texts[i] = i.ToString() + " : " + components[i].ToString(); - - EditorGUILayout.BeginHorizontal(); - int selection = EditorGUILayout.Popup(index, texts); - EditorGUILayout.EndHorizontal(); - - if (selection == index) - return; - - field.SetValue(components[selection]); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/MonoEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/MonoEditor.cs.meta deleted file mode 100644 index d796dee7..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/MonoEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b9fbe9f800efcf241b78c75454f58a12 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ObjectEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ObjectEditor.cs deleted file mode 100644 index ddfe8b55..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ObjectEditor.cs +++ /dev/null @@ -1,192 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UniToolsEditor; - -namespace AdvancedInspector -{ - public class ObjectEditor : FieldEditor - { - private static Texture picker; - - private static Texture pickerPro; - - private static Texture Picker - { - get - { - if (EditorGUIUtility.isProSkin) - { - if (pickerPro == null) - pickerPro = Helper.Load(EditorResources.PickerPro); - - return pickerPro; - } - else - { - if (picker == null) - picker = Helper.Load(EditorResources.Picker); - - return picker; - } - } - } - - private static int s_ObjectFieldHash = "s_ObjectFieldHash".GetHashCode(); - private static Type validator = null; - private static MethodInfo doObjectField = null; - - public override bool EditDerived - { - get { return true; } - } - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(UnityEngine.Object) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - if (field.GetAttribute() != null) - { - object obj = field.GetValue(); - if (field.Mixed) - GUILayout.Label("---"); - else if (obj == null) - GUILayout.Label("None"); - else if (field.OverloadToString) - GUILayout.Label(obj.ToString()); - else if (field.Type != null) - GUILayout.Label(field.Type.Name); - - return; - } - - if (field.DisplayAsParent) - return; - - if (validator == null) - validator = typeof(EditorGUI).GetNestedType("ObjectFieldValidator", BindingFlags.NonPublic); - - if (doObjectField == null) - doObjectField = typeof(EditorGUI).GetMethod("DoObjectField", BindingFlags.NonPublic | BindingFlags.Static, null, new Type[] { typeof(Rect), typeof(Rect), typeof(int), - typeof(UnityEngine.Object), typeof(Type), typeof(SerializedProperty), validator, typeof(bool), typeof(GUIStyle) }, null); - - DontAllowSceneObjectAttribute dontAllow = field.GetAttribute(); ; - - UnityEngine.Object value = (UnityEngine.Object)GetValue(field); - - EditorGUILayout.BeginHorizontal(); - EditorGUI.BeginChangeCheck(); - - Type type = field.Type; - - UnityEngine.Object result = null; - - if (type.IsInterface) - { - Rect position = EditorGUILayout.GetControlRect(false, 16f); - int id = GUIUtility.GetControlID(s_ObjectFieldHash, EditorGUIUtility.native, position); - Delegate validation = Delegate.CreateDelegate(validator, typeof(ObjectEditor).GetMethod("ValidateObjectFieldAssignment", BindingFlags.NonPublic | BindingFlags.Static)); - - result = doObjectField.Invoke(null, new object[] { position, position, id, value, type, null, validation, dontAllow == null, EditorStyles.objectField } ) as UnityEngine.Object; - } - else - result = EditorGUILayout.ObjectField(value, type, dontAllow == null); - - if (EditorGUI.EndChangeCheck()) - field.SetValue(result); - - if (dontAllow == null && (field.Type == typeof(GameObject) || - typeof(Component).IsAssignableFrom(field.Type) || field.Type.IsAssignableFrom(typeof(Component)))) - if (GUILayout.Button(Picker, GUIStyle.none, GUILayout.Width(18), GUILayout.Height(18))) - InspectorEditor.StartPicking(Picked, field); - - EditorGUILayout.EndHorizontal(); - - DrawObjectSelector(field); - } - - private static UnityEngine.Object ValidateObjectFieldAssignment(UnityEngine.Object[] references, Type objType, SerializedProperty property) - { - if (references.Length > 0) - { - if (((references[0] != null) && (references[0].GetType() == typeof(GameObject)))) - { - foreach (UnityEngine.Object obj in ((GameObject)references[0]).GetComponents(typeof(Component))) - { - if ((obj != null) && objType.IsAssignableFrom(obj.GetType())) - { - return obj; - } - } - } - } - - return null; - } - - private void Picked(GameObject go, object tag) - { - InspectorField field = tag as InspectorField; - if (field == null) - return; - - if (field.Type == typeof(GameObject)) - field.SetValue(go); - else if (typeof(Component).IsAssignableFrom(field.Type)) - field.SetValue(go.GetComponent(field.Type)); - } - - public override void OnLabelDoubleClick(InspectorField field) - { - UnityEngine.Object target = field.GetValue() as UnityEngine.Object; - if (target == null) - return; - - if (!string.IsNullOrEmpty(AssetDatabase.GetAssetPath(target))) - EditorGUIUtility.PingObject(target); - else - { - SceneView view = SceneView.lastActiveSceneView; - Quaternion rotation = view.camera.transform.rotation; - - if (target is GameObject) - SceneView.lastActiveSceneView.LookAt(((GameObject)target).transform.position, rotation, 10); - else if (target is Component) - SceneView.lastActiveSceneView.LookAt(((Component)target).transform.position, rotation, 10); - } - } - - private void DrawObjectSelector(InspectorField field) - { - MonoBehaviour behaviour = field.GetValue() as MonoBehaviour; - if (behaviour == null) - return; - - List components = new List(behaviour.gameObject.GetComponents(field.BaseType)); - if (components.Count == 1) - return; - - int index = components.IndexOf(behaviour); - string[] texts = new string[components.Count]; - - for (int i = 0; i < components.Count; i++) - texts[i] = i.ToString() + " : " + components[i].ToString(); - - EditorGUILayout.BeginHorizontal(); - int selection = EditorGUILayout.Popup(index, texts); - EditorGUILayout.EndHorizontal(); - - if (selection == index) - return; - - field.SetValue(components[selection]); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ObjectEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ObjectEditor.cs.meta deleted file mode 100644 index b975cbcc..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/ObjectEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1c38d144247c0f9448c0c285b7c255fc -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/QuaternionEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/QuaternionEditor.cs deleted file mode 100644 index 789ebbb6..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/QuaternionEditor.cs +++ /dev/null @@ -1,168 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class QuaternionEditor : FieldEditor - { - public override bool Expandable - { - get { return false; } - } - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(Quaternion) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - float width = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = VECTOR_FIELD_WIDTH; - - Quaternion[] values = field.GetValues(); - if (AdvancedInspectorControl.Level <= InspectorLevel.Advanced) - { - float[] x = new float[values.Length]; - float[] y = new float[values.Length]; - float[] z = new float[values.Length]; - - for (int i = 0; i < values.Length; i++) - { - Vector3 euler = values[i].eulerAngles; - x[i] = euler.x; - y[i] = euler.y; - z[i] = euler.z; - } - - GUILayout.BeginHorizontal(); - - float result; - if (FloatEditor.DrawFloat("X", x, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " X"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Vector3 v = field.GetValue(field.Instances[i]).eulerAngles; - v.x = result; - field.SetValue(field.Instances[i], Quaternion.Euler(v)); - } - } - - if (FloatEditor.DrawFloat("Y", y, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Y"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Vector3 v = field.GetValue(field.Instances[i]).eulerAngles; - v.y = result; - field.SetValue(field.Instances[i], Quaternion.Euler(v)); - } - } - - if (FloatEditor.DrawFloat("Z", z, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Z"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Vector3 v = field.GetValue(field.Instances[i]).eulerAngles; - v.z = result; - field.SetValue(field.Instances[i], Quaternion.Euler(v)); - } - } - - GUILayout.EndHorizontal(); - } - else - { - float[] x = new float[values.Length]; - float[] y = new float[values.Length]; - float[] z = new float[values.Length]; - float[] w = new float[values.Length]; - - for (int i = 0; i < values.Length; i++) - { - x[i] = values[i].x; - y[i] = values[i].y; - z[i] = values[i].z; - w[i] = values[i].w; - } - - GUILayout.BeginHorizontal(); - - float result; - if (FloatEditor.DrawFloat("X", x, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " X"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Quaternion v = field.GetValue(field.Instances[i]); - v.x = result; - field.SetValue(field.Instances[i], v); - } - } - - if (FloatEditor.DrawFloat("Y", y, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Y"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Quaternion v = field.GetValue(field.Instances[i]); - v.y = result; - field.SetValue(field.Instances[i], v); - } - } - - GUILayout.EndHorizontal(); - GUILayout.BeginHorizontal(); - - if (FloatEditor.DrawFloat("Z", z, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Z"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Quaternion v = field.GetValue(field.Instances[i]); - v.z = result; - field.SetValue(field.Instances[i], v); - } - } - - if (FloatEditor.DrawFloat("W", w, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " W"); - - for (int i = 0; i < field.Instances.Length; i++) - { - Quaternion v = field.GetValue(field.Instances[i]); - v.w = result; - field.SetValue(field.Instances[i], v); - } - } - - GUILayout.EndHorizontal(); - } - - EditorGUIUtility.labelWidth = width; - } - - public override void OnContextualClick(InspectorField field, GenericMenu menu) - { - menu.AddItem(new GUIContent("Identity"), false, Identity); - - menu.AddSeparator(""); - } - - private void Identity() - { - AdvancedInspectorControl.Field.SetValue(Quaternion.identity); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/QuaternionEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/QuaternionEditor.cs.meta deleted file mode 100644 index 96defe29..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/QuaternionEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4fd00569d2e889248bedf34a4e50c078 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RangeEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RangeEditor.cs deleted file mode 100644 index 0f540c19..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RangeEditor.cs +++ /dev/null @@ -1,109 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class RangeIntEditor : FieldEditor - { - public override Type[] EditedTypes - { - get { return new Type[] { typeof(RangeInt) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - RangeValueAttribute range = field.GetAttribute(); - if (range == null) - return; - - EditorGUILayout.BeginHorizontal(); - - RangeInt[] ranges = field.GetValues(); - - int[] mins = new int[ranges.Length]; - int[] maxs = new int[ranges.Length]; - int min = ranges[0].min; - int max = ranges[0].max; - bool different = false; - - for (int i = 0; i < ranges.Length; i++) - { - mins[i] = ranges[i].min; - maxs[i] = ranges[i].max; - if (ranges[i].min != min || ranges[0].max != max) - different = true; - } - - if (IntegerEditor.DrawInt("", mins, out min, GUILayout.Width(64))) - for (int i = 0; i < field.Instances.Length; i++) - field.SetValue(field.Instances[i], new RangeInt(min, ranges[i].max)); - - EditorGUI.BeginChangeCheck(); - float fMin = min; - float fMax = max; - EditorGUI.showMixedValue = different; - EditorGUILayout.MinMaxSlider(ref fMin, ref fMax, range.Min, range.Max); - if (EditorGUI.EndChangeCheck() && min < max) - for (int i = 0; i < field.Instances.Length; i++) - field.SetValue(field.Instances[i], new RangeInt((int)fMin, (int)fMax)); - - if (IntegerEditor.DrawInt("", maxs, out max, GUILayout.Width(64))) - for (int i = 0; i < field.Instances.Length; i++) - field.SetValue(field.Instances[i], new RangeInt(ranges[i].min, max)); - - EditorGUILayout.EndHorizontal(); - } - } - - public class RangeFloatEditor : FieldEditor - { - public override Type[] EditedTypes - { - get { return new Type[] { typeof(RangeFloat) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - RangeValueAttribute range = field.GetAttribute(); - if (range == null) - return; - - EditorGUILayout.BeginHorizontal(); - - RangeFloat[] ranges = field.GetValues(); - - float[] mins = new float[ranges.Length]; - float[] maxs = new float[ranges.Length]; - float min = ranges[0].min; - float max = ranges[0].max; - bool different = false; - - for (int i = 0; i < ranges.Length; i++) - { - mins[i] = ranges[i].min; - maxs[i] = ranges[i].max; - if (ranges[i].min != min || ranges[0].max != max) - different = true; - } - - if (FloatEditor.DrawFloat("", mins, out min, GUILayout.Width(64))) - for (int i = 0; i < field.Instances.Length; i++) - field.SetValue(field.Instances[i], new RangeFloat(min, ranges[i].max)); - - EditorGUI.BeginChangeCheck(); - EditorGUI.showMixedValue = different; - EditorGUILayout.MinMaxSlider(ref min, ref max, range.Min, range.Max); - if (EditorGUI.EndChangeCheck() && min < max) - for (int i = 0; i < field.Instances.Length; i++) - field.SetValue(field.Instances[i], new RangeFloat(min, max)); - - if (FloatEditor.DrawFloat("", maxs, out max, GUILayout.Width(64))) - for (int i = 0; i < field.Instances.Length; i++) - field.SetValue(field.Instances[i], new RangeFloat(ranges[i].min, max)); - - EditorGUILayout.EndHorizontal(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RangeEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RangeEditor.cs.meta deleted file mode 100644 index 0701b335..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RangeEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 94080e99d0e3f994a8415cc19062dbde -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RectEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RectEditor.cs deleted file mode 100644 index ee3e61e4..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RectEditor.cs +++ /dev/null @@ -1,165 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class RectEditor : FieldEditor - { - public override bool Expandable - { - get { return false; } - } - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(Rect), typeof(RectOffset) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - Type type = field.BaseType; - - float labelWidth = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = VECTOR_FIELD_WIDTH; - - if (type == typeof(Rect)) - { - Rect[] values = field.GetValues(); - - float[] x = new float[values.Length]; - float[] y = new float[values.Length]; - float[] height = new float[values.Length]; - float[] width = new float[values.Length]; - - for (int i = 0; i < values.Length; i++) - { - x[i] = values[i].x; - y[i] = values[i].y; - height[i] = values[i].height; - width[i] = values[i].width; - } - - GUILayout.BeginHorizontal(); - float result; - if (FloatEditor.DrawFloat("X", x, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " X"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].x = result; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("Y", y, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Y"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].y = result; - field.SetValue(field.Instances[i], values[i]); - } - } - GUILayout.EndHorizontal(); - - GUILayout.BeginHorizontal(); - if (FloatEditor.DrawFloat("W", width, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Width"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].width = result; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("H", height, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Height"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].height = result; - field.SetValue(field.Instances[i], values[i]); - } - } - GUILayout.EndHorizontal(); - } - else if (type == typeof(RectOffset)) - { - RectOffset[] values = field.GetValues(); - - int[] left = new int[values.Length]; - int[] right = new int[values.Length]; - int[] top = new int[values.Length]; - int[] bottom = new int[values.Length]; - - for (int i = 0; i < values.Length; i++) - { - left[i] = values[i].left; - right[i] = values[i].right; - top[i] = values[i].top; - bottom[i] = values[i].bottom; - } - - GUILayout.BeginHorizontal(); - int result; - if (IntegerEditor.DrawInt("L", left, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Left"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].left = result; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (IntegerEditor.DrawInt("R", right, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Right"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].right = result; - field.SetValue(field.Instances[i], values[i]); - } - } - GUILayout.EndHorizontal(); - - GUILayout.BeginHorizontal(); - if (IntegerEditor.DrawInt("T", top, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Top"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].top = result; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (IntegerEditor.DrawInt("B", bottom, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Bottom"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].bottom = result; - field.SetValue(field.Instances[i], values[i]); - } - } - GUILayout.EndHorizontal(); - } - - EditorGUILayout.Space(); - - EditorGUIUtility.labelWidth = labelWidth; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RectEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RectEditor.cs.meta deleted file mode 100644 index aaf7d190..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RectEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fccb35960df296244b543fc8b0adbb98 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraints2DEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraints2DEditor.cs deleted file mode 100644 index 4e54cbaa..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraints2DEditor.cs +++ /dev/null @@ -1,60 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class RigidbodyConstraints2DEditor : FieldEditor - { - private const int LABEL_WIDTH = 96; - private const int TOGGLE_WIDTH = 28; - - public override bool EditDerived - { - get { return false; } - } - - public override bool Expandable - { - get { return true; } - } - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(RigidbodyConstraints2D) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - field.Expandable = true; - if (!field.Expanded) - return; - - EditorGUI.showMixedValue = field.Mixed; - - EditorGUI.BeginChangeCheck(); - - RigidbodyConstraints2D value = (RigidbodyConstraints2D)GetValue(field); - int newValue = 0; - - EditorGUILayout.BeginHorizontal(); - GUILayout.Label("Freeze Position ", GUILayout.Width(LABEL_WIDTH)); - if (GUILayout.Toggle(value.Has(RigidbodyConstraints2D.FreezePositionX), "X", GUILayout.Width(TOGGLE_WIDTH))) - newValue += (int)RigidbodyConstraints2D.FreezePositionX; - - if (GUILayout.Toggle(value.Has(RigidbodyConstraints2D.FreezePositionY), "Y", GUILayout.Width(TOGGLE_WIDTH))) - newValue += (int)RigidbodyConstraints2D.FreezePositionY; - EditorGUILayout.EndHorizontal(); - - EditorGUILayout.BeginHorizontal(); - GUILayout.Label("Freeze Rotation ", GUILayout.Width(LABEL_WIDTH)); - if (GUILayout.Toggle(value.Has(RigidbodyConstraints2D.FreezeRotation), "Z", GUILayout.Width(TOGGLE_WIDTH))) - newValue += (int)RigidbodyConstraints2D.FreezeRotation; - EditorGUILayout.EndHorizontal(); - - if (EditorGUI.EndChangeCheck()) - field.SetValue(Enum.ToObject(typeof(RigidbodyConstraints2D), newValue)); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraints2DEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraints2DEditor.cs.meta deleted file mode 100644 index 7e23526b..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraints2DEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4d2541cd5af63614a837b0ad6801c1ed -timeCreated: 1433909068 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraintsEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraintsEditor.cs deleted file mode 100644 index 781c92b8..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraintsEditor.cs +++ /dev/null @@ -1,69 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class RigidbodyConstraintsEditor : FieldEditor - { - private const int LABEL_WIDTH = 96; - private const int TOGGLE_WIDTH = 28; - - public override bool EditDerived - { - get { return false; } - } - - public override bool Expandable - { - get { return true; } - } - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(RigidbodyConstraints) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - field.Expandable = true; - if (!field.Expanded) - return; - - EditorGUI.showMixedValue = field.Mixed; - - EditorGUI.BeginChangeCheck(); - - RigidbodyConstraints value = (RigidbodyConstraints)GetValue(field); - int newValue = 0; - - EditorGUILayout.BeginHorizontal(); - GUILayout.Label("Freeze Position ", GUILayout.Width(LABEL_WIDTH)); - if (GUILayout.Toggle(value.Has(RigidbodyConstraints.FreezePositionX), "X", GUILayout.Width(TOGGLE_WIDTH))) - newValue += (int)RigidbodyConstraints.FreezePositionX; - - if (GUILayout.Toggle(value.Has(RigidbodyConstraints.FreezePositionY), "Y", GUILayout.Width(TOGGLE_WIDTH))) - newValue += (int)RigidbodyConstraints.FreezePositionY; - - if (GUILayout.Toggle(value.Has(RigidbodyConstraints.FreezePositionZ), "Z", GUILayout.Width(TOGGLE_WIDTH))) - newValue += (int)RigidbodyConstraints.FreezePositionZ; - EditorGUILayout.EndHorizontal(); - - EditorGUILayout.BeginHorizontal(); - GUILayout.Label("Freeze Rotation ", GUILayout.Width(LABEL_WIDTH)); - if (GUILayout.Toggle(value.Has(RigidbodyConstraints.FreezeRotationX), "X", GUILayout.Width(TOGGLE_WIDTH))) - newValue += (int)RigidbodyConstraints.FreezeRotationX; - - if (GUILayout.Toggle(value.Has(RigidbodyConstraints.FreezeRotationY), "Y", GUILayout.Width(TOGGLE_WIDTH))) - newValue += (int)RigidbodyConstraints.FreezeRotationY; - - if (GUILayout.Toggle(value.Has(RigidbodyConstraints.FreezeRotationZ), "Z", GUILayout.Width(TOGGLE_WIDTH))) - newValue += (int)RigidbodyConstraints.FreezeRotationZ; - EditorGUILayout.EndHorizontal(); - - if (EditorGUI.EndChangeCheck()) - field.SetValue(Enum.ToObject(typeof(RigidbodyConstraints), newValue)); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraintsEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraintsEditor.cs.meta deleted file mode 100644 index 1121e382..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/RigidbodyConstraintsEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1aa0c3b940b87d14cbb9705339f378b3 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/StringEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/StringEditor.cs deleted file mode 100644 index 573450d9..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/StringEditor.cs +++ /dev/null @@ -1,89 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class StringEditor : FieldEditor - { - public override Type[] EditedTypes - { - get { return new Type[] { typeof(string) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - GUILayout.BeginHorizontal(); - - float width = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = 0; - - TextFieldAttribute text = field.GetAttribute(); - MultilineAttribute multiline = field.GetAttribute(); - TextAreaAttribute area = field.GetAttribute(); - - object value = GetValue(field); - - EditorGUI.BeginChangeCheck(); - GUIUtility.GetControlID(field.Path.GetHashCode(), FocusType.Passive); - - string result = ""; - if ((text == null && multiline == null && area == null) || (text != null && text.Type == TextFieldType.Standard)) - { - if (style != null) - result = EditorGUILayout.TextField((string)value, style); - else - result = EditorGUILayout.TextField((string)value); - } - else if (multiline != null || area != null || text.Type == TextFieldType.Area) - { - if (style != null) - result = EditorGUILayout.TextArea((string)value, style); - else - result = EditorGUILayout.TextArea((string)value); - } - else if (text.Type == TextFieldType.Password) - { - if (style != null) - result = EditorGUILayout.PasswordField((string)value, style); - else - result = EditorGUILayout.PasswordField((string)value); - } - else if (text.Type == TextFieldType.Tag) - { - if (style != null) - result = EditorGUILayout.TagField((string)value, style); - else - result = EditorGUILayout.TagField((string)value); - } - else if (text.Type == TextFieldType.File) - { - if (GUILayout.Button("...", GUILayout.Height(BUTTON_HEIGHT), GUILayout.Width(BUTTON_HEIGHT * 2))) - result = EditorUtility.OpenFilePanel(text.Title, text.Path, text.Extension); - - if (field.Mixed) - GUILayout.Label("---"); - else - GUILayout.Label((string)value); - } - else if (text.Type == TextFieldType.Folder) - { - if (GUILayout.Button("...", GUILayout.Height(BUTTON_HEIGHT), GUILayout.Width(BUTTON_HEIGHT * 2))) - result = EditorUtility.OpenFolderPanel(text.Title, "", ""); - - if (field.Mixed) - GUILayout.Label("---"); - else - GUILayout.Label((string)value); - } - - if (EditorGUI.EndChangeCheck()) - field.SetValue(result); - - EditorGUIUtility.labelWidth = width; - - GUILayout.EndHorizontal(); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/StringEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/StringEditor.cs.meta deleted file mode 100644 index 4154c0d7..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/StringEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 90da81dc74f23b44c85a60181928af9b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/TimeSpanEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/TimeSpanEditor.cs deleted file mode 100644 index fa720ce7..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/TimeSpanEditor.cs +++ /dev/null @@ -1,98 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class TimeSpanEditor : FieldEditor - { - private InspectorField field; - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(TimeSpan) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - int[] days = new int[field.Instances.Length]; - int[] hours = new int[field.Instances.Length]; - int[] mins = new int[field.Instances.Length]; - int[] secs = new int[field.Instances.Length]; - for (int i = 0; i < field.Instances.Length; i++) - { - TimeSpan span = field.GetValue(field.Instances[i]); - days[i] = span.Days; - hours[i] = span.Hours; - mins[i] = span.Minutes; - secs[i] = span.Seconds; - } - - float labelWidth = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = 42; - GUILayout.BeginHorizontal(); - - int result; - if (IntegerEditor.DrawInt("Days", days, style, out result)) - { - result = Mathf.Clamp(result, 0, int.MaxValue); - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Days"); - - for (int i = 0; i < field.Instances.Length; i++) - { - TimeSpan span = field.GetValue(field.Instances[i]); - span = new TimeSpan(result, span.Hours, span.Minutes, span.Seconds); - field.SetValue(field.Instances[i], span); - } - } - - if (IntegerEditor.DrawInt("Hours", hours, style, out result)) - { - result = Mathf.Clamp(result, 0, int.MaxValue); - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Hours"); - - for (int i = 0; i < field.Instances.Length; i++) - { - TimeSpan span = field.GetValue(field.Instances[i]); - span = new TimeSpan(span.Days, result, span.Minutes, span.Seconds); - field.SetValue(field.Instances[i], span); - } - } - - GUILayout.EndHorizontal(); - GUILayout.BeginHorizontal(); - - if (IntegerEditor.DrawInt("Mins", mins, style, out result)) - { - result = Mathf.Clamp(result, 0, int.MaxValue); - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Minutes"); - - for (int i = 0; i < field.Instances.Length; i++) - { - TimeSpan span = field.GetValue(field.Instances[i]); - span = new TimeSpan(span.Days, span.Hours, result, span.Seconds); - field.SetValue(field.Instances[i], span); - } - } - - if (IntegerEditor.DrawInt("Secs", secs, style, out result)) - { - result = Mathf.Clamp(result, 0, int.MaxValue); - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Seconds"); - - for (int i = 0; i < field.Instances.Length; i++) - { - TimeSpan span = field.GetValue(field.Instances[i]); - span = new TimeSpan(span.Days, span.Hours, span.Minutes, result); - field.SetValue(field.Instances[i], span); - } - } - - GUILayout.EndHorizontal(); - EditorGUILayout.Space(); - - EditorGUIUtility.labelWidth = labelWidth; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/TimeSpanEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/TimeSpanEditor.cs.meta deleted file mode 100644 index e0d700c4..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/TimeSpanEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a8e1b583a89c0f2468b87c50783399f9 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/VectorEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/VectorEditor.cs deleted file mode 100644 index 00b9bb3e..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/VectorEditor.cs +++ /dev/null @@ -1,208 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System; -using System.Collections; - -namespace AdvancedInspector -{ - public class VectorEditor : FieldEditor - { - public override bool Expandable - { - get { return false; } - } - - public override Type[] EditedTypes - { - get { return new Type[] { typeof(Vector2), typeof(Vector3), typeof(Vector4) }; } - } - - public override void Draw(InspectorField field, GUIStyle style) - { - Type type = field.BaseType; - - float width = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = VECTOR_FIELD_WIDTH; - - GUILayout.BeginHorizontal(); - if (type == typeof(Vector2)) - { - Vector2[] values = field.GetValues(); - - float[] x = new float[values.Length]; - float[] y = new float[values.Length]; - - for (int i = 0; i < values.Length; i++) - { - x[i] = values[i].x; - y[i] = values[i].y; - } - - float result; - if (FloatEditor.DrawFloat("X", x, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " X"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].x = result; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("Y", y, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Y"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].y = result; - field.SetValue(field.Instances[i], values[i]); - } - } - } - else if (type == typeof(Vector3)) - { - Vector3[] values = field.GetValues(); - - float[] x = new float[values.Length]; - float[] y = new float[values.Length]; - float[] z = new float[values.Length]; - - for (int i = 0; i < values.Length; i++) - { - x[i] = values[i].x; - y[i] = values[i].y; - z[i] = values[i].z; - } - - float result; - if (FloatEditor.DrawFloat("X", x, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " X"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].x = result; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("Y", y, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Y"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].y = result; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("Z", z, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Z"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].z = result; - field.SetValue(field.Instances[i], values[i]); - } - } - } - else if (type == typeof(Vector4)) - { - Vector4[] values = field.GetValues(); - - float[] x = new float[values.Length]; - float[] y = new float[values.Length]; - float[] z = new float[values.Length]; - float[] w = new float[values.Length]; - - for (int i = 0; i < values.Length; i++) - { - x[i] = values[i].x; - y[i] = values[i].y; - z[i] = values[i].z; - w[i] = values[i].w; - } - - float result; - if (FloatEditor.DrawFloat("X", x, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " X"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].x = result; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("Y", y, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Y"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].y = result; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("Z", z, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " Z"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].z = result; - field.SetValue(field.Instances[i], values[i]); - } - } - - if (FloatEditor.DrawFloat("W", w, style, out result)) - { - Undo.RecordObjects(field.SerializedInstances, "Edit " + field.Name + " W"); - - for (int i = 0; i < field.Instances.Length; i++) - { - values[i].w = result; - field.SetValue(field.Instances[i], values[i]); - } - } - } - GUILayout.EndHorizontal(); - - EditorGUIUtility.labelWidth = width; - } - - public override void OnContextualClick(InspectorField field, GenericMenu menu) - { - menu.AddItem(new GUIContent("Zero"), false, Zero); - menu.AddItem(new GUIContent("One"), false, One); - - menu.AddSeparator(""); - } - - private void Zero() - { - if (AdvancedInspectorControl.Field.Type == typeof(Vector2)) - AdvancedInspectorControl.Field.SetValue(Vector2.zero); - else if (AdvancedInspectorControl.Field.Type == typeof(Vector3)) - AdvancedInspectorControl.Field.SetValue(Vector3.zero); - else if (AdvancedInspectorControl.Field.Type == typeof(Vector4)) - AdvancedInspectorControl.Field.SetValue(Vector4.zero); - } - - private void One() - { - if (AdvancedInspectorControl.Field.Type == typeof(Vector2)) - AdvancedInspectorControl.Field.SetValue(Vector2.one); - else if (AdvancedInspectorControl.Field.Type == typeof(Vector3)) - AdvancedInspectorControl.Field.SetValue(Vector3.one); - else if (AdvancedInspectorControl.Field.Type == typeof(Vector4)) - AdvancedInspectorControl.Field.SetValue(Vector4.one); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/VectorEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/VectorEditor.cs.meta deleted file mode 100644 index 79d8e5d8..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/FieldEditors/VectorEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 851a4084094a34f439dc7c658c5343bb -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.XML b/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.XML deleted file mode 100644 index 51610453..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.XML +++ /dev/null @@ -1,453 +0,0 @@ - - - - UniToolsEditor - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Looks up a localized resource of type System.Byte[]. - - - - - Collection of static helping method. - - - - - Load a binary file (ex.: from a .resx file) and covert it to a Unity Texture2D - This one is generally used when a non-editor script requires a texture. - It is requested by a the TextureRequest event. - - The name of the embedded resource. - A UnityEngine.Texture - - - - Load a binary file (ex.: from a .resx file) and covert it to a Unity Texture2D - - The binary resources. - A UnityEngine.Texture - - - - Similar to GUI.DrawTexture, but draw a color instead. - - Region to draw. - The color of the draw call. - - - - A fully white texture. - Usually used by the DrawColor method. - - - - diff --git a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.XML.meta b/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.XML.meta deleted file mode 100644 index 9a50f739..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.XML.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 963a7470a10df4e46acea0b0b709948e -TextScriptImporter: - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.dll b/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.dll deleted file mode 100644 index 93c50a83..00000000 Binary files a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.dll and /dev/null differ diff --git a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.dll.meta b/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.dll.meta deleted file mode 100644 index 9d4c7893..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.dll.meta +++ /dev/null @@ -1,33 +0,0 @@ -fileFormatVersion: 2 -guid: 45d0940e8e0f52a44876009e88edec75 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 1 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.pdb b/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.pdb deleted file mode 100644 index 09f3307e..00000000 Binary files a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.pdb and /dev/null differ diff --git a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.pdb.meta b/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.pdb.meta deleted file mode 100644 index ab678cfb..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UniToolsEditor.pdb.meta +++ /dev/null @@ -1,4 +0,0 @@ -fileFormatVersion: 2 -guid: 6c3bf347a80d91c45a5aa19d41a1c61c -DefaultImporter: - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes.meta deleted file mode 100644 index 8a5877f3..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: d41f8a83848329147be650112ba92e02 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnchoredJoint2DEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnchoredJoint2DEditor.cs deleted file mode 100644 index af18303f..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnchoredJoint2DEditor.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - public class AnchoredJoint2DEditor : Joint2DEditor - { - private const float snapDistance = 0.13f; - private AnchoredJoint2D anchorJoint2D; - - protected override void RefreshFields() - { - base.RefreshFields(); - Type type = typeof(AnchoredJoint2D); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("anchor"), - new DescriptorAttribute("Anchor", "The joint's anchor point on the object that has the joint component.", "http://docs.unity3d.com/ScriptReference/AnchoredJoint2D-anchor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("connectedAnchor"), - new DescriptorAttribute("Connected Anchor", "The joint's anchor point on the second object (ie, the one which doesn't have the joint component).", "http://docs.unity3d.com/ScriptReference/AnchoredJoint2D-connectedAnchor.html"))); - } - - protected override void OnSceneGUI() - { - anchorJoint2D = (AnchoredJoint2D)target; - Vector3 v1 = TransformPoint(anchorJoint2D.transform, anchorJoint2D.anchor); - Vector3 v2 = anchorJoint2D.connectedAnchor; - - if (anchorJoint2D.connectedBody) - v2 = TransformPoint(anchorJoint2D.connectedBody.transform, v2); - - Vector3 v3 = v1 + (v2 - v1).normalized * HandleUtility.GetHandleSize(v1) * 0.1f; - Handles.color = Color.green; - Handles.DrawAAPolyLine(new Vector3[] { v3, v2 }); - - if (HandleAnchor(ref v2, true)) - { - v2 = SnapToSprites(v2); - v2 = SnapToPoint(v2, v1, 0.13f); - if (anchorJoint2D.connectedBody) - v2 = InverseTransformPoint(anchorJoint2D.connectedBody.transform, v2); - - Undo.RecordObject(anchorJoint2D, "Move Connected Anchor"); - anchorJoint2D.connectedAnchor = v2; - } - - if (HandleAnchor(ref v1, false)) - { - v1 = SnapToSprites(v1); - v1 = SnapToPoint(v1, v2, 0.13f); - - Undo.RecordObject(anchorJoint2D, "Move Anchor"); - anchorJoint2D.anchor = InverseTransformPoint(anchorJoint2D.transform, v1); - } - } - - private Vector3 SnapToSprites(Vector3 position) - { - SpriteRenderer component = anchorJoint2D.GetComponent(); - position = SnapToSprite(component, position, 0.13f); - - if (anchorJoint2D.connectedBody) - { - component = anchorJoint2D.connectedBody.GetComponent(); - position = SnapToSprite(component, position, 0.13f); - } - - return position; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnchoredJoint2DEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnchoredJoint2DEditor.cs.meta deleted file mode 100644 index e4bfde48..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnchoredJoint2DEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 92274081a60084d499072975be2ef644 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs deleted file mode 100644 index 6a9783bf..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(Animation), true)] - public class AnimationEditor : InspectorEditor - { - private static readonly int hash = "AnimationBoundsEditorHash".GetHashCode(); - private object boxEditor; - private MethodInfo edit; - private MethodInfo set; - private Color handleColor = new Color(1, 1, 1, 0.6f); - - protected override void OnEnable() - { - base.OnEnable(); - - Type box = TypeUtility.GetTypeByName("BoxEditor"); - boxEditor = Activator.CreateInstance(box, true, hash); - edit = box.GetMethod("OnSceneGUI", new Type[] { typeof(Transform), typeof(Color), typeof(Vector3).MakeByRefType(), typeof(Vector3).MakeByRefType() }); - set = box.GetMethod("SetAlwaysDisplayHandles"); - } - - protected override void RefreshFields() - { - Type type = typeof(Animation); - if (Instances == null || Instances.Length == 0) - return; - - SerializedObject so = new SerializedObject(Instances.Cast().ToArray()); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("clip"), - new DescriptorAttribute("Animation", "The default animation.", "http://docs.unity3d.com/ScriptReference/Animation-clip.html"))); - fields.Add(new InspectorField(type, Instances, so.FindProperty("m_Animations"), - new DescriptorAttribute("Animations", ""))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("playAutomatically"), - new DescriptorAttribute("Play Automatically", "Should the default animation clip (Animation.clip) automatically start playing on startup.", "http://docs.unity3d.com/ScriptReference/Animation-playAutomatically.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("animatePhysics"), - new DescriptorAttribute("Animate Physic", "When turned on, animations will be executed in the physics loop. This is only useful in conjunction with kinematic rigidbodies.", "http://docs.unity3d.com/ScriptReference/Animation-animatePhysics.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("cullingType"), - new DescriptorAttribute("Culling Type", "Controls culling of this Animation component.", "http://docs.unity3d.com/ScriptReference/Animation-cullingType.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("isPlaying"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Is Playing", "Are we playing any animations?", "http://docs.unity3d.com/ScriptReference/Animation-isPlaying.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("localBounds"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Bounds", "AABB of this Animation animation component in local space.", "http://docs.unity3d.com/ScriptReference/Animation-localBounds.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("wrapMode"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Wrap Mode", "How should time beyond the playback range of the clip be treated?", "http://docs.unity3d.com/ScriptReference/Animation-wrapMode.html"))); - - } - - protected override void OnSceneGUI() - { - Animation animation = (Animation)target; - - if ((animation != null) && ((animation.cullingType == AnimationCullingType.BasedOnClipBounds) || (animation.cullingType == AnimationCullingType.BasedOnUserBounds))) - { - set.Invoke(boxEditor, new object[] { animation.cullingType == AnimationCullingType.BasedOnUserBounds }); - Bounds localBounds = animation.localBounds; - Vector3 center = localBounds.center; - Vector3 size = localBounds.size; - - object[] arguments = new object[] { animation.transform, handleColor, center, size }; - - if ((bool)edit.Invoke(boxEditor, arguments)) - { - center = (Vector3)arguments[2]; - size = (Vector3)arguments[3]; - - Undo.RecordObject(animation, "Modified Animation bounds"); - animation.localBounds = new Bounds(center, size); - } - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs.meta deleted file mode 100644 index 2a887671..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimationEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 39152dbad278fc841bed6ccf81404831 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimatorEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimatorEditor.cs deleted file mode 100644 index eabe711c..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimatorEditor.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(Animator), true)] - public class AnimatorEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(Animator); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("runtimeAnimatorController"), new HelpAttribute(new HelpAttribute.HelpDelegate(HelpController)), - new DescriptorAttribute("Controller", "The runtime representation of AnimatorController that controls the Animator.", "http://docs.unity3d.com/ScriptReference/Animator-runtimeAnimatorController.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("avatar"), - new DescriptorAttribute("Avatar", "Gets/Sets the current Avatar.", "http://docs.unity3d.com/ScriptReference/Animator-avatar.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("applyRootMotion"), - new DescriptorAttribute("Apply Root Motion", "Should root motion be applied?", "http://docs.unity3d.com/ScriptReference/Animator-applyRootMotion.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("updateMode"), - new DescriptorAttribute("Update Mode", "Specifies the update mode of the Animator.", "http://docs.unity3d.com/ScriptReference/Animator-updateMode.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("cullingMode"), - new DescriptorAttribute("Culling Mode", "Controls culling of this Animator component.", "http://docs.unity3d.com/ScriptReference/Animator-cullingMode.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("fireEvents"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Fire Events", "If true, the animation track fires their event.", ""))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("logWarnings"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Log Warnings", "Log Animator internal warnings.", ""))); - - InspectorField transform = new InspectorField("Transform"); - - transform.Fields.Add(new InspectorField(type, Instances, type.GetProperty("speed"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Speed", "The playback speed of the Animator. 1 is normal playback speed.", "http://docs.unity3d.com/ScriptReference/Animator-speed.html"))); - transform.Fields.Add(new InspectorField(type, Instances, type.GetProperty("bodyPosition"), new InspectAttribute(InspectorLevel.Advanced), new ReadOnlyAttribute(), - new DescriptorAttribute("Body Position", "The position of the body center of mass.", "http://docs.unity3d.com/ScriptReference/Animator-bodyPosition.html"))); - transform.Fields.Add(new InspectorField(type, Instances, type.GetProperty("rootPosition"), new InspectAttribute(InspectorLevel.Advanced), new ReadOnlyAttribute(), - new DescriptorAttribute("Root Position", "The root position, the position of the game object.", "http://docs.unity3d.com/ScriptReference/Animator-rootPosition.html"))); - transform.Fields.Add(new InspectorField(type, Instances, type.GetProperty("bodyRotation"), new InspectAttribute(InspectorLevel.Advanced), new ReadOnlyAttribute(), - new DescriptorAttribute("Body Rotation", "The rotation of the body center of mass.", "http://docs.unity3d.com/ScriptReference/Animator-bodyRotation.html"))); - transform.Fields.Add(new InspectorField(type, Instances, type.GetProperty("rootRotation"), new InspectAttribute(InspectorLevel.Advanced), new ReadOnlyAttribute(), - new DescriptorAttribute("Root Rotation", "The root rotation, the rotation of the game object.", "http://docs.unity3d.com/ScriptReference/Animator-rootRotation.html"))); - - transform.Fields.Add(new InspectorField(type, Instances, type.GetProperty("targetPosition"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Target Position", "Returns the position of the target specified by SetTarget(AvatarTarget targetIndex, float targetNormalizedTime)).", "http://docs.unity3d.com/ScriptReference/Animator-targetPosition.html"))); - transform.Fields.Add(new InspectorField(type, Instances, type.GetProperty("targetRotation"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Target Rotation", "Returns the rotation of the target specified by SetTarget(AvatarTarget targetIndex, float targetNormalizedTime)).", "http://docs.unity3d.com/ScriptReference/Animator-targetRotation.html"))); - - transform.Fields.Add(new InspectorField(type, Instances, type.GetProperty("deltaPosition"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Delta Position", "Gets the avatar delta position for the last evaluated frame.", "http://docs.unity3d.com/ScriptReference/Animator-deltaPosition.html"))); - transform.Fields.Add(new InspectorField(type, Instances, type.GetProperty("deltaRotation"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Delta Rotation", "Gets the avatar delta rotation for the last evaluated frame.", "http://docs.unity3d.com/ScriptReference/Animator-deltaRotation.html"))); - - transform.Fields.Add(new InspectorField(type, Instances, type.GetProperty("pivotPosition"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Pivot Position", "Get the current position of the pivot.", "http://docs.unity3d.com/ScriptReference/Animator-pivotPosition.html"))); - transform.Fields.Add(new InspectorField(type, Instances, type.GetProperty("pivotWeight"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Pivot Weight", "Gets the pivot weight.", "http://docs.unity3d.com/ScriptReference/Animator-pivotWeight.html"))); - - InspectorField feet = new InspectorField("Feet"); - - feet.Fields.Add(new InspectorField(type, Instances, type.GetProperty("layersAffectMassCenter"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Layers Affect Mass Center", "", ""))); - feet.Fields.Add(new InspectorField(type, Instances, type.GetProperty("feetPivotActive"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Feet Pivot", "Blends pivot point between body center of mass and feet pivot. At 0%, the blending point is body center of mass. At 100%, the blending point is feet pivot.", "http://docs.unity3d.com/ScriptReference/Animator-feetPivotActive.html"))); - feet.Fields.Add(new InspectorField(type, Instances, type.GetProperty("stabilizeFeet"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Stabilize Feet", "Automatic stabilization of feet during transition and blending.", "http://docs.unity3d.com/ScriptReference/Animator-stabilizeFeet.html"))); - feet.Fields.Add(new InspectorField(type, Instances, type.GetProperty("leftFeetBottomHeight"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Left Feet Bottom Height", "Get left foot bottom height.", "http://docs.unity3d.com/ScriptReference/Animator-leftFeetBottomHeight.html"))); - feet.Fields.Add(new InspectorField(type, Instances, type.GetProperty("rightFeetBottomHeight"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Right Feet Bottom Height", "Get right foot bottom height.", "http://docs.unity3d.com/ScriptReference/Animator-rightFeetBottomHeight.html"))); - - InspectorField debug = new InspectorField("Debug"); - - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("gravityWeight"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Gravity Weight", "The current gravity weight based on current animations that are played.", "http://docs.unity3d.com/ScriptReference/Animator-gravityWeight.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("hasRootMotion"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Has Root Motion", "Returns true if the current rig has root motion.", "http://docs.unity3d.com/ScriptReference/Animator-hasRootMotion.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("hasTransformHierarchy"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Has Tranform Hierarchy", "Returns true if the object has a transform hierarchy.", "http://docs.unity3d.com/ScriptReference/Animator-hasTransformHierarchy.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("humanScale"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Human Scale", "Returns the scale of the current Avatar for a humanoid rig, (1 by default if the rig is generic).", "http://docs.unity3d.com/ScriptReference/Animator-humanScale.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("isHuman"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Is Human", "Returns true if the current rig is humanoid, false if it is generic.", "http://docs.unity3d.com/ScriptReference/Animator-isHuman.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("isMatchingTarget"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Is Matching Target", "If automatic matching is active.", "http://docs.unity3d.com/ScriptReference/Animator-isMatchingTarget.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("isOptimizable"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Is Optimizable", "Returns true if the current rig is optimizable with AnimatorUtility.OptimizeTransformHierarchy.", "http://docs.unity3d.com/ScriptReference/Animator-isOptimizable.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("layerCount"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Layer Count", "The AnimatorController layer count.", "http://docs.unity3d.com/ScriptReference/Animator-layerCount.html"))); - - fields.Add(transform); - fields.Add(feet); - fields.Add(debug); - } - - private HelpAttribute HelpController() - { - foreach (object instance in Instances) - { - Animator animator = instance as Animator; - - if (animator == null) - continue; - - if (animator.runtimeAnimatorController == null) - return new HelpAttribute(HelpType.Error, "The Animator requires a controller to work."); - } - - return null; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimatorEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimatorEditor.cs.meta deleted file mode 100644 index 8ca688a1..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/AnimatorEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b9f314ed08707a14daa8524b1f18c511 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/BoxColliderEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/BoxColliderEditor.cs deleted file mode 100644 index 99dffeb8..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/BoxColliderEditor.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(BoxCollider), true)] - public class BoxColliderEditor : ColliderEditor - { - private static readonly int hash = "BoxColliderEditor".GetHashCode(); - private object boxEditor; - private MethodInfo edit; - - protected override void OnEnable() - { - base.OnEnable(); - - Type box = TypeUtility.GetTypeByName("BoxEditor"); - boxEditor = Activator.CreateInstance(box, true, hash); - edit = box.GetMethod("OnSceneGUI", new Type[] { typeof(Transform), typeof(Color), typeof(Vector3).MakeByRefType(), typeof(Vector3).MakeByRefType() }); - } - - protected override void RefreshFields() - { - Type type = typeof(BoxCollider); - - base.RefreshFields(); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("center"), - new DescriptorAttribute("Center", "The center of the box, measured in the object's local space.", "http://docs.unity3d.com/ScriptReference/BoxCollider-center.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("size"), - new DescriptorAttribute("Size", "The size of the box, measured in the object's local space.", "http://docs.unity3d.com/ScriptReference/BoxCollider-size.html"))); - } - - protected override void OnSceneGUI() - { - base.OnSceneGUI(); - - if (Event.current.type == EventType.Used) - return; - - BoxCollider boxCollider = (BoxCollider)target; - Vector3 center = boxCollider.center; - Vector3 size = boxCollider.size; - Color color = ColliderHandleColor; - - if (!boxCollider.enabled) - { - color = ColliderHandleColorDisabled; - } - - object[] arguments = new object[] { boxCollider.transform, color, center, size }; - - if ((bool)edit.Invoke(boxEditor, arguments)) - { - center = (Vector3)arguments[2]; - size = (Vector3)arguments[3]; - - Undo.RecordObject(boxCollider, "Modified Box Collider"); - boxCollider.center = center; - boxCollider.size = size; - } - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/BoxColliderEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/BoxColliderEditor.cs.meta deleted file mode 100644 index 09c7191b..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/BoxColliderEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f68ddc25c79b9d741b18bac5986fc4f4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CameraEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CameraEditor.cs deleted file mode 100644 index 03b2b55b..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CameraEditor.cs +++ /dev/null @@ -1,268 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(Camera), true)] - public class CameraEditor : InspectorEditor - { - private Rect[] rects; - private Camera camera; - - private SceneView view = null; - - public Vector2 screenshotResolution = new Vector2(); - - protected override void RefreshFields() - { - Type type = typeof(Camera); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("clearFlags"), - new DescriptorAttribute("Clear Flag", "How the camera clears the background.", "http://docs.unity3d.com/ScriptReference/Camera-clearFlags.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("backgroundColor"), new InspectAttribute(new InspectAttribute.InspectDelegate(ShowBackground)), - new DescriptorAttribute("Background Color", "The color with which the screen will be cleared.", "http://docs.unity3d.com/ScriptReference/Camera-backgroundColor.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("cullingMask"), new FieldEditorAttribute("LayerMaskEditor"), - new DescriptorAttribute("Culling Mask", "This is used to render parts of the scene selectively.", "http://docs.unity3d.com/ScriptReference/Camera-cullingMask.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("orthographic"), new RestrictAttribute(new RestrictAttribute.RestrictDelegate(Projection)), - new DescriptorAttribute("Orthographic", "Is the camera orthographic (true) or perspective (false)?", "http://docs.unity3d.com/ScriptReference/Camera-orthographic.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("orthographicSize"), new InspectAttribute(new InspectAttribute.InspectDelegate(IsOrthographic)), - new DescriptorAttribute("Size", "Camera's half-size when in orthographic mode.", "http://docs.unity3d.com/ScriptReference/Camera-orthographicSize.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("fieldOfView"), new InspectAttribute(new InspectAttribute.InspectDelegate(IsFieldOfView)), - new RangeValueAttribute(1, 179), new DescriptorAttribute("Field Of View", "The field of view of the camera in degrees.", "http://docs.unity3d.com/ScriptReference/Camera-fieldOfView.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("nearClipPlane"), - new DescriptorAttribute("Near Clip", "The near clipping plane distance.", "http://docs.unity3d.com/ScriptReference/Camera-nearClipPlane.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("farClipPlane"), - new DescriptorAttribute("Far Clip", "The far clipping plane distance.", "http://docs.unity3d.com/ScriptReference/Camera-farClipPlane.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("rect"), - new DescriptorAttribute("Viewport Rect", "Where on the screen is the camera rendered in normalized coordinates.", "http://docs.unity3d.com/ScriptReference/Camera-rect.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("depth"), - new DescriptorAttribute("Depth", "Camera's depth in the camera rendering order.", "http://docs.unity3d.com/ScriptReference/Camera-depth.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("renderingPath"), new HelpAttribute(new HelpAttribute.HelpDelegate(RenderingHelp)), - new DescriptorAttribute("Rendering Path", "Rendering path.", "http://docs.unity3d.com/ScriptReference/Camera-renderingPath.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("targetTexture"), - new DescriptorAttribute("Render Texture", "Destination render texture (Unity Pro only).", "http://docs.unity3d.com/ScriptReference/Camera-targetTexture.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("useOcclusionCulling"), - new DescriptorAttribute("Occlusion Culling", "Whether or not the Camera will use occlusion culling during rendering.", "http://docs.unity3d.com/ScriptReference/Camera-useOcclusionCulling.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("hdr"), new ReadOnlyAttribute(new ReadOnlyAttribute.ReadOnlyDelegate(IsHDRAvailable)), - new DescriptorAttribute("HDR", "High dynamic range rendering.", "http://docs.unity3d.com/ScriptReference/Camera-hdr.html"))); - - fields.Add(new InspectorField(null, new UnityEngine.Object[] { this }, new object[] { this }, this.GetType().GetMethod("TakeScreenshot"), - new Attribute[] { new InspectAttribute(InspectorLevel.Advanced) })); - fields.Add(new InspectorField(null, new UnityEngine.Object[] { this }, new object[] { this }, null, this.GetType().GetField("screenshotResolution"), false, - new Attribute[] { new InspectAttribute(InspectorLevel.Advanced) })); - - // Debug - InspectorField debug = new InspectorField("Debug"); - fields.Add(debug); - - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("aspect"), new InspectAttribute(InspectorLevel.Debug), new ReadOnlyAttribute(), - new DescriptorAttribute("Aspect Ratio", "The aspect ratio (width divided by height).", "http://docs.unity3d.com/ScriptReference/Camera-aspect.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("clearStencilAfterLightingPass"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Clear Stencil After Lighting", "Clear Stencil After Lighting Pass."))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("depthTextureMode"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Depth Texture Mode", "How and if camera generates a depth texture.", "http://docs.unity3d.com/ScriptReference/Camera-depthTextureMode.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("eventMask"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Event Mask", "Mask to select which layers can trigger events on the camera.", "http://docs.unity3d.com/ScriptReference/Camera-eventMask.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("layerCullDistances"), new InspectAttribute(InspectorLevel.Debug), new CollectionAttribute(0), - new DescriptorAttribute("Layer Cull Distances", "Per-layer culling distances.", "http://docs.unity3d.com/ScriptReference/Camera-layerCullDistances.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("layerCullSpherical"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Layer Cull Spherical", "How to perform per-layer culling for a Camera.", "http://docs.unity3d.com/ScriptReference/Camera-layerCullSpherical.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("pixelRect"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Pixel Rect", "Where on the screen is the camera rendered in pixel coordinates.", "http://docs.unity3d.com/ScriptReference/Camera-pixelRect.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("transparencySortMode"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Transparency Sort Mode", "Transparent object sorting mode.", "http://docs.unity3d.com/ScriptReference/Camera-transparencySortMode.html"))); - - if (camera == null) - { - camera = EditorUtility.CreateGameObjectWithHideFlags("Preview Camera", HideFlags.HideAndDontSave, new Type[] { typeof(Camera) }).GetComponent(); - camera.enabled = false; - } - - rects = new Rect[Instances.Length]; - - for (int i = 0; i < Instances.Length; i++) - rects[i] = new Rect(25, 25, 0, 0); - } - - protected override void OnSceneGUI() - { - base.OnSceneGUI(); - - if (Event.current.type == EventType.Used) - return; - - if (view != SceneView.currentDrawingSceneView) - InitPosition(SceneView.currentDrawingSceneView); - - Handles.BeginGUI(); - - for (int i = 0; i < Instances.Length; i++) - { - Camera instance = Instances[i] as Camera; - rects[i] = GUILayout.Window(i, rects[i], DrawWindow, instance.name + " Preview"); - } - - Handles.EndGUI(); - } - - public void TakeScreenshot() - { - Camera camera = target as Camera; - if (camera == null) - return; - - RenderTexture texture = RenderTexture.GetTemporary((int)screenshotResolution.x, (int)screenshotResolution.y); - camera.targetTexture = texture; - camera.Render(); - camera.targetTexture = null; - RenderTexture.active = texture; - - Texture2D image = new Texture2D((int)screenshotResolution.x, (int)screenshotResolution.y); - image.ReadPixels(new Rect(0, 0, (int)screenshotResolution.x, (int)screenshotResolution.y), 0, 0); - image.Apply(); - - RenderTexture.ReleaseTemporary(texture); - RenderTexture.active = null; - - byte[] file = image.EncodeToPNG(); - - int count = 1; - string path; - while (true) - { - path = Application.dataPath + "/Screenshot_" + count.ToString() + ".png"; - FileInfo info = new FileInfo(path); - if (!info.Exists) - break; - - count++; - } - - File.WriteAllBytes(path, file); - } - - private void InitPosition(SceneView view) - { - this.view = view; - - int offset = 45; - for (int i = 0; i < Instances.Length; i++) - { - Type gameView = TypeUtility.GetTypeByName("GameView"); - MethodInfo info = gameView.GetMethod("GetSizeOfMainGameView", BindingFlags.Static | BindingFlags.NonPublic); - Vector2 camSize = (Vector2)info.Invoke(null, null); - - int width = (int)(camSize.x * 0.25f); - int height = (int)(camSize.y * 0.25f); - - rects[i] = new Rect(view.position.width - width - 25, view.position.height - height - offset, 0, 0); - offset += height + 35; - } - } - - private void DrawWindow(int i) - { - Rect rect = SceneView.currentDrawingSceneView.camera.pixelRect; - - Camera instance = Instances[i] as Camera; - Type gameView = TypeUtility.GetTypeByName("GameView"); - MethodInfo info = gameView.GetMethod("GetSizeOfMainGameView", BindingFlags.Static | BindingFlags.NonPublic); - Vector2 camSize = (Vector2)info.Invoke(null, null); - - int width = (int)(camSize.x * 0.25f); - int height = (int)(camSize.y * 0.25f); - - camera.CopyFrom(instance); - camera.pixelRect = new Rect(rects[i].x + 5, rect.height - rects[i].y - (height), width, height); - camera.Render(); - GUI.DragWindow(); - GUI.Label(GUILayoutUtility.GetRect(width, height), "", GUIStyle.none); - } - - private IList Projection() - { - List list = new List(); - list.Add(new DescriptorPair(false, new DescriptorAttribute("Perspective", ""))); - list.Add(new DescriptorPair(true, new DescriptorAttribute("Orthographic", ""))); - return list; - } - - private bool ShowBackground() - { - foreach (object instance in Instances) - { - Camera camera = instance as Camera; - - if (camera == null) - continue; - - if (camera.clearFlags == CameraClearFlags.Depth || camera.clearFlags == CameraClearFlags.Nothing) - return false; - } - - return true; - } - - private bool IsOrthographic() - { - foreach (object instance in Instances) - { - Camera camera = instance as Camera; - if (camera == null) - continue; - - if (!camera.orthographic) - return false; - } - - return true; - } - - private bool IsFieldOfView() - { - foreach (object instance in Instances) - { - Camera camera = instance as Camera; - if (camera == null) - continue; - - if (camera.orthographic) - return false; - } - - return true; - } - - private bool IsHDRAvailable() - { - return !UnityEditorInternal.InternalEditorUtility.HasPro(); - } - - private HelpAttribute RenderingHelp() - { - foreach (object instance in Instances) - { - Camera camera = instance as Camera; - if (camera == null) - return null; - - if (camera.renderingPath == RenderingPath.DeferredLighting && !UnityEditorInternal.InternalEditorUtility.HasPro()) - return new HelpAttribute(HelpType.Warning, "Deferred lighting requires Unity Pro."); - } - - return null; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CameraEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CameraEditor.cs.meta deleted file mode 100644 index 4aac20f8..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CameraEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5065fd5b555113c46adf4c9bde73b526 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CapsuleColliderEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CapsuleColliderEditor.cs deleted file mode 100644 index cbfd761b..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CapsuleColliderEditor.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(CapsuleCollider), true)] - public class CapsuleColliderEditor : ColliderEditor - { - private int ControlID; - - protected override void RefreshFields() - { - Type type = typeof(CapsuleCollider); - - base.RefreshFields(); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("center"), - new DescriptorAttribute("Center", "The center of the capsule, measured in the object's local space.", "http://docs.unity3d.com/ScriptReference/CapsuleCollider-center.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("height"), - new DescriptorAttribute("Height", "The height of the capsule meased in the object's local space.", "http://docs.unity3d.com/ScriptReference/CapsuleCollider-height.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("radius"), - new DescriptorAttribute("Radius", "The radius of the sphere, measured in the object's local space.", "http://docs.unity3d.com/ScriptReference/CapsuleCollider-radius.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("direction"), new RestrictAttribute(new RestrictAttribute.RestrictDelegate(Direction)), - new DescriptorAttribute("Direction", "The direction of the capsule.", "http://docs.unity3d.com/ScriptReference/CapsuleCollider-direction.html"))); - } - - private List Direction() - { - List list = new List(); - foreach (AxisOrientation orientation in Enum.GetValues(typeof(AxisOrientation))) - list.Add(new DescriptorPair((int)orientation, new DescriptorAttribute(orientation.ToString(), ""))); - - return list; - } - - private Vector3 CapsuleExtends(CapsuleCollider target) - { - return new Vector3(target.radius, target.height, target.radius) + target.center; - } - - private Matrix4x4 CapsuleOrientation(CapsuleCollider target) - { - if (target.direction == (int)AxisOrientation.YAxis) - return Matrix4x4.TRS(target.transform.TransformPoint(target.center), - target.gameObject.transform.rotation, Vector3.one); - else if (target.direction == (int)AxisOrientation.XAxis) - return Matrix4x4.TRS(target.transform.TransformPoint(target.center), - target.transform.rotation * Quaternion.LookRotation(Vector3.up, Vector3.right), Vector3.one); - else - return Matrix4x4.TRS(target.transform.TransformPoint(target.center), - target.transform.rotation * Quaternion.LookRotation(Vector3.right, Vector3.forward), Vector3.one); - } - - protected override void OnSceneGUI() - { - base.OnSceneGUI(); - - if (Event.current.type == EventType.Used) - return; - - CapsuleCollider collider = (CapsuleCollider)target; - - Color color = Handles.color; - if (collider.enabled) - Handles.color = ColliderHandleColor; - else - Handles.color = ColliderHandleColorDisabled; - - bool enabled = GUI.enabled; - if (!Event.current.shift && GUIUtility.hotControl != ControlID) - { - GUI.enabled = false; - Handles.color = new Color(0f, 0f, 0f, 0.001f); - } - - Vector3 capsuleExtents = CapsuleExtends(collider); - Matrix4x4 matrix = CapsuleOrientation(collider); - - float y = capsuleExtents.y - collider.center.y - 1; - float x = capsuleExtents.x - collider.center.x; - - int hotControl = GUIUtility.hotControl; - Vector3 localPos = Vector3.up * y; - - float value = SizeHandle(localPos, Vector3.up, matrix); - if (!GUI.changed) - value = SizeHandle(-localPos, Vector3.down, matrix); - - if (GUI.changed) - collider.height += value / y / collider.height; - - value = SizeHandle(Vector3.left * x, Vector3.left, matrix); - if (!GUI.changed) - value = SizeHandle(-Vector3.left * x, -Vector3.left, matrix); - - if (!GUI.changed) - value = SizeHandle(Vector3.forward * x, Vector3.forward, matrix); - - if (!GUI.changed) - value = SizeHandle(-Vector3.forward * x, -Vector3.forward, matrix); - - if (GUI.changed) - collider.radius += value / Mathf.Max(capsuleExtents.z / collider.radius, capsuleExtents.x / collider.radius); - - if (hotControl != GUIUtility.hotControl && GUIUtility.hotControl != 0) - ControlID = GUIUtility.hotControl; - - if (GUI.changed) - { - Undo.RecordObject(collider, "Edited Capsule Collider"); - collider.radius = Mathf.Max(collider.radius, 0.001f); - collider.height = Mathf.Max(collider.height, 0.001f); - } - - Handles.color = color; - GUI.enabled = enabled; - } - - private float SizeHandle(Vector3 localPos, Vector3 localPullDir, Matrix4x4 matrix) - { - bool changed = GUI.changed; - GUI.changed = false; - - Vector3 rhs = matrix.MultiplyVector(localPullDir); - Vector3 position = matrix.MultiplyPoint(localPos); - float handleSize = HandleUtility.GetHandleSize(position); - - Color color = Handles.color; - float angle = Mathf.Cos(0.7853982f); - - float dot; - if (Camera.current.orthographic) - dot = Vector3.Dot(-Camera.current.transform.forward, rhs); - else - dot = Vector3.Dot((Camera.current.transform.position - position).normalized, rhs); - - if (dot < -angle) - Handles.color = new Color(Handles.color.r, Handles.color.g, Handles.color.b, Handles.color.a * 0.2f); - - Vector3 point = Handles.Slider(position, rhs, handleSize * 0.03f, new Handles.DrawCapFunction(Handles.DotCap), 0f); - - float result = 0f; - if (GUI.changed) - result = HandleUtility.PointOnLineParameter(point, position, rhs); - - GUI.changed |= changed; - Handles.color = color; - - return result; - } - } - - public enum AxisOrientation - { - XAxis = 0, - YAxis = 1, - ZAxis = 2 - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CapsuleColliderEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CapsuleColliderEditor.cs.meta deleted file mode 100644 index f1ab81af..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CapsuleColliderEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c1dcc8846c486e14cb8db81f231d4f59 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterControllerEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterControllerEditor.cs deleted file mode 100644 index 6caab9a4..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterControllerEditor.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(CharacterController), true)] - public class CharacterControllerEditor : InspectorEditor - { - private int controlID = -1; - - private Color colliderHandleColor = new Color(145f, 244f, 139f, 210f) / 255f; - private Color colliderHandleColorDisabled = new Color(84f, 200f, 77f, 140f) / 255f; - - protected override void RefreshFields() - { - Type type = typeof(CharacterController); - if (Instances == null || Instances.Length == 0) - return; - - SerializedObject so = new SerializedObject(Instances.Cast().ToArray()); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("slopeLimit"), - new DescriptorAttribute("Slope Limit", "The character controllers slope limit in degrees.", "http://docs.unity3d.com/ScriptReference/CharacterController-slopeLimit.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("stepOffset"), - new DescriptorAttribute("Step Offset", "The character controllers step offset in meters.", "http://docs.unity3d.com/ScriptReference/CharacterController-stepOffset.html"))); - fields.Add(new InspectorField(type, Instances, so.FindProperty("m_SkinWidth"), - new DescriptorAttribute("Skin Width", "The thickness of the interpenetration of this capsule.", ""))); - fields.Add(new InspectorField(type, Instances, so.FindProperty("m_MinMoveDistance"), - new DescriptorAttribute("Min Move Distance", "The smallest distance required for the character to move.", ""))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("center"), - new DescriptorAttribute("Center", "The center of the character's capsule relative to the transform's position.", "http://docs.unity3d.com/ScriptReference/CharacterController-center.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("radius"), - new DescriptorAttribute("Radius", "The radius of the character's capsule.", "http://docs.unity3d.com/ScriptReference/CharacterController-radius.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("height"), - new DescriptorAttribute("Height", "The height of the character's capsule.", "http://docs.unity3d.com/ScriptReference/CharacterController-height.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("detectCollisions"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Detect Collisions", "Determines whether other rigidbodies or character controllers collide with this character controller (by default this is always enabled).", "http://docs.unity3d.com/ScriptReference/CharacterController-detectCollisions.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("isGrounded"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Is Grounded", "Was the CharacterController touching the ground during the last move?", "http://docs.unity3d.com/ScriptReference/CharacterController-isGrounded.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("collisionFlags"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Collision Flags", "What part of the capsule collided with the environment during the last CharacterController.Move call.", "http://docs.unity3d.com/ScriptReference/CharacterController-collisionFlags.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("velocity"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Velocity", "The current relative velocity of the Character (see notes).", "http://docs.unity3d.com/ScriptReference/CharacterController-velocity.html"))); - } - - protected override void OnSceneGUI() - { - bool flag = GUIUtility.hotControl == controlID; - - CharacterController controller = (CharacterController)target; - Color color = Handles.color; - - if (controller.enabled) - Handles.color = colliderHandleColor; - else - Handles.color = colliderHandleColorDisabled; - - bool enabled = GUI.enabled; - if (!Event.current.shift && !flag) - { - GUI.enabled = false; - Handles.color = new Color(1f, 0f, 0f, 0.001f); - } - - float height = controller.height * controller.transform.lossyScale.y; - float radius = controller.radius * Mathf.Max(controller.transform.lossyScale.x, controller.transform.lossyScale.z); - - height = Mathf.Max(height, radius * 2f); - - Matrix4x4 matrix = Matrix4x4.TRS(controller.transform.TransformPoint(controller.center), Quaternion.identity, Vector3.one); - Vector3 localPos = (Vector3.up * height) * 0.5f; - - float size = SizeHandle(localPos, Vector3.up, matrix, true); - if (!GUI.changed) - size = SizeHandle(-localPos, Vector3.down, matrix, true); - - size = SizeHandle((Vector3)(Vector3.left * radius), Vector3.left, matrix, true); - if (!GUI.changed) - size = SizeHandle((Vector3)(-Vector3.left * radius), -Vector3.left, matrix, true); - - if (!GUI.changed) - size = SizeHandle((Vector3)(Vector3.forward * radius), Vector3.forward, matrix, true); - - if (!GUI.changed) - size = SizeHandle((Vector3)(-Vector3.forward * radius), -Vector3.forward, matrix, true); - - if (GUI.changed) - { - Undo.RecordObject(controller, "Character Controller Resize"); - - controller.radius += size / (radius / controller.radius); - controller.height += size / (height / controller.height); - - controller.radius = Mathf.Max(controller.radius, 1E-05f); - controller.height = Mathf.Max(controller.height, 1E-05f); - } - - int hotControl = GUIUtility.hotControl; - if ((hotControl != GUIUtility.hotControl) && (GUIUtility.hotControl != 0)) - controlID = GUIUtility.hotControl; - - Handles.color = color; - GUI.enabled = enabled; - } - - private static float SizeHandle(Vector3 localPos, Vector3 localPullDir, Matrix4x4 matrix, bool isEdgeHandle) - { - Vector3 rhs = matrix.MultiplyVector(localPullDir); - Vector3 position = matrix.MultiplyPoint(localPos); - float handleSize = HandleUtility.GetHandleSize(position); - bool changed = GUI.changed; - GUI.changed = false; - Color color = Handles.color; - - float edge = 0f; - if (isEdgeHandle) - edge = Mathf.Cos(0.7853982f); - - float dot; - - if (Camera.current.orthographic) - dot = Vector3.Dot(-Camera.current.transform.forward, rhs); - else - { - Vector3 vector4 = Camera.current.transform.position - position; - dot = Vector3.Dot(vector4.normalized, rhs); - } - - if (dot < -edge) - Handles.color = new Color(Handles.color.r, Handles.color.g, Handles.color.b, Handles.color.a * 0.2f); - - Vector3 point = Handles.Slider(position, rhs, handleSize * 0.03f, new Handles.DrawCapFunction(Handles.DotCap), 0f); - - float distance = 0f; - if (GUI.changed) - distance = HandleUtility.PointOnLineParameter(point, position, rhs); - - GUI.changed |= changed; - Handles.color = color; - return distance; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterControllerEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterControllerEditor.cs.meta deleted file mode 100644 index 3a6a95fb..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterControllerEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9fc3a1df54ad5cf4a998c183ab2986a4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterJointEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterJointEditor.cs deleted file mode 100644 index 3cf6ad10..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterJointEditor.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(CharacterJoint), true)] - public class CharacterJointEditor : JointEditor - { - protected override void RefreshFields() - { - base.RefreshFields(); - - Type type = typeof(CharacterJoint); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("swingAxis"), - new DescriptorAttribute("Swing Axis", "The secondary axis around which the joint can rotate.", "http://docs.unity3d.com/ScriptReference/CharacterJoint-swingAxis.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("lowTwistLimit"), new ExpandableAttribute(), - new DescriptorAttribute("Low Twist Limit", "The lower limit around the primary axis of the character joint.", "http://docs.unity3d.com/ScriptReference/CharacterJoint-lowTwistLimit.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("highTwistLimit"), new ExpandableAttribute(), - new DescriptorAttribute("High Twist Limit", "The upper limit around the primary axis of the character joint.", "http://docs.unity3d.com/ScriptReference/CharacterJoint-highTwistLimit.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("swing1Limit"), new ExpandableAttribute(), - new DescriptorAttribute("Swing Limit 1", "The limit around the primary axis of the character joint.", "http://docs.unity3d.com/ScriptReference/CharacterJoint-swing1Limit.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("swing2Limit"), new ExpandableAttribute(), - new DescriptorAttribute("Swing Limit 2", "The limit around the primary axis of the character joint.", "http://docs.unity3d.com/ScriptReference/CharacterJoint-swing2Limit.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterJointEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterJointEditor.cs.meta deleted file mode 100644 index 625f6dd4..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/CharacterJointEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5f8b73519c149ad479e14abd44c0a416 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothEditor.cs deleted file mode 100644 index 4935a3a3..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothEditor.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - //[CustomEditor(typeof(Cloth), true)] - public class ClothEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(Cloth); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("bendingStiffness"), - new DescriptorAttribute("Bending Stiffness", "Is the collider a trigger?", "http://docs.unity3d.com/ScriptReference/Collider-isTrigger.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("stretchingStiffness"), - new DescriptorAttribute("Stretching Stiffness", "", ""))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("damping"), - new DescriptorAttribute("Damping", "", ""))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("thickness"), - new DescriptorAttribute("Thickness", "", ""))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("useGravity"), - new DescriptorAttribute("Use Gravity", "", ""))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("selfCollision"), - new DescriptorAttribute("Self Collision", "", ""))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("externalAcceleration"), - new DescriptorAttribute("External Acceleration", "", ""))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("randomAcceleration"), - new DescriptorAttribute("Random Acceleration", "", ""))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothEditor.cs.meta deleted file mode 100644 index 2d97e4f0..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ea3b75a7a50b8fd4285dc88b3a1b41f6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothRendererEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothRendererEditor.cs deleted file mode 100644 index a5c4f0a1..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothRendererEditor.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -#if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(ClothRenderer), true)] - public class ClothRendererEditor : RendererEditor - { - protected override void RefreshFields() - { - base.RefreshFields(); - Type type = typeof(ClothRenderer); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("pauseWhenNotVisible"), - new DescriptorAttribute("Pause When Not Visible", "Should the cloth simulation be paused when the ClothRenderer is not visible?", "http://docs.unity3d.com/ScriptReference/ClothRenderer-pauseWhenNotVisible.html"))); - } - } -} -#endif \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothRendererEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothRendererEditor.cs.meta deleted file mode 100644 index 80e14e84..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ClothRendererEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cd91353f928567e45b9f95d914376353 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ColliderEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ColliderEditor.cs deleted file mode 100644 index 93dad847..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ColliderEditor.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - public abstract class ColliderEditor : InspectorEditor - { - public static Color ColliderHandleColor = new Color(0.57f, 0.96f, 0.54f, 0.82f); - public static Color ColliderHandleColorDisabled = new Color(0.33f, 0.78f, 0.3f, 0.55f); - - protected override void RefreshFields() - { - Type type = typeof(Collider); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("isTrigger"), - new DescriptorAttribute("Is Trigger", "Is the collider a trigger?", "http://docs.unity3d.com/ScriptReference/Collider-isTrigger.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("sharedMaterial"), new InspectAttribute(new InspectAttribute.InspectDelegate(IsNotTrigger)), - new DescriptorAttribute("Physic Material", "The shared physic material of this collider.", "http://docs.unity3d.com/ScriptReference/Collider-sharedMaterial.html"))); - } - - private bool IsNotTrigger() - { - for (int i = 0; i < Instances.Length; i++) - { - Collider collider = Instances[i] as Collider; - - if (!collider.isTrigger) - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ColliderEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ColliderEditor.cs.meta deleted file mode 100644 index 06c6b96c..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ColliderEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 164d1d8ffdf5b86498399c42eac1eec2 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ConstantForceEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ConstantForceEditor.cs deleted file mode 100644 index aad051da..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ConstantForceEditor.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(ConstantForce), true)] - public class ConstantForceEditor : JointEditor - { - protected override void RefreshFields() - { - Type type = typeof(ConstantForce); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("force"), - new DescriptorAttribute("Force", "The force applied to the rigidbody every frame.", "http://docs.unity3d.com/ScriptReference/ConstantForce-force.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("relativeForce"), - new DescriptorAttribute("Relative Force", "The force - relative to the rigid bodies coordinate system - applied every frame.", "http://docs.unity3d.com/ScriptReference/ConstantForce-relativeForce.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("torque"), - new DescriptorAttribute("Torque", "The torque applied to the rigidbody every frame.", "http://docs.unity3d.com/ScriptReference/ConstantForce-torque.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("relativeTorque"), - new DescriptorAttribute("Relative Torque", "The torque - relative to the rigid bodies coordinate system - applied every frame.", "http://docs.unity3d.com/ScriptReference/ConstantForce-relativeTorque.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ConstantForceEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ConstantForceEditor.cs.meta deleted file mode 100644 index 6b847cce..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/ConstantForceEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 67132d5b321335c45ade534dfc5b466e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/FixedJointEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/FixedJointEditor.cs deleted file mode 100644 index 753a5da7..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/FixedJointEditor.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(FixedJoint), true)] - public class FixedJointEditor : JointEditor - { - protected override void RefreshFields() - { - base.RefreshFields(); - } - } -} diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/FixedJointEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/FixedJointEditor.cs.meta deleted file mode 100644 index 3b953fd9..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/FixedJointEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1d710a6940dd6a8469c34b2076d239f6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJoint2DEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJoint2DEditor.cs deleted file mode 100644 index eb23d53f..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJoint2DEditor.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(HingeJoint2D), true)] - public class HingeJoint2DEditor : AnchoredJoint2DEditor - { - protected override void RefreshFields() - { - base.RefreshFields(); - Type type = typeof(HingeJoint2D); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("useLimits"), - new DescriptorAttribute("Use Limit", "Should limits be placed on the range of rotation?", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-useLimits.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("limits"), new ExpandableAttribute(), new InspectAttribute(new InspectAttribute.InspectDelegate(UsesLimits)), - new DescriptorAttribute("Limits", "Limit of angular rotation on the joint.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-limits.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("useMotor"), - new DescriptorAttribute("Use Motor", "Should the joint be rotated automatically by a motor torque?", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-useMotor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("motor"), new ExpandableAttribute(), new InspectAttribute(new InspectAttribute.InspectDelegate(UsesMotor)), - new DescriptorAttribute("Motor", "Parameters for the motor force applied to the joint.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-motor.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("jointAngle"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Angle", "The current joint angle with respect to the reference angle.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-jointAngle.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("jointSpeed"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Speed", "The current joint speed.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-jointSpeed.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("limitState"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Limit State", "Gets the state of the joint limit.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-limitState.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("referenceAngle"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Reference Angle", "The angle referenced between the two bodies used as the constraint for the joint.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-referenceAngle.html"))); - } - - private bool UsesLimits() - { - foreach (object instance in Instances) - { - HingeJoint2D hinge = instance as HingeJoint2D; - if (hinge == null) - continue; - - if (hinge.useLimits) - return true; - } - - return false; - } - - private bool UsesMotor() - { - foreach (object instance in Instances) - { - HingeJoint2D hinge = instance as HingeJoint2D; - if (hinge == null) - continue; - - if (hinge.useMotor) - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJoint2DEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJoint2DEditor.cs.meta deleted file mode 100644 index 799d168d..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJoint2DEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a080a881e1bc867428d443b192d7c91a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJointEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJointEditor.cs deleted file mode 100644 index a1c47ee5..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJointEditor.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(HingeJoint), true)] - public class HingeJointEditor : JointEditor - { - protected override void RefreshFields() - { - base.RefreshFields(); - Type type = typeof(HingeJoint); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("useLimits"), - new DescriptorAttribute("Use Limits", "Limit of angular rotation on the joint.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-limits.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("limits"), new ExpandableAttribute(), new InspectAttribute(new InspectAttribute.InspectDelegate(UsesLimits)), - new DescriptorAttribute("Limits", "Should the joint be rotated automatically by a motor torque?", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-useMotor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("useMotor"), - new DescriptorAttribute("Use Motor", "Parameters for the motor force applied to the joint.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-motor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("motor"), new ExpandableAttribute(), new InspectAttribute(new InspectAttribute.InspectDelegate(UsesMotor)), - new DescriptorAttribute("Motor", "Parameters for the motor force applied to the joint.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-motor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("useSpring"), - new DescriptorAttribute("Use Spring", "Parameters for the motor force applied to the joint.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-motor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("spring"), new ExpandableAttribute(), new InspectAttribute(new InspectAttribute.InspectDelegate(UsesSpring)), - new DescriptorAttribute("Spring", "Parameters for the motor force applied to the joint.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-motor.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("angle"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Angle", "Should limits be placed on the range of rotation?", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-useLimits.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("velocity"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Velocity", "The current joint angle with respect to the reference angle.", "http://docs.unity3d.com/ScriptReference/HingeJoint2D-jointAngle.html"))); - } - - private bool UsesLimits() - { - foreach (object instance in Instances) - { - HingeJoint hinge = instance as HingeJoint; - if (hinge == null) - continue; - - if (hinge.useLimits) - return true; - } - - return false; - } - - private bool UsesMotor() - { - foreach (object instance in Instances) - { - HingeJoint hinge = instance as HingeJoint; - if (hinge == null) - continue; - - if (hinge.useMotor) - return true; - } - - return false; - } - - private bool UsesSpring() - { - foreach (object instance in Instances) - { - HingeJoint hinge = instance as HingeJoint; - if (hinge == null) - continue; - - if (hinge.useSpring) - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJointEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJointEditor.cs.meta deleted file mode 100644 index 38d52e78..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/HingeJointEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 908add4326cc5094aad042216c8ffe74 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Joint2DEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Joint2DEditor.cs deleted file mode 100644 index d0df6821..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Joint2DEditor.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - public class Joint2DEditor : InspectorEditor - { - public static GUIStyle anchor = null; - public static GUIStyle anchorActive = null; - public static GUIStyle connectedAnchor = null; - public static GUIStyle connectedAnchorActive = null; - - protected override void RefreshFields() - { - Type type = typeof(Joint2D); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("enableCollision"), - new DescriptorAttribute("Enable Collision", "Should rigid bodies connected with this joint collide?", "http://docs.unity3d.com/ScriptReference/Joint2D-enableCollision.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("connectedBody"), - new DescriptorAttribute("Connected Body", "The Rigidbody2D object to which the other end of the joint is attached (ie, the object without the joint component).", "http://docs.unity3d.com/ScriptReference/Joint2D-connectedBody.html"))); - } - - protected bool HandleAnchor(ref Vector3 position, bool isConnectedAnchor) - { - if (anchor == null) - { - anchor = "U2D.pivotDot"; - anchorActive = "U2D.pivotDotActive"; - connectedAnchor = "U2D.dragDot"; - connectedAnchorActive = "U2D.dragDotActive"; - } - - Handles.DrawCapFunction drawFunc = (!isConnectedAnchor) ? new Handles.DrawCapFunction(AnchorCap) : new Handles.DrawCapFunction(ConnectedAnchorCap); - int id = this.target.GetInstanceID() + ((!isConnectedAnchor) ? 0 : 1); - EditorGUI.BeginChangeCheck(); - position = Handles.Slider2D(id, position, Vector3.back, Vector3.right, Vector3.up, 0f, drawFunc, Vector2.zero); - return EditorGUI.EndChangeCheck(); - } - - public static void AnchorCap(int controlID, Vector3 position, Quaternion rotation, float size) - { - if (controlID == GUIUtility.keyboardControl) - DrawCap(controlID, position, anchorActive); - else - DrawCap(controlID, position, anchor); - } - - public static void ConnectedAnchorCap(int controlID, Vector3 position, Quaternion rotation, float size) - { - if (controlID == GUIUtility.keyboardControl) - DrawCap(controlID, position, connectedAnchorActive); - - else - DrawCap(controlID, position, connectedAnchor); - } - - private static void DrawCap(int controlID, Vector3 position, GUIStyle guiStyle) - { - if (Event.current.type != EventType.Repaint) - { - return; - } - Handles.BeginGUI(); - position = HandleUtility.WorldToGUIPoint(position); - float fixedWidth = guiStyle.fixedWidth; - float fixedHeight = guiStyle.fixedHeight; - Rect position2 = new Rect(position.x - fixedWidth / 2f, position.y - fixedHeight / 2f, fixedWidth, fixedHeight); - guiStyle.Draw(position2, GUIContent.none, controlID); - Handles.EndGUI(); - } - - public static void DrawAALine(Vector3 start, Vector3 end) - { - Handles.DrawAAPolyLine(new Vector3[] { start, end }); - } - - public static void DrawDistanceGizmo(Vector3 anchor, Vector3 connectedAnchor, float distance) - { - Vector3 normalized = (anchor - connectedAnchor).normalized; - Vector3 vector = connectedAnchor + normalized * distance; - Vector3 vector2 = Vector3.Cross(normalized, Vector3.forward); - vector2 *= HandleUtility.GetHandleSize(connectedAnchor) * 0.16f; - Handles.color = Color.green; - DrawAALine(anchor, vector); - DrawAALine(connectedAnchor + vector2, connectedAnchor - vector2); - DrawAALine(vector + vector2, vector - vector2); - } - - private static Matrix4x4 GetAnchorSpaceMatrix(Transform transform) - { - return Matrix4x4.TRS(transform.position, Quaternion.Euler(0f, 0f, transform.rotation.eulerAngles.z), transform.lossyScale); - } - - protected static Vector3 TransformPoint(Transform transform, Vector3 position) - { - return GetAnchorSpaceMatrix(transform).MultiplyPoint(position); - } - - protected static Vector3 InverseTransformPoint(Transform transform, Vector3 position) - { - return GetAnchorSpaceMatrix(transform).inverse.MultiplyPoint(position); - } - - protected static Vector3 SnapToSprite(SpriteRenderer spriteRenderer, Vector3 position, float snapDistance) - { - if (spriteRenderer == null) - return position; - - snapDistance = HandleUtility.GetHandleSize(position) * snapDistance; - float num = spriteRenderer.sprite.bounds.size.x / 2f; - float num2 = spriteRenderer.sprite.bounds.size.y / 2f; - - Vector2[] array = new Vector2[] - { - new Vector2(-num, -num2), - new Vector2(0f, -num2), - new Vector2(num, -num2), - new Vector2(-num, 0f), - new Vector2(0f, 0f), - new Vector2(num, 0f), - new Vector2(-num, num2), - new Vector2(0f, num2), - new Vector2(num, num2) - }; - - Vector2[] array2 = array; - for (int i = 0; i < array2.Length; i++) - { - Vector2 v = array2[i]; - Vector3 vector = spriteRenderer.transform.TransformPoint(v); - if (Vector2.Distance(position, vector) <= snapDistance) - return vector; - } - - return position; - } - - protected static Vector3 SnapToPoint(Vector3 position, Vector3 snapPosition, float snapDistance) - { - snapDistance = HandleUtility.GetHandleSize(position) * snapDistance; - return (Vector3.Distance(position, snapPosition) > snapDistance) ? position : snapPosition; - } - - protected static Vector2 RotateVector2(Vector2 direction, float angle) - { - float f = 0.0174532924f * -angle; - float cos = Mathf.Cos(f); - float sin = Mathf.Sin(f); - float x = direction.x * cos - direction.y * sin; - float y = direction.x * sin + direction.y * cos; - return new Vector2(x, y); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Joint2DEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Joint2DEditor.cs.meta deleted file mode 100644 index 8b26bc9f..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Joint2DEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 83502c096c3da4e41a24f0c5dd3245e9 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/JointEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/JointEditor.cs deleted file mode 100644 index e86c9518..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/JointEditor.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - //[CustomEditor(typeof(Joint), true)] - public class JointEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(Joint); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("connectedBody"), - new DescriptorAttribute("Connected Body", "A reference to another rigidbody this joint connects to.", "http://docs.unity3d.com/ScriptReference/Joint-connectedBody.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("anchor"), - new DescriptorAttribute("Anchor", "The Position of the anchor around which the joints motion is constrained.", "http://docs.unity3d.com/ScriptReference/Joint-anchor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("axis"), - new DescriptorAttribute("Axis", "The Direction of the axis around which the body is constrained.", "http://docs.unity3d.com/ScriptReference/Joint-axis.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("autoConfigureConnectedAnchor"), - new DescriptorAttribute("Auto Configure Anchor", "Should the connectedAnchor be calculated automatically?", "http://docs.unity3d.com/ScriptReference/Joint-autoConfigureConnectedAnchor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("connectedAnchor"), - new DescriptorAttribute("Connected Anchor", "Position of the anchor relative to the connected Rigidbody.", "http://docs.unity3d.com/ScriptReference/Joint-connectedAnchor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("breakForce"), - new DescriptorAttribute("Break Force", "The force that needs to be applied for this joint to break.", "http://docs.unity3d.com/ScriptReference/Joint-breakForce.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("breakTorque"), - new DescriptorAttribute("Break Torque", "The torque that needs to be applied for this joint to break.", "http://docs.unity3d.com/ScriptReference/Joint-breakTorque.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("enableCollision"), - new DescriptorAttribute("Enable Collision", "Enable collision between bodies connected with the joint.", "http://docs.unity3d.com/ScriptReference/Joint-enableCollision.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/JointEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/JointEditor.cs.meta deleted file mode 100644 index 410ccaa6..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/JointEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e4194aa8c25a02c48951516e3e30ac9a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/LightEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/LightEditor.cs deleted file mode 100644 index b4efe4a2..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/LightEditor.cs +++ /dev/null @@ -1,351 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(Light), true)] - public class LightEditor : InspectorEditor - { - private static Color disabledLightColor = new Color(0.5f, 0.45f, 0.2f, 0.5f); - private static Color lightColor = new Color(0.95f, 0.95f, 0.5f, 0.5f); - - private SerializedProperty m_Lightmapping; - - protected override void RefreshFields() - { - Type type = typeof(Light); - if (Instances == null || Instances.Length == 0) - return; - - SerializedObject so = new SerializedObject(Instances.Cast().ToArray()); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("type"), - new HelpAttribute(new HelpAttribute.HelpDelegate(HelpLightType)), - new DescriptorAttribute("Type", "The type of the light.", "http://docs.unity3d.com/ScriptReference/Light-type.html"))); - - m_Lightmapping = so.FindProperty("m_Lightmapping"); - fields.Add(new InspectorField(type, Instances, m_Lightmapping, - new InspectAttribute(new InspectAttribute.InspectDelegate(IsNotArea)), - new RestrictAttribute(new RestrictAttribute.RestrictDelegate(Baking)), - new DescriptorAttribute("Baking", "How the light is handled versus lightmaps."))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("range"), - new InspectAttribute(new InspectAttribute.InspectDelegate(IsPointOrSpot)), - new DescriptorAttribute("Range", "The range of the light.", "http://docs.unity3d.com/ScriptReference/Light-range.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("spotAngle"), - new InspectAttribute(new InspectAttribute.InspectDelegate(IsSpot)), - new DescriptorAttribute("Spot Angle", "The angle of the light's spotlight cone in degrees.", "http://docs.unity3d.com/ScriptReference/Light-spotAngle.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("areaSize"), - new InspectAttribute(new InspectAttribute.InspectDelegate(IsArea)), - new DescriptorAttribute("Area Size", "The size of the area light. Editor only.", "http://docs.unity3d.com/ScriptReference/Light-areaSize.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("color"), - new DescriptorAttribute("Color", "The color of the light.", "http://docs.unity3d.com/ScriptReference/Light-color.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("intensity"), - new RangeValueAttribute(0f, 8f), - new DescriptorAttribute("Intensity", "The Intensity of a light is multiplied with the Light color.", "http://docs.unity3d.com/ScriptReference/Light-intensity.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("bounceIntensity"), - new RangeValueAttribute(0f, 8f), new HelpAttribute(new HelpAttribute.HelpDelegate(HelpBouncedGI)), - new DescriptorAttribute("Bounce Intensity", "The multiplier that defines the strength of the bounce lighting.", "http://docs.unity3d.com/ScriptReference/Light-bounceIntensity.html"))); - - - - //Acts like a group - fields.Add(new InspectorField(type, Instances, type.GetProperty("shadows"), - new InspectAttribute(new InspectAttribute.InspectDelegate(IsNotArea)), - new HelpAttribute(new HelpAttribute.HelpDelegate(HelpShadowPro)), - new DescriptorAttribute("Shadow Type", "How this light casts shadows", "http://docs.unity3d.com/ScriptReference/Light-shadows.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("shadowStrength"), - new InspectAttribute(new InspectAttribute.InspectDelegate(HasShadow)), - new DescriptorAttribute("Strength", "How this light casts shadows.", "http://docs.unity3d.com/ScriptReference/Light-shadowStrength.html"))); - fields.Add(new InspectorField(type, Instances, so.FindProperty("m_Shadows.m_Resolution"), - new InspectAttribute(new InspectAttribute.InspectDelegate(HasShadow)), - new DescriptorAttribute("Resolution", "The shadow's resolution."))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("shadowBias"), - new InspectAttribute(new InspectAttribute.InspectDelegate(HasShadow)), - new DescriptorAttribute("Bias", "Shadow mapping bias.", "http://docs.unity3d.com/ScriptReference/Light-shadowBias.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("shadowNormalBias"), - new InspectAttribute(new InspectAttribute.InspectDelegate(HasShadow)), - new DescriptorAttribute("Normal Bias", "Shadow mapping normal-based bias.", "http://docs.unity3d.com/ScriptReference/Light-shadowNormalBias.html"))); - - fields.Add(new InspectorField(type, Instances, so.FindProperty("m_DrawHalo"), - new DescriptorAttribute("Draw Halo", "Draw a halo around the light. Now work with the Halo class."))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("cookie"), - new DescriptorAttribute("Cookie", "The cookie texture projected by the light.", "http://docs.unity3d.com/ScriptReference/Light-cookie.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("cookieSize"), - new InspectAttribute(new InspectAttribute.InspectDelegate(IsDirectional)), - new DescriptorAttribute("Cookie Size", "The size of a directional light's cookie.", "http://docs.unity3d.com/ScriptReference/Light-cookieSize.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("flare"), - new DescriptorAttribute("Flare", "The flare asset to use for this light.", "http://docs.unity3d.com/ScriptReference/Light-flare.html"))); - - fields.Add(new InspectorField(type, Instances, so.FindProperty("m_RenderMode"), - new DescriptorAttribute("Render Mode", "The rendering path for the lights."))); - - fields.Add(new InspectorField(type, Instances, so.FindProperty("m_CullingMask"), - new HelpAttribute(new HelpAttribute.HelpDelegate(HelpSceneLighting)), - new DescriptorAttribute("Culling Mask", "The object that are affected or ignored by the light."))); - } - - private IList Baking() - { - return new DescriptorPair[] { new DescriptorPair(4, "Realtime", ""), new DescriptorPair(2, "Baked", ""), new DescriptorPair(1, "Mixed", "") }; - } - - public bool IsPointOrSpot() - { - if (IsPoint() || IsSpot()) - return true; - - return false; - } - - public bool IsPoint() - { - return ((Light)Instances[0]).type == LightType.Point; - } - - public bool IsSpot() - { - return ((Light)Instances[0]).type == LightType.Spot; - } - - public bool IsDirectional() - { - return ((Light)Instances[0]).type == LightType.Directional; - } - - public bool IsNotArea() - { - return !IsArea(); - } - - public bool IsArea() - { - return ((Light)Instances[0]).type == LightType.Area; - } - - public bool HasShadow() - { - Light light = (Light)Instances[0]; - return IsNotArea() && (light.shadows == LightShadows.Hard || light.shadows == LightShadows.Soft); - } - - public bool IsSoft() - { - return ((Light)Instances[0]).shadows == LightShadows.Soft; - } - - public bool DoesAnyCameraUseDeferred() - { - Camera[] allCameras = Camera.allCameras; - for (int i = 0; i < allCameras.Length; i++) - if (allCameras[i].actualRenderingPath == RenderingPath.DeferredLighting) - return true; - - return false; - } - - public HelpAttribute HelpBouncedGI() - { - if (((Light)Instances[0]).bounceIntensity > 0 && IsPointOrSpot() && m_Lightmapping.intValue != 2) - return new HelpAttribute(HelpType.Warning, "Currently realtime indirect bounce light shadowing for spot and point lights is not supported."); - - return null; - } - - public HelpAttribute HelpShadowPro() - { - if (HasShadow() && IsPointOrSpot() && !UnityEditorInternal.InternalEditorUtility.HasPro()) - return new HelpAttribute(HelpType.Warning, "Real time shadow for point and spot lights requires Unity Pro."); - - return null; - } - - public HelpAttribute HelpLightType() - { - if (IsArea() && !UnityEditorInternal.InternalEditorUtility.HasPro()) - return new HelpAttribute(HelpType.Warning, "Area lights require Unity Pro."); - - return null; - } - - public HelpAttribute HelpSceneLighting() - { - if (SceneView.currentDrawingSceneView != null && !SceneView.currentDrawingSceneView.m_SceneLighting) - return new HelpAttribute(HelpType.Warning, "One of your scene views has lighting disable, please keep this in mind when editing lighting."); - - return null; - } - - protected override void OnSceneGUI() - { - base.OnSceneGUI(); - - if (Event.current.type == EventType.Used) - return; - - Light light = (Light)target; - Color color = Handles.color; - - if (light.enabled) - Handles.color = lightColor; - else - Handles.color = disabledLightColor; - - float range = light.range; - switch (light.type) - { - case LightType.Spot: - { - Color color2 = Handles.color; - color2.a = Mathf.Clamp01(color.a * 2f); - Handles.color = color2; - Vector2 angleAndRange = new Vector2(light.spotAngle, light.range); - angleAndRange = ConeHandle(light.transform.rotation, light.transform.position, angleAndRange, 1f, 1f, true); - if (GUI.changed) - { - Undo.RecordObject(light, "Adjust Spot Light"); - light.spotAngle = angleAndRange.x; - light.range = Mathf.Max(angleAndRange.y, 0.01f); - } - - break; - } - - case LightType.Point: - { - range = Handles.RadiusHandle(Quaternion.identity, light.transform.position, range, true); - if (GUI.changed) - { - Undo.RecordObject(light, "Adjust Point Light"); - light.range = range; - } - - break; - } - - case LightType.Area: - { - EditorGUI.BeginChangeCheck(); - Vector2 vector2 = RectHandles(light.transform.rotation, light.transform.position, light.areaSize); - if (EditorGUI.EndChangeCheck()) - { - Undo.RecordObject(light, "Adjust Area Light"); - light.areaSize = vector2; - } - - break; - } - } - Handles.color = color; - } - - private Vector2 ConeHandle(Quaternion rotation, Vector3 position, Vector2 angleAndRange, float angleScale, float rangeScale, bool handlesOnly) - { - float x = angleAndRange.x; - float y = angleAndRange.y; - float r = y * rangeScale; - - Vector3 forward = rotation * Vector3.forward; - Vector3 up = rotation * Vector3.up; - Vector3 right = rotation * Vector3.right; - - bool changed = GUI.changed; - GUI.changed = false; - r = SizeSlider(position, forward, r); - if (GUI.changed) - y = Mathf.Max(0f, r / rangeScale); - - GUI.changed |= changed; - changed = GUI.changed; - GUI.changed = false; - - float angle = (r * Mathf.Tan((0.01745329f * x) / 2f)) * angleScale; - angle = SizeSlider(position + (forward * r), up, angle); - angle = SizeSlider(position + (forward * r), -up, angle); - angle = SizeSlider(position + (forward * r), right, angle); - angle = SizeSlider(position + (forward * r), -right, angle); - - if (GUI.changed) - x = Mathf.Clamp((57.29578f * Mathf.Atan(angle / (r * angleScale))) * 2f, 0f, 179f); - - GUI.changed |= changed; - if (!handlesOnly) - { - Handles.DrawLine(position, (Vector3)((position + (forward * r)) + (up * angle))); - Handles.DrawLine(position, (Vector3)((position + (forward * r)) - (up * angle))); - Handles.DrawLine(position, (Vector3)((position + (forward * r)) + (right * angle))); - Handles.DrawLine(position, (Vector3)((position + (forward * r)) - (right * angle))); - Handles.DrawWireDisc(position + ((Vector3)(r * forward)), forward, angle); - } - - return new Vector2(x, y); - } - - private Vector2 RectHandles(Quaternion rotation, Vector3 position, Vector2 size) - { - Vector3 forward = (Vector3)(rotation * Vector3.forward); - Vector3 up = (Vector3)(rotation * Vector3.up); - Vector3 right = (Vector3)(rotation * Vector3.right); - - float radiusX = 0.5f * size.x; - float radiusY = 0.5f * size.y; - - Vector3 v1 = (position + (up * radiusY)) + (right * radiusX); - Vector3 v2 = (position - (up * radiusY)) + (right * radiusX); - Vector3 v3 = (position - (up * radiusY)) - (right * radiusX); - Vector3 v4 = (position + (up * radiusY)) - (right * radiusX); - - Handles.DrawLine(v1, v2); - Handles.DrawLine(v2, v3); - Handles.DrawLine(v3, v4); - Handles.DrawLine(v4, v1); - - Color color = Handles.color; - color.a = Mathf.Clamp01(color.a * 2f); - Handles.color = color; - - radiusY = SizeSlider(position, up, radiusY); - radiusY = SizeSlider(position, -up, radiusY); - radiusX = SizeSlider(position, right, radiusX); - radiusX = SizeSlider(position, -right, radiusX); - - if (((Tools.current != Tool.Move) && (Tools.current != Tool.Scale)) || Tools.pivotRotation != PivotRotation.Local) - Handles.DrawLine(position, position + forward); - - size.x = 2f * radiusX; - size.y = 2f * radiusY; - - return size; - } - - private float SizeSlider(Vector3 p, Vector3 direction, float radius) - { - Vector3 position = p + (direction * radius); - float handleSize = HandleUtility.GetHandleSize(position); - - bool changed = GUI.changed; - GUI.changed = false; - - position = Handles.Slider(position, direction, handleSize * 0.03f, new Handles.DrawCapFunction(Handles.DotCap), 0f); - - if (GUI.changed) - radius = Vector3.Dot(position - p, direction); - - GUI.changed |= changed; - return radius; - } - } -} diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/LightEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/LightEditor.cs.meta deleted file mode 100644 index b6532a8e..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/LightEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: eebe3cc40d780b84e8af810e11b0d210 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshColliderEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshColliderEditor.cs deleted file mode 100644 index 901a3d78..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshColliderEditor.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(MeshCollider), true)] - public class MeshColliderEditor : ColliderEditor - { - protected override void RefreshFields() - { - Type type = typeof(MeshCollider); - - base.RefreshFields(); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("convex"), - new DescriptorAttribute("Convex", "Use a convex collider from the mesh.", "http://docs.unity3d.com/ScriptReference/MeshCollider-convex.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("sharedMesh"), new HelpAttribute(new HelpAttribute.HelpDelegate(HelpMesh)), - new DescriptorAttribute("Mesh", "The mesh object used for collision detection.", "http://docs.unity3d.com/ScriptReference/MeshCollider-sharedMesh.html"))); - } - - private HelpAttribute HelpMesh() - { - foreach (object instance in Instances) - { - MeshCollider collider = instance as MeshCollider; - - if (collider == null) - continue; - - if (collider.sharedMesh == null) - return new HelpAttribute(HelpType.Error, "The Mesh Collider requires a Mesh to work."); - } - - return null; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshColliderEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshColliderEditor.cs.meta deleted file mode 100644 index dabc1f67..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshColliderEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 84ba51c5c587f614e8ebc91d7f72209c -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshEditor.cs deleted file mode 100644 index dbc63dc7..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshEditor.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(Mesh), true)] - public class MeshEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(Mesh); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("subMeshCount"), - new DescriptorAttribute("Sub Mesh Count", "The number of submeshes. Every material has a separate triangle list.", "http://docs.unity3d.com/ScriptReference/Mesh-subMeshCount.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("vertices"), - new DescriptorAttribute("Vertices", "Returns a copy of the vertex positions or assigns a new vertex positions array.", "http://docs.unity3d.com/ScriptReference/Mesh-vertices.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("triangles"), - new DescriptorAttribute("Triangles", "An array containing all triangles in the mesh.", "http://docs.unity3d.com/ScriptReference/Mesh-triangles.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("uv"), - new DescriptorAttribute("UV", "The base texture coordinates of the mesh.", "http://docs.unity3d.com/ScriptReference/Mesh-uv.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("uv2"), - new DescriptorAttribute("UV2", "The second texture coordinate set of the mesh, if present.", "http://docs.unity3d.com/ScriptReference/Mesh-uv2.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("uv3"), - new DescriptorAttribute("UV3", "The third texture coordinate set of the mesh, if present.", "http://docs.unity3d.com/ScriptReference/Mesh-uv3.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("uv4"), - new DescriptorAttribute("UV4", "The fourth texture coordinate set of the mesh, if present.", "http://docs.unity3d.com/ScriptReference/Mesh-uv4.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("boneWeights"), - new DescriptorAttribute("Bone Weight", "The bone weights of each vertex.", "http://docs.unity3d.com/ScriptReference/Mesh-boneWeights.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("colors"), - new DescriptorAttribute("Colors", "Vertex colors of the mesh.", "http://docs.unity3d.com/ScriptReference/Mesh-colors.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("normals"), - new DescriptorAttribute("Normals", "The normals of the mesh.", "http://docs.unity3d.com/ScriptReference/Mesh-normals.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("tangents"), - new DescriptorAttribute("Tangents", "The tangents of the mesh.", "http://docs.unity3d.com/ScriptReference/Mesh-tangents.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("bounds"), - new DescriptorAttribute("Bounds", "The bounding volume of the mesh.", "http://docs.unity3d.com/ScriptReference/Mesh-bounds.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshEditor.cs.meta deleted file mode 100644 index 5c0453c9..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 01fd2f5ffcf96cb4fbea0525b8abac31 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshFilterEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshFilterEditor.cs deleted file mode 100644 index b74e76a5..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshFilterEditor.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(MeshFilter), true)] - public class MeshFilterEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(MeshFilter); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("sharedMesh"), new ExpandableAttribute(), - new DescriptorAttribute("Mesh", "Returns the shared mesh of the mesh filter.", "http://docs.unity3d.com/ScriptReference/MeshFilter-sharedMesh.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshFilterEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshFilterEditor.cs.meta deleted file mode 100644 index f65f8840..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshFilterEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d593b3a6858817e44a554bfc7b09e8bc -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshRendererEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshRendererEditor.cs deleted file mode 100644 index 049ff62c..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshRendererEditor.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(MeshRenderer), true)] - public class MeshRendererEditor : RendererEditor - { - protected override void RefreshFields() - { - base.RefreshFields(); - } - } -} diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshRendererEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshRendererEditor.cs.meta deleted file mode 100644 index 9864e12f..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/MeshRendererEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4c5a0dded0d6c1d4891ba69e2a80bf19 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RendererEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RendererEditor.cs deleted file mode 100644 index 08c4ac1c..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RendererEditor.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - //[CustomEditor(typeof(Renderer), true)] - public class RendererEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(Renderer); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("shadowCastingMode"), - new DescriptorAttribute("Cast Shadows", "Does this object cast shadows?", "http://docs.unity3d.com/ScriptReference/Renderer-shadowCastingMode.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("receiveShadows"), - new DescriptorAttribute("Receive Shadows", "Does this object receive shadows?", "http://docs.unity3d.com/ScriptReference/Renderer-receiveShadows.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("useLightProbes"), - new DescriptorAttribute("Use Light Probes", "Use light probes for this Renderer.", "http://docs.unity3d.com/ScriptReference/Renderer-useLightProbes.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("probeAnchor"), new InspectAttribute(new InspectAttribute.InspectDelegate(IsUsingLightProbe)), - new DescriptorAttribute("Probes Anchor", "If set, Renderer will use this Transform's position to find the interpolated light probe.", "http://docs.unity3d.com/ScriptReference/Renderer-lightProbeAnchor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("sharedMaterials"), - new DescriptorAttribute("Materials", "All the shared materials of this object.", "http://docs.unity3d.com/ScriptReference/Renderer-sharedMaterials.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("isPartOfStaticBatch"), - new DescriptorAttribute("Static Batched", "Has this renderer been statically batched with any other renderers?", "http://docs.unity3d.com/ScriptReference/Renderer-isPartOfStaticBatch.html"), new InspectAttribute(InspectorLevel.Debug))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("isVisible"), - new DescriptorAttribute("Is Visible", "Is this renderer visible in any camera? (Read Only)", "http://docs.unity3d.com/ScriptReference/Renderer-isVisible.html"), new InspectAttribute(InspectorLevel.Debug))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("lightmapIndex"), - new DescriptorAttribute("Lightmap Index", "The index of the lightmap applied to this renderer.", "http://docs.unity3d.com/ScriptReference/Renderer-lightmapIndex.html"), new InspectAttribute(InspectorLevel.Debug))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("sortingLayerID"), - new DescriptorAttribute("Sorting Layer ID", "ID of the Renderer's sorting layer.", "http://docs.unity3d.com/ScriptReference/Renderer-sortingLayerID.html"), new InspectAttribute(InspectorLevel.Debug))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("sortingLayerName"), - new DescriptorAttribute("Sorting Layer Name", "Name of the Renderer's sorting layer.", "http://docs.unity3d.com/ScriptReference/Renderer-sortingLayerName.html"), new InspectAttribute(InspectorLevel.Debug))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("sortingOrder"), - new DescriptorAttribute("Sorting Order", "Renderer's order within a sorting layer.", "http://docs.unity3d.com/ScriptReference/Renderer-sortingOrder.html"), new InspectAttribute(InspectorLevel.Debug))); - } - - private bool IsUsingLightProbe() - { - for (int i = 0; i < Instances.Length; i++) - if (!((Renderer)Instances[i]).useLightProbes) - return false; - - return true; - } - } -} diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RendererEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RendererEditor.cs.meta deleted file mode 100644 index f2217be6..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RendererEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ce4ec5cace74bb249aca3027a18d293a -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Rigidbody2DEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Rigidbody2DEditor.cs deleted file mode 100644 index 18a5c850..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Rigidbody2DEditor.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(Rigidbody2D), true)] - public class Rigidbody2DEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(Rigidbody2D); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("mass"), - new DescriptorAttribute("Mass", "The mass of the rigidbody", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-mass.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("drag"), - new DescriptorAttribute("Linear Drag", "Coefficient of drag.", "http://docs.unity3d.com/ScriptReference/Rigidbody2D-drag.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("angularDrag"), - new DescriptorAttribute("Angular Drag", "Coefficient of angular drag.", "http://docs.unity3d.com/ScriptReference/Rigidbody2D-angularDrag.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("gravityScale"), - new DescriptorAttribute("Gravity Scale", "The degree to which this object is affected by gravity.", "http://docs.unity3d.com/ScriptReference/Rigidbody2D-gravityScale.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("isKinematic"), - new DescriptorAttribute("Is Kinematic", "Should this rigidbody be taken out of physics control?", "http://docs.unity3d.com/ScriptReference/Rigidbody2D-isKinematic.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("interpolation"), - new DescriptorAttribute("Interpolation", "Physics interpolation used between updates.", "http://docs.unity3d.com/ScriptReference/Rigidbody2D-interpolation.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("sleepMode"), - new DescriptorAttribute("Sleep Mode", "The sleep state that the rigidbody will initially be in.", "http://docs.unity3d.com/ScriptReference/Rigidbody2D-sleepMode.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("collisionDetectionMode"), - new DescriptorAttribute("Collision Detection", "The method used by the physics engine to check if two objects have collided.", "http://docs.unity3d.com/ScriptReference/Rigidbody2D-collisionDetectionMode.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("constraints"), - new DescriptorAttribute("Constraints", "Controls which degrees of freedom are allowed for the simulation of this Rigidbody2D.", "http://docs.unity3d.com/ScriptReference/Rigidbody2D-constraints.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("velocity"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Velocity", "Linear velocity of the rigidbody.", "http://docs.unity3d.com/ScriptReference/Rigidbody2D-velocity.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Rigidbody2DEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Rigidbody2DEditor.cs.meta deleted file mode 100644 index f12a6d7c..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/Rigidbody2DEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d0bb3c1cf8af559429a6595132875d69 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RigidbodyEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RigidbodyEditor.cs deleted file mode 100644 index c2d95781..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RigidbodyEditor.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(Rigidbody), true)] - public class RigidbodyEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(Rigidbody); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("mass"), - new DescriptorAttribute("Mass", "The mass of the rigidbody", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-mass.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("drag"), - new DescriptorAttribute("Drag", "The drag of the object", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-drag.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("angularDrag"), - new DescriptorAttribute("Angular Drag", "The angular drag of the object", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-angularDrag.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("useGravity"), - new DescriptorAttribute("Use Gravity", "Is the object affected by world gravity", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-useGravity.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("isKinematic"), - new DescriptorAttribute("Is Kinematic", "If true, physic does not drive this object, used for animation", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-isKinematic.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("interpolation"), - new DescriptorAttribute("Interpolation", "Interpolation allows you to smooth out the effect of running physics at a fixed frame rate", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-interpolation.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("collisionDetectionMode"), - new DescriptorAttribute("Collision Detection", "How collision are detected", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-collisionDetectionMode.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("constraints"), new EnumAttribute(true), - new DescriptorAttribute("Constraints", "Controls which degrees of freedom are allowed for the simulation of this Rigidbody", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-constraints.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("centerOfMass"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Center of Mass", "In essence, the pivot around which the object spins", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-centerOfMass.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("freezeRotation"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Freeze Rotation", "Controls whether physics will change the rotation of the object", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-freezeRotation.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("inertiaTensor"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Inertia Tensor", "The diagonal inertia tensor of mass relative to the center of mass", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-inertiaTensor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("inertiaTensorRotation"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Inertia Tensor Rotation", "The rotation of the inertia tensor", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-inertiaTensorRotation.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("maxAngularVelocity"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Max Angular Velocity", "The maximimum angular velocity of the rigidbody. (Default 7) range { 0, infinity }", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-maxAngularVelocity.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("sleepThreshold"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Sleep Threshold", "The mass-normalized energy threshold, below which objects start going to sleep.", "http://docs.unity3d.com/ScriptReference/Rigidbody-sleepThreshold.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("solverIterationCount"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Solver Iteration Count", "Allows you to override the solver iteration count per rigidbody", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-solverIterationCount.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("useConeFriction"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Use Cone Friction", "Force cone friction to be used for this rigidbody", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-useConeFriction.html"))); - - InspectorField debug = new InspectorField("Debug"); - fields.Add(debug); - - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("position"), new ReadOnlyAttribute(), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Position", "The position of the rigidbody", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-position.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("rotation"), new ReadOnlyAttribute(), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Rotation", "The rotation of the rigidbody", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-rotation.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("velocity"), new ReadOnlyAttribute(), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Velocity", "The velocity of the rigidbody", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-velocity.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("angularVelocity"), new ReadOnlyAttribute(), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("Angular Velocity", "The rotation velocity of the rigidbody", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-angularVelocity.html"))); - debug.Fields.Add(new InspectorField(type, Instances, type.GetProperty("worldCenterOfMass"), new InspectAttribute(InspectorLevel.Debug), - new DescriptorAttribute("World Center of Mass", "The center of mass of the rigidbody in world space", "https://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-worldCenterOfMass.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RigidbodyEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RigidbodyEditor.cs.meta deleted file mode 100644 index be1230bf..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/RigidbodyEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1d67a22510eb1e240abe8ebec8839fa4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SkinnedMeshRendererEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SkinnedMeshRendererEditor.cs deleted file mode 100644 index a030be92..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SkinnedMeshRendererEditor.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(SkinnedMeshRenderer), true)] - public class SkinnedMeshRendererEditor : RendererEditor - { - protected override void RefreshFields() - { - base.RefreshFields(); - Type type = typeof(SkinnedMeshRenderer); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("quality"), - new DescriptorAttribute("Quality", "The maximum number of bones affecting a single vertex.", "http://docs.unity3d.com/ScriptReference/SkinnedMeshRenderer-quality.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("updateWhenOffscreen"), - new DescriptorAttribute("Update Off Screen", "If enabled, the Skinned Mesh will be updated when offscreen. If disabled, this also disables updating animations.", "http://docs.unity3d.com/ScriptReference/SkinnedMeshRenderer-updateWhenOffscreen.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("sharedMesh"), - new DescriptorAttribute("Mesh", "The mesh used for skinning.", "http://docs.unity3d.com/ScriptReference/SkinnedMeshRenderer-sharedMesh.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("rootBone"), - new DescriptorAttribute("Root", "The root boot of the skeletton hierarchy."))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("bones"), - new CollectionAttribute(-1), new DescriptorAttribute("Bones", "The bones used to skin the mesh.", "http://docs.unity3d.com/ScriptReference/SkinnedMeshRenderer-bones.html"), new InspectAttribute(InspectorLevel.Advanced))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("localBounds"), - new DescriptorAttribute("Bounds", "AABB of this Skinned Mesh in its local space.", "http://docs.unity3d.com/ScriptReference/SkinnedMeshRenderer-localBounds.html"), new InspectAttribute(InspectorLevel.Advanced))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SkinnedMeshRendererEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SkinnedMeshRendererEditor.cs.meta deleted file mode 100644 index b8af0844..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SkinnedMeshRendererEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e89a2246ecd24504bafbbe834d56c265 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SphereColliderEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SphereColliderEditor.cs deleted file mode 100644 index 16f0b519..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SphereColliderEditor.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(SphereCollider), true)] - public class SphereColliderEditor : ColliderEditor - { - private int ControlID = -1; - - protected override void RefreshFields() - { - Type type = typeof(SphereCollider); - - base.RefreshFields(); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("center"), - new DescriptorAttribute("Center", "The center of the sphere, measured in the object's local space.", "http://docs.unity3d.com/ScriptReference/SphereCollider-center.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("radius"), - new DescriptorAttribute("Radius", "The radius of the sphere, measured in the object's local space.", "http://docs.unity3d.com/ScriptReference/SphereCollider-radius.html"))); - } - - protected override void OnSceneGUI() - { - base.OnSceneGUI(); - - if (Event.current.type == EventType.Used) - return; - - SphereCollider collider = (SphereCollider)target; - Color color = Handles.color; - - if (collider.enabled) - Handles.color = ColliderHandleColor; - else - Handles.color = ColliderHandleColorDisabled; - - bool enabled = GUI.enabled; - if (!Event.current.shift && GUIUtility.hotControl != ControlID) - { - GUI.enabled = false; - Handles.color = new Color(0f, 0f, 0f, 0.001f); - } - - Vector3 lossyScale = collider.transform.lossyScale; - float x = Mathf.Abs(lossyScale.x); - - float scale = Mathf.Max(Mathf.Max(x, Mathf.Abs(lossyScale.y)), Mathf.Abs(lossyScale.z)); - float radius = Mathf.Max(Mathf.Abs(scale * collider.radius), 0.001f); - - Vector3 position = collider.transform.TransformPoint(collider.center); - Quaternion rotation = collider.transform.rotation; - - int hotControl = GUIUtility.hotControl; - float value = Handles.RadiusHandle(rotation, position, radius, true); - - if (GUI.changed) - { - Undo.RecordObject(collider, "Edited Sphere Collider"); - collider.radius = value / scale; - } - - if (hotControl != GUIUtility.hotControl && GUIUtility.hotControl != 0) - ControlID = GUIUtility.hotControl; - - Handles.color = color; - GUI.enabled = enabled; - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SphereColliderEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SphereColliderEditor.cs.meta deleted file mode 100644 index ecfce56a..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SphereColliderEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c593d1bebd359cc4c8a9ab8af4ab926d -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJoint2DEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJoint2DEditor.cs deleted file mode 100644 index c297b985..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJoint2DEditor.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(SpringJoint2D), true)] - public class SpringJoint2DEditor : AnchoredJoint2DEditor - { - protected override void RefreshFields() - { - base.RefreshFields(); - Type type = typeof(SpringJoint2D); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("dampingRatio"), - new DescriptorAttribute("Damping Ratio", "The amount by which the spring force is reduced in proportion to the movement speed.", "http://docs.unity3d.com/ScriptReference/SpringJoint2D-dampingRatio.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("distance"), - new DescriptorAttribute("Distance", "The distance the spring will try to keep between the two objects.", "http://docs.unity3d.com/ScriptReference/SpringJoint2D-distance.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("frequency"), - new DescriptorAttribute("Frequency", "The frequency at which the spring oscillates around the distance distance between the objects.", "http://docs.unity3d.com/ScriptReference/SpringJoint2D-frequency.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJoint2DEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJoint2DEditor.cs.meta deleted file mode 100644 index 7b6300b5..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJoint2DEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: d4b19f118a5c41a43b3069f11a4c8490 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJointEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJointEditor.cs deleted file mode 100644 index 445095ed..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJointEditor.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(SpringJoint), true)] - public class SpringJointEditor : JointEditor - { - protected override void RefreshFields() - { - base.RefreshFields(); - Type type = typeof(SpringJoint); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("damper"), - new DescriptorAttribute("Damper", "The damper force used to dampen the spring force.", "http://docs.unity3d.com/ScriptReference/SpringJoint-damper.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("spring"), - new DescriptorAttribute("Spring", "The spring force used to keep the two objects together.", "http://docs.unity3d.com/ScriptReference/SpringJoint-spring.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("minDistance"), - new DescriptorAttribute("Minimum Distance", "The minimum distance between the bodies relative to their initial distance.", "http://docs.unity3d.com/ScriptReference/SpringJoint-minDistance.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("maxDistance"), - new DescriptorAttribute("Maximum Distance", "The maximum distance between the bodies relative to their initial distance.", "http://docs.unity3d.com/ScriptReference/SpringJoint-maxDistance.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJointEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJointEditor.cs.meta deleted file mode 100644 index 89f200fd..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpringJointEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ef55a4c43739280438783fe3c0648c60 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpriteRendererEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpriteRendererEditor.cs deleted file mode 100644 index 6ee4f9ee..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpriteRendererEditor.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - //Under construction. Unity's editor has multiple internal method and classes used for this editor. - /*[CanEditMultipleObjects] - //[CustomEditor(typeof(SpriteRenderer), true)] - public class SpriteRendererEditor : RendererEditor - { - protected override void RefreshFields() - { - Type type = typeof(SpriteRenderer); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("subMeshCount"), - new DescriptorAttribute("Sub Mesh Count", "The number of submesh this mesh has."))); - } - - private void IsMaterialUsingFixedFunction(out bool vertex, out bool fragment) - { - vertex = false; - fragment = false; - Material sharedMaterial = (base.target as SpriteRenderer).sharedMaterial; - if (sharedMaterial != null) - { - vertex = ShaderUtil.GetVertexModel(sharedMaterial.shader) == ShaderUtil.ShaderModel.None; - fragment = ShaderUtil.GetFragmentModel(sharedMaterial.shader) == ShaderUtil.ShaderModel.None; - } - } - }*/ -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpriteRendererEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpriteRendererEditor.cs.meta deleted file mode 100644 index 23399f70..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SpriteRendererEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1e7e1c25afd649e429c7ebc946213e1b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes.meta deleted file mode 100644 index 65799e90..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 17d10043e438a1b4a957506dd467ac9d -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointAngleLimits2D.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointAngleLimits2D.cs deleted file mode 100644 index ee057444..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointAngleLimits2D.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(JointAngleLimits2D), true)] - public class JointAngleLimits2DEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(JointAngleLimits2D); - - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("min"), - new DescriptorAttribute("Lower Angle", "Lower angular limit of rotation.", "http://docs.unity3d.com/ScriptReference/JointAngleLimits2D-min.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("max"), - new DescriptorAttribute("Upper Angle", "Upper angular limit of rotation.", "http://docs.unity3d.com/ScriptReference/JointAngleLimits2D-max.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointAngleLimits2D.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointAngleLimits2D.cs.meta deleted file mode 100644 index da5932a3..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointAngleLimits2D.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1931b05fa3c73e043b6c0808c650582e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointDriveEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointDriveEditor.cs deleted file mode 100644 index 99b097d2..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointDriveEditor.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(JointDrive), true)] - public class JointDriveEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(JointDrive); - - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("maximumForce"), - new DescriptorAttribute("Maximum Force", "Amount of force applied to push the object toward the defined direction.", "http://docs.unity3d.com/ScriptReference/JointDrive-maximumForce.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("mode"), - new DescriptorAttribute("Mode", "Whether the drive should attempt to reach position, velocity, both or nothing.", "http://docs.unity3d.com/ScriptReference/JointDrive-mode.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("positionDamper"), - new DescriptorAttribute("Position Damper", "Resistance strength against the Position Spring. Only used if mode includes Position.", "http://docs.unity3d.com/ScriptReference/JointDrive-positionDamper.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("positionSpring"), - new DescriptorAttribute("Position Spring", "Strength of a rubber-band pull toward the defined direction. Only used if mode includes Position.", "http://docs.unity3d.com/ScriptReference/JointDrive-positionSpring.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointDriveEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointDriveEditor.cs.meta deleted file mode 100644 index b7aeab71..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointDriveEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ecf97e5de8d75dc48abf82579a240c2b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointLimitsEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointLimitsEditor.cs deleted file mode 100644 index 834679eb..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointLimitsEditor.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(JointLimits), true)] - public class JointLimitsEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(JointLimits); - - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("min"), - new DescriptorAttribute("Minimum", "The lower limit of the joint.", "http://docs.unity3d.com/ScriptReference/JointLimits-min.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("minBounce"), - new DescriptorAttribute("Minimum Bounce", "The bounciness of the joint when hitting the lower limit of the joint.", "http://docs.unity3d.com/ScriptReference/JointLimits-minBounce.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("max"), - new DescriptorAttribute("Maximum", "The upper limit of the joint.", "http://docs.unity3d.com/ScriptReference/JointLimits-max.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("maxBounce"), - new DescriptorAttribute("Maximum Bounce", "The bounciness of the joint when hitting the upper limit of the joint.", "http://docs.unity3d.com/ScriptReference/JointLimits-maxBounce.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointLimitsEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointLimitsEditor.cs.meta deleted file mode 100644 index 3a19c9c0..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointLimitsEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6604bae731e21cc428c2af5fe4345816 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotor2DEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotor2DEditor.cs deleted file mode 100644 index 7878455f..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotor2DEditor.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(JointMotor2D), true)] - public class JointMotor2DEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(JointMotor2D); - - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("maxMotorTorque"), - new DescriptorAttribute("Maximum Motor Torque", "The maximum force that can be applied to the Rigidbody2D at the joint to attain the target speed.", "http://docs.unity3d.com/ScriptReference/JointMotor2D-maxMotorTorque.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("motorSpeed"), - new DescriptorAttribute("Motor Speed", "The desired speed for the Rigidbody2D to reach as it moves with the joint.", "http://docs.unity3d.com/ScriptReference/JointMotor2D-motorSpeed.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotor2DEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotor2DEditor.cs.meta deleted file mode 100644 index 5cd76dec..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotor2DEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: df584c85589b426428f18a1db8819468 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotorEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotorEditor.cs deleted file mode 100644 index aa08051f..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotorEditor.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(JointMotor), true)] - public class JointMotorEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(JointMotor); - - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("force"), - new DescriptorAttribute("Force", "The motor will apply a force.", "http://docs.unity3d.com/ScriptReference/JointMotor-force.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("freeSpin"), - new DescriptorAttribute("Free Spin", "If freeSpin is enabled the motor will only accelerate but never slow down.", "http://docs.unity3d.com/ScriptReference/JointMotor-freeSpin.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("targetVelocity"), - new DescriptorAttribute("Target Velocity", "The motor will apply a force up to force to achieve targetVelocity.", "http://docs.unity3d.com/ScriptReference/JointMotor-targetVelocity.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotorEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotorEditor.cs.meta deleted file mode 100644 index 9d3377d6..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointMotorEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: edad1525ab08563449869286171570fe -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointSpringEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointSpringEditor.cs deleted file mode 100644 index 925489e4..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointSpringEditor.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(JointSpring), true)] - public class JointSpringEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(JointSpring); - - fields.Add(new InspectorField(parent, type, Instances, type.GetField("damper"), - new DescriptorAttribute("Damper", "The damper force uses to dampen the spring.", "http://docs.unity3d.com/ScriptReference/JointSpring-damper.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetField("spring"), - new DescriptorAttribute("Spring", "The spring forces used to reach the target position.", "http://docs.unity3d.com/ScriptReference/JointSpring-spring.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetField("targetPosition"), - new DescriptorAttribute("Target Position", "The target position the joint attempts to reach.", "http://docs.unity3d.com/ScriptReference/JointSpring-targetPosition.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointSpringEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointSpringEditor.cs.meta deleted file mode 100644 index 22e7faa5..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/JointSpringEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 78cd38f97873b494696f3b39efb6be6b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/SoftJointLimitEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/SoftJointLimitEditor.cs deleted file mode 100644 index 216b85ae..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/SoftJointLimitEditor.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(SoftJointLimit), true)] - public class SoftJointLimitEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(SoftJointLimit); - - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("bounciness"), - new DescriptorAttribute("Bounciness", "When the joint hits the limit, it can be made to bounce off it.", "http://docs.unity3d.com/ScriptReference/SoftJointLimit-bounciness.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("damper"), - new DescriptorAttribute("Damper", "If spring is greater than zero, the limit is soft.", "http://docs.unity3d.com/ScriptReference/SoftJointLimit-damper.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("limit"), - new DescriptorAttribute("Limit", "The limit position/angle of the joint.", "http://docs.unity3d.com/ScriptReference/SoftJointLimit-limit.html"))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("spring"), - new DescriptorAttribute("Spring", "If greater than zero, the limit is soft. The spring will pull the joint back.", "http://docs.unity3d.com/ScriptReference/SoftJointLimit-spring.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/SoftJointLimitEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/SoftJointLimitEditor.cs.meta deleted file mode 100644 index b87ed17f..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/SoftJointLimitEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 394fe629fc2ed3344b6393d22fd84d6e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/WheelFrictionCurveEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/WheelFrictionCurveEditor.cs deleted file mode 100644 index 7fefbdf9..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/WheelFrictionCurveEditor.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(WheelFrictionCurve), true)] - public class WheelFrictionCurveEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(WheelFrictionCurve); - - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("extremumSlip"), - new DescriptorAttribute("Extremum Slip", ""))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("extremumValue"), - new DescriptorAttribute("Extremum Value", ""))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("asymptoteSlip"), - new DescriptorAttribute("Asymptote Slip", ""))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("asymptoteValue"), - new DescriptorAttribute("Asymptote Value", ""))); - fields.Add(new InspectorField(parent, type, Instances, type.GetProperty("stiffness"), - new DescriptorAttribute("Stiffness", ""))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/WheelFrictionCurveEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/WheelFrictionCurveEditor.cs.meta deleted file mode 100644 index a0590680..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/SubTypes/WheelFrictionCurveEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 88effe38dc3d6ed46a367906af5bc842 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TerrainColliderEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TerrainColliderEditor.cs deleted file mode 100644 index d2c41a48..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TerrainColliderEditor.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(TerrainCollider), true)] - public class TerrainColliderEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(TerrainCollider); - if (Instances == null || Instances.Length == 0) - return; - - SerializedObject so = new SerializedObject(Instances.Cast().ToArray()); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("isTrigger"), - new DescriptorAttribute("Is Trigger", "Is the collider a trigger?", "http://docs.unity3d.com/ScriptReference/Collider-isTrigger.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("terrainData"), - new DescriptorAttribute("Terrain Data", "The terrain that stores the heightmap.", "http://docs.unity3d.com/ScriptReference/TerrainCollider-terrainData.html"))); - fields.Add(new InspectorField(type, Instances, so.FindProperty("m_EnableTreeColliders"), - new DescriptorAttribute("Create Tree Colliders", "", ""))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TerrainColliderEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TerrainColliderEditor.cs.meta deleted file mode 100644 index e6ff5f46..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TerrainColliderEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e47c360e7747b4840891bf1f1c1dbad4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TextMeshEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TextMeshEditor.cs deleted file mode 100644 index 3f955169..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TextMeshEditor.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(TextMesh), true)] - public class TextMeshEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(TextMesh); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("text"), new TextFieldAttribute(TextFieldType.Area), - new DescriptorAttribute("Text", "The text that is displayed.", "http://docs.unity3d.com/ScriptReference/TextMesh-text.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("font"), - new DescriptorAttribute("Font", "The Font used.", "http://docs.unity3d.com/ScriptReference/TextMesh-font.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("color"), - new DescriptorAttribute("Color", "The color used to render the text.", "http://docs.unity3d.com/ScriptReference/TextMesh-color.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("fontSize"), - new DescriptorAttribute("Font Size", "The font size to use (for dynamic fonts).", "http://docs.unity3d.com/ScriptReference/TextMesh-fontSize.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("characterSize"), - new DescriptorAttribute("Character Size", "The size of each character (This scales the whole text).", "http://docs.unity3d.com/ScriptReference/TextMesh-characterSize.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("tabSize"), - new DescriptorAttribute("Tab Size", "How much space will be inserted for a tab '\t' character. This is a multiplum of the 'spacebar' character offset.", "http://docs.unity3d.com/ScriptReference/TextMesh-tabSize.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("lineSpacing"), - new DescriptorAttribute("Line Spacing", "How much space will be in-between lines of text.", "http://docs.unity3d.com/ScriptReference/TextMesh-lineSpacing.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("offsetZ"), - new DescriptorAttribute("Z Offset", "How far should the text be offset from the transform.position.z when drawing.", "http://docs.unity3d.com/ScriptReference/TextMesh-offsetZ.html"))); - - - fields.Add(new InspectorField(type, Instances, type.GetProperty("fontStyle"), - new DescriptorAttribute("Font Style", "The font style to use (for dynamic fonts).", "http://docs.unity3d.com/ScriptReference/TextMesh-fontStyle.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("anchor"), - new DescriptorAttribute("Anchor", "Which point of the text shares the position of the Transform.", "http://docs.unity3d.com/ScriptReference/TextMesh-anchor.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("alignment"), - new DescriptorAttribute("Alignment", "How lines of text are aligned (Left, Right, Center).", "http://docs.unity3d.com/ScriptReference/TextMesh-alignment.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("richText"), - new DescriptorAttribute("Rich Text", "Enable HTML-style tags for Text Formatting Markup.", "http://docs.unity3d.com/ScriptReference/TextMesh-richText.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TextMeshEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TextMeshEditor.cs.meta deleted file mode 100644 index aee5baa7..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TextMeshEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1943876aa3c70a848aeadef8f6a6b46b -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TransformEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TransformEditor.cs deleted file mode 100644 index 3cea991f..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TransformEditor.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(Transform), true)] - public class TransformEditor : InspectorEditor - { - protected override void RefreshFields() - { - Type type = typeof(Transform); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("localPosition"), - new DescriptorAttribute("Position", "Position of the transform relative to the parent transform.", "http://docs.unity3d.com/ScriptReference/Transform-localPosition.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("localEulerAngles"), - new DescriptorAttribute("Rotation", "The rotation of the transform relative to the parent transform's rotation.", "http://docs.unity3d.com/ScriptReference/Transform-localRotation.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("localScale"), - new DescriptorAttribute("Scale", "The scale of the transform relative to the parent.", "http://docs.unity3d.com/ScriptReference/Transform-localScale.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("position"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("World Position", "The position of the transform in world space.", "http://docs.unity3d.com/ScriptReference/Transform-position.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("rotation"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("World Rotation", "The rotation of the transform in world space stored as a Quaternion.", "http://docs.unity3d.com/ScriptReference/Transform-rotation.html"))); - } - } -} diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TransformEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TransformEditor.cs.meta deleted file mode 100644 index 51386f31..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/TransformEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e4a8fde3da56bf6439cd4b5a39090868 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/WheelColliderEditor.cs b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/WheelColliderEditor.cs deleted file mode 100644 index dd84d871..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/WheelColliderEditor.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -using UnityEditor; -using UnityEngine; - -namespace AdvancedInspector -{ - [CanEditMultipleObjects] - [CustomEditor(typeof(WheelCollider), true)] - public class WheelColliderEditor : ColliderEditor - { - protected override void RefreshFields() - { - Type type = typeof(WheelCollider); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("mass"), - new DescriptorAttribute("Mass", "The mass of the wheel. Must be larger than zero.", "http://docs.unity3d.com/ScriptReference/WheelCollider-mass.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("radius"), - new DescriptorAttribute("Radius", "The radius of the wheel, measured in local space.", "http://docs.unity3d.com/ScriptReference/WheelCollider-radius.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("suspensionDistance"), - new DescriptorAttribute("Suspension Distance", "Maximum extension distance of wheel suspension, measured in local space.", "http://docs.unity3d.com/ScriptReference/WheelCollider-suspensionDistance.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("center"), - new DescriptorAttribute("Center", "The center of the wheel, measured in the object's local space.", "http://docs.unity3d.com/ScriptReference/WheelCollider-center.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("suspensionSpring"), new BypassAttribute(), - new DescriptorAttribute("Suspension Spring", "The parameters of wheel's suspension. The suspension attempts to reach a target position.", "http://docs.unity3d.com/ScriptReference/WheelCollider-suspensionSpring.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("forwardFriction"), - new DescriptorAttribute("Forward Friction", "Properties of tire friction in the direction the wheel is pointing in.", "http://docs.unity3d.com/ScriptReference/WheelCollider-forwardFriction.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("sidewaysFriction"), - new DescriptorAttribute("Sideways Friction", "Properties of tire friction in the sideways direction.", "http://docs.unity3d.com/ScriptReference/WheelCollider-sidewaysFriction.html"))); - - fields.Add(new InspectorField(type, Instances, type.GetProperty("brakeTorque"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Brake Torque", "Brake torque. Must be positive.", "http://docs.unity3d.com/ScriptReference/WheelCollider-brakeTorque.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("motorTorque"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Motor Torque", "Motor torque on the wheel axle. Positive or negative depending on direction.", "http://docs.unity3d.com/ScriptReference/WheelCollider-motorTorque.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("steerAngle"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Steer Angle", "Steering angle in degrees, always around the local y-axis.", "http://docs.unity3d.com/ScriptReference/WheelCollider-steerAngle.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("isGrounded"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("Is Grounded", "Indicates whether the wheel currently collides with something (Read Only).", "http://docs.unity3d.com/ScriptReference/WheelCollider-isGrounded.html"))); - fields.Add(new InspectorField(type, Instances, type.GetProperty("rpm"), new InspectAttribute(InspectorLevel.Advanced), - new DescriptorAttribute("RPM", "Current wheel axle rotation speed, in rotations per minute (Read Only).", "http://docs.unity3d.com/ScriptReference/WheelCollider-rpm.html"))); - } - } -} \ No newline at end of file diff --git a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/WheelColliderEditor.cs.meta b/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/WheelColliderEditor.cs.meta deleted file mode 100644 index 1d401583..00000000 --- a/Assets/Plugins/Editor/AdvancedInspector/UnityTypes/WheelColliderEditor.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b26718886a14c964687ac19bab859614 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: diff --git a/Assets/Plugins/Sirenix.meta b/Assets/Plugins/Sirenix.meta new file mode 100644 index 00000000..2df0335d --- /dev/null +++ b/Assets/Plugins/Sirenix.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 35a721eae1cdbe647a086ad29a339fef +folderAsset: yes +timeCreated: 1602083738 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies.meta b/Assets/Plugins/Sirenix/Assemblies.meta new file mode 100644 index 00000000..3b192a8b --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0892af58ca441f64dba2d7af03deb4c9 +folderAsset: yes +timeCreated: 1602083738 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEditor.meta b/Assets/Plugins/Sirenix/Assemblies/NoEditor.meta new file mode 100644 index 00000000..7be46aed --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/NoEditor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 47257c77491e24c4f8887864ee0857f0 +folderAsset: yes +timeCreated: 1602083739 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll new file mode 100644 index 00000000..6cf1beb8 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll differ diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.mdb b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.mdb new file mode 100644 index 00000000..2b7dae5c Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.mdb differ diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.mdb.meta b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.mdb.meta new file mode 100644 index 00000000..01078e16 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.mdb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a109720b9bced384983c295af8f2d8be +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.meta b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.meta new file mode 100644 index 00000000..0d9d671a --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Serialization.dll.meta @@ -0,0 +1,77 @@ +fileFormatVersion: 2 +guid: 5651992cdad94894a3af7dc3f1da9170 +timeCreated: 1488812592 +licenseType: Store +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: {} + Any: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude N3DS: 1 + Exclude OSXIntel: 0 + Exclude OSXIntel64: 0 + Exclude OSXUniversal: 0 + Exclude PS4: 1 + Exclude PSM: 1 + Exclude PSP2: 1 + Exclude SamsungTV: 1 + Exclude Tizen: 1 + Exclude WebGL: 1 + Exclude WiiU: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 1 + Exclude XboxOne: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + Linux: + enabled: 1 + settings: {} + Linux64: + enabled: 1 + settings: {} + LinuxUniversal: + enabled: 1 + settings: {} + OSXIntel: + enabled: 1 + settings: {} + OSXIntel64: + enabled: 1 + settings: {} + OSXUniversal: + enabled: 1 + settings: {} + PSM: + enabled: 0 + settings: {} + Win: + enabled: 1 + settings: {} + Win64: + enabled: 1 + settings: {} + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll new file mode 100644 index 00000000..62019c8c Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll differ diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.mdb b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.mdb new file mode 100644 index 00000000..75589693 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.mdb differ diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.mdb.meta b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.mdb.meta new file mode 100644 index 00000000..09816f94 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.mdb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4798b50943540674186f5325666dcb56 +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.meta b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.meta new file mode 100644 index 00000000..5c65cc4f --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll.meta @@ -0,0 +1,77 @@ +fileFormatVersion: 2 +guid: 5978f8f3dd274e848fbb7a123bde1fb9 +timeCreated: 1488812592 +licenseType: Store +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: {} + Any: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude N3DS: 1 + Exclude OSXIntel: 0 + Exclude OSXIntel64: 0 + Exclude OSXUniversal: 0 + Exclude PS4: 1 + Exclude PSM: 1 + Exclude PSP2: 1 + Exclude SamsungTV: 1 + Exclude Tizen: 1 + Exclude WebGL: 1 + Exclude WiiU: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 1 + Exclude XboxOne: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + Linux: + enabled: 1 + settings: {} + Linux64: + enabled: 1 + settings: {} + LinuxUniversal: + enabled: 1 + settings: {} + OSXIntel: + enabled: 1 + settings: {} + OSXIntel64: + enabled: 1 + settings: {} + OSXUniversal: + enabled: 1 + settings: {} + PSM: + enabled: 0 + settings: {} + Win: + enabled: 1 + settings: {} + Win64: + enabled: 1 + settings: {} + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor.meta b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor.meta new file mode 100644 index 00000000..08a7801f --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 92ca8146ddb5c874b9b1dc1d4564b779 +folderAsset: yes +timeCreated: 1602083739 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll new file mode 100644 index 00000000..52deedf1 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll differ diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.mdb b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.mdb new file mode 100644 index 00000000..c7b74db0 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.mdb differ diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.mdb.meta b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.mdb.meta new file mode 100644 index 00000000..96e83b2c --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.mdb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c47166d94b40f3c40963bbe3a6cdbc17 +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.meta b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.meta new file mode 100644 index 00000000..848dcfae --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Serialization.dll.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: d2a8f0021d6b47c5923d8972dfb81ef1 +timeCreated: 1488812607 +licenseType: Store +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude N3DS: 0 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude PS4: 0 + Exclude PSM: 0 + Exclude PSP2: 0 + Exclude SamsungTV: 0 + Exclude Tizen: 0 + Exclude WebGL: 0 + Exclude WiiU: 0 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 0 + Exclude XboxOne: 0 + Exclude iOS: 0 + Exclude tvOS: 0 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + N3DS: + enabled: 1 + settings: {} + PS4: + enabled: 1 + settings: {} + PSM: + enabled: 1 + settings: {} + PSP2: + enabled: 1 + settings: {} + SamsungTV: + enabled: 1 + settings: {} + Tizen: + enabled: 1 + settings: {} + WebGL: + enabled: 1 + settings: {} + WiiU: + enabled: 1 + settings: {} + WindowsStoreApps: + enabled: 1 + settings: + CPU: AnyCPU + XboxOne: + enabled: 1 + settings: {} + iOS: + enabled: 1 + settings: {} + tvOS: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll new file mode 100644 index 00000000..2739f392 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll differ diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.mdb b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.mdb new file mode 100644 index 00000000..5941d7a6 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.mdb differ diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.mdb.meta b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.mdb.meta new file mode 100644 index 00000000..de668149 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.mdb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4de1d92b7b397d047b7eb6286945de34 +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.meta b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.meta new file mode 100644 index 00000000..faddf400 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/NoEmitAndNoEditor/Sirenix.Utilities.dll.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: 1e0a9643dc0d4b46bf2321f72c4e503e +timeCreated: 1488812607 +licenseType: Store +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude N3DS: 0 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude PS4: 0 + Exclude PSM: 0 + Exclude PSP2: 0 + Exclude SamsungTV: 0 + Exclude Tizen: 0 + Exclude WebGL: 0 + Exclude WiiU: 0 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 0 + Exclude XboxOne: 0 + Exclude iOS: 0 + Exclude tvOS: 0 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + N3DS: + enabled: 1 + settings: {} + PS4: + enabled: 1 + settings: {} + PSM: + enabled: 1 + settings: {} + PSP2: + enabled: 1 + settings: {} + SamsungTV: + enabled: 1 + settings: {} + Tizen: + enabled: 1 + settings: {} + WebGL: + enabled: 1 + settings: {} + WiiU: + enabled: 1 + settings: {} + WindowsStoreApps: + enabled: 1 + settings: + CPU: AnyCPU + XboxOne: + enabled: 1 + settings: {} + iOS: + enabled: 1 + settings: {} + tvOS: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll new file mode 100644 index 00000000..8a91a627 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.mdb b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.mdb new file mode 100644 index 00000000..5c2fecae Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.mdb differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.mdb.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.mdb.meta new file mode 100644 index 00000000..a45914f3 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.mdb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5373690f61076fb489d97d47b07623f8 +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.meta new file mode 100644 index 00000000..d5dde765 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.dll.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 47a84ebde4ec47fabb620b30cc7a3e5c +timeCreated: 1488812560 +licenseType: Store +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 1 + settings: + Exclude Android: 0 + Exclude Editor: 0 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude N3DS: 0 + Exclude OSXIntel: 0 + Exclude OSXIntel64: 0 + Exclude OSXUniversal: 0 + Exclude PS4: 0 + Exclude PSM: 0 + Exclude PSP2: 0 + Exclude SamsungTV: 0 + Exclude Tizen: 0 + Exclude WebGL: 0 + Exclude WiiU: 0 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 0 + Exclude XboxOne: 0 + Exclude iOS: 0 + Exclude tvOS: 0 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml new file mode 100644 index 00000000..9d0fd38f --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml @@ -0,0 +1,5690 @@ + + + + Sirenix.OdinInspector.Attributes + + + + + AssetLists is used on lists and arrays and single elements of unity types, and replaces the default list drawer with a list of all possible assets with the specified filter. + Use this to both filter and include or exclude assets from a list or an array, without navigating the project window. + + + Asset lists works on all asset types such as materials, scriptable objects, prefabs, custom components, audio, textures etc, and does also show inherited types. + + + The following example will display an asset list of all prefabs located in the project window. + + public class AssetListExamples : MonoBehaviour + { + [InfoBox("The AssetList attribute work on both lists of UnityEngine.Object types and UnityEngine.Object types, but have different behaviour.")] + [AssetList] + [InlineEditor(InlineEditorModes.LargePreview)] + public GameObject Prefab; + + [AssetList] + public List<PlaceableObject> PlaceableObjects; + + [AssetList(Path = "Plugins/Sirenix/")] + [InlineEditor(InlineEditorModes.LargePreview)] + public UnityEngine.Object Object; + + [AssetList(AutoPopulate = true)] + public List<PlaceableObject> PlaceableObjectsAutoPopulated; + + [AssetList(LayerNames = "MyLayerName")] + public GameObject[] AllPrefabsWithLayerName; + + [AssetList(AssetNamePrefix = "Rock")] + public List<GameObject> PrefabsStartingWithRock; + + [AssetList(Path = "/Plugins/Sirenix/")] + public List<GameObject> AllPrefabsLocatedInFolder; + + [AssetList(Tags = "MyTagA, MyTabB", Path = "/Plugins/Sirenix/")] + public List<GameObject> GameObjectsWithTag; + + [AssetList(Path = "/Plugins/Sirenix/")] + public List<Material> AllMaterialsInSirenix; + + [AssetList(Path = "/Plugins/Sirenix/")] + public List<ScriptableObject> AllScriptableObjects; + + [InfoBox("Use a method as a custom filter for the asset list.")] + [AssetList(CustomFilterMethod = "HasRigidbodyComponent")] + public List<GameObject> MyRigidbodyPrefabs; + + private bool HasRigidbodyComponent(GameObject obj) + { + return obj.GetComponent<Rigidbody>() != null; + } + } + + + + + + If true, all assets found and displayed by the asset list, will automatically be added to the list when inspected. + + + + + Comma separated list of tags to filter the asset list. + + + + + Filter the asset list to only include assets with a specified layer. + + + + + Filter the asset list to only include assets which name begins with. + + + + + Filter the asset list to only include assets which is located at the specified path. + + + + + Filter the asset list to only include assets for which the given filter method returns true. + + + + + Initializes a new instance of the class. + + + + + The AssetSelector attribute can be used on all Unity types and will prepend a small button next to the object field that when clicked, + will present the user with a dropdown of assets to select from which can be customized from the attribute. + + + + + True by default. + + + + + True by default. If the ValueDropdown attribute is applied to a list, then disabling this, + will render all child elements normally without using the ValueDropdown. The ValueDropdown will + still show up when you click the add button on the list drawer, unless is true. + + + + + False by default. + + + + + If the ValueDropdown attribute is applied to a list, and is set to true, then enabling this, + will exclude existing values, instead of rendering a checkbox indicating whether the item is already included or not. + + + + + If the dropdown renders a tree-view, then setting this to true will ensure everything is expanded by default. + + + + + By default, the dropdown will create a tree view. + + + + + Gets or sets the width of the dropdown. Default is zero. + + + + + Gets or sets the height of the dropdown. Default is zero. + + + + + Gets or sets the title for the dropdown. Null by default. + + + + + Specify which folders to search in. Specifying no folders will make it search in your entire project. + Use the property for a more clean way of populating this array through attributes. + + + + + The filters we should use when calling AssetDatabase.FindAssets. + + + + + + Specify which folders to search in. Specifying no folders will make it search in your entire project. + You can decalir multiple paths using '|' as the seperator. + Example: [AssetList(Paths = "Assets/Textures|Assets/Other/Textures")] + + + This property is simply a more clean way of populating the array. + + + + + + AssetsOnly is used on object properties, and restricts the property to project assets, and not scene objects. + Use this when you want to ensure an object is from the project, and not from the scene. + + + The following example shows a component with a game object property, that must be a prefab from the project, and not a scene object. + + public MyComponent : MonoBehaviour + { + [AssetsOnly] + public GameObject MyPrefab; + } + + + + + + + BoxGroup is used on any property and organizes the property in a boxed group. + Use this to cleanly organize relevant values together in the inspector. + + + The following example shows how BoxGroup is used to organize properties together into a box. + + public class BoxGroupExamples : MonoBehaviour + { + // Box with a centered title. + [BoxGroup("Centered Title", centerLabel: true)] + public int A; + + [BoxGroup("Centered Title", centerLabel: true)] + public int B; + + [BoxGroup("Centered Title", centerLabel: true)] + public int C; + + // Box with a title. + [BoxGroup("Left Oriented Title")] + public int D; + + [BoxGroup("Left Oriented Title")] + public int E; + + // Box with a title recieved from a field. + [BoxGroup("$DynamicTitle1"), LabelText("Dynamic Title")] + public string DynamicTitle1 = "Dynamic box title"; + + [BoxGroup("$DynamicTitle1")] + public int F; + + // Box with a title recieved from a property. + [BoxGroup("$DynamicTitle2")] + public int G; + + [BoxGroup("$DynamicTitle2")] + public int H; + + // Box without a title. + [InfoBox("You can also hide the label of a box group.")] + [BoxGroup("NoTitle", false)] + public int I; + + [BoxGroup("NoTitle")] + public int J; + + [BoxGroup("NoTitle")] + public int K; + + #if UNITY_EDITOR + public string DynamicTitle2 + { + get { return UnityEditor.PlayerSettings.productName; } + } + #endif + + [BoxGroup("Boxed Struct"), HideLabel] + public SomeStruct BoxedStruct; + + public SomeStruct DefaultStruct; + + [Serializable] + public struct SomeStruct + { + public int One; + public int Two; + public int Three; + } + } + + + + + + + + + + + If true a label for the group will be drawn on top. + + + + + If true the header label will be places in the center of the group header. Otherwise it will be in left side. + + + + + If non-null, this is used instead of the group's name as the title label. + + + + + Adds the property to the specified box group. + + The box group. + If true a label will be drawn for the group. + If set to true the header label will be centered. + The order of the group in the inspector. + + + + Initializes a new instance of the class. Use the other constructor overloads in order to show a header-label on the box group. + + + + + Combines the box group with another group. + + The other group. + + + + Buttons are used on functions, and allows for clickable buttons in the inspector. + + + The following example shows a component that has an initialize method, that can be called from the inspector. + + public class MyComponent : MonoBehaviour + { + [Button] + private void Init() + { + // ... + } + } + + + + The following example show how a Button could be used to test a function. + + public class MyBot : MonoBehaviour + { + [Button] + private void Jump() + { + // ... + } + } + + + + The following example show how a Button can named differently than the function it's been attached to. + + public class MyComponent : MonoBehaviour + { + [Button("Function")] + private void MyFunction() + { + // ... + } + } + + + + + + + + Gets the height of the button. If it's zero or below then use default. + + + + + Use this to override the label on the button. + + + + + The style in which to draw the button. + + + + + If the button contains parameters, you can disable the foldout it creates by setting this to true. + + + + + Whether to display the button method's parameters (if any) as values in the inspector. True by default. + If this is set to false, the button method will instead be invoked through an ActionResolver or ValueResolver (based on whether it returns a value), giving access to contextual named parameter values like "InspectorProperty property" that can be passed to the button method. + + + + + If the button has a return type, set this to false to not draw the result. Default value is true. + + + + + Creates a button in the inspector named after the method. + + + + + Creates a button in the inspector named after the method. + + The size of the button. + + + + Creates a button in the inspector named after the method. + + The size of the button. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + Size of the button. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + Size of the button in pixels. + + + + Creates a button in the inspector named after the method. + + Button style for methods with parameters. + + + + Creates a button in the inspector named after the method. + + The size of the button. + Button style for methods with parameters. + + + + Creates a button in the inspector named after the method. + + The size of the button. + Button style for methods with parameters. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + Button style for methods with parameters. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + Size of the button. + Button style for methods with parameters. + + + + Creates a button in the inspector with a custom name. + + Custom name for the button. + Size of the button in pixels. + Button style for methods with parameters. + + + + ButtonGroup is used on any instance function, and adds buttons to the inspector organized into horizontal groups. + Use this to organize multiple button in a tidy horizontal group. + + + The following example shows how ButtonGroup is used to organize two buttons into one group. + + public class MyComponent : MonoBehaviour + { + [ButtonGroup("MyGroup")] + private void A() + { + // .. + } + + [ButtonGroup("MyGroup")] + private void B() + { + // .. + } + } + + + + The following example shows how ButtonGroup can be used to create multiple groups of buttons. + + public class MyComponent : MonoBehaviour + { + [ButtonGroup("First")] + private void A() + { } + + [ButtonGroup("First")] + private void B() + { } + + [ButtonGroup("")] + private void One() + { } + + [ButtonGroup("")] + private void Two() + { } + + [ButtonGroup("")] + private void Three() + { } + } + + + + + + + + + + + + + Organizes the button into the specified button group. + + The group to organize the button into. + The order of the group in the inspector.. + + + + Button style for methods with parameters. + + + + + Draws a foldout box around the parameters of the method with the button on the box header itself. + This is the default style of a method with parameters. + + + + + Draws a button with a foldout to expose the parameters of the method. + + + + + Draws a foldout box around the parameters of the method with the button at the bottom of the box. + + + + + The ChildGameObjectsOnly attribute can be used on Components and GameObject fields and will prepend a small button next to the object-field that + will search through all child gameobjects for assignable objects and present them in a dropdown for the user to choose from. + + + + + + Instead of making a new attribute, and a new drawer, for a one-time thing, you can with this attribute, make a method that acts as a custom property drawer. + These drawers will out of the box have support for undo/redo and multi-selection. + + + Usage: + + public class CustomDrawerExamples : MonoBehaviour + { + public float From = 2, To = 7; + + [CustomValueDrawer("MyStaticCustomDrawerStatic")] + public float CustomDrawerStatic; + + [CustomValueDrawer("MyStaticCustomDrawerInstance")] + public float CustomDrawerInstance; + + [CustomValueDrawer("MyStaticCustomDrawerArray")] + public float[] CustomDrawerArray; + + #if UNITY_EDITOR + + private static float MyStaticCustomDrawerStatic(float value, GUIContent label) + { + return EditorGUILayout.Slider(value, 0f, 10f); + } + + private float MyStaticCustomDrawerInstance(float value, GUIContent label) + { + return EditorGUILayout.Slider(value, this.From, this.To); + } + + private float MyStaticCustomDrawerArray(float value, GUIContent label) + { + return EditorGUILayout.Slider(value, this.From, this.To); + } + + #endif + } + + + + + + Name of the custom drawer method. Obsolete; use the Action member instead. + + + + + A resolved string that defines the custom drawer action to take, such as an expression or method invocation. + + + + + Instead of making a new attribute, and a new drawer, for a one-time thing, you can with this attribute, make a method that acts as a custom property drawer. + These drawers will out of the box have support for undo/redo and multi-selection. + + A resolved string that defines the custom drawer action to take, such as an expression or method invocation. + + + + Disables a property if it is drawn within an . + + + + + Disables a property if it is drawn from a non-prefab asset or instance. + + + + + Disables a property if it is drawn from a prefab asset. + + + + + Disables a property if it is drawn from a prefab instance. + + + + + Disables a property if it is drawn from a prefab asset or a prefab instance. + + + + + Indicates that the member should not be drawn as a value reference, if it becomes a reference to another value in the tree. Beware, and use with care! This may lead to infinite draw loops! + + + + + An attribute that enables GUI. + + + + public class InlineEditorExamples : MonoBehaviour + { + [EnableGUI] + public string SomeReadonlyProperty { get { return "My GUI is usually disabled." } } + } + + + + + + + Draws an enum selector in the inspector with next and previous buttons to let you cycle through the available values for the enum property. + + + + public enum MyEnum + { + One, + Two, + Three, + } + + public class MyMonoBehaviour : MonoBehaviour + { + [EnumPaging] + public MyEnum Value; + } + + + + + + + FilePath is used on string properties, and provides an interface for file paths. + + + The following example demonstrates how FilePath is used. + + public class FilePathExamples : MonoBehaviour + { + // By default, FilePath provides a path relative to the Unity project. + [FilePath] + public string UnityProjectPath; + + // It is possible to provide custom parent path. Parent paths can be relative to the Unity project, or absolute. + [FilePath(ParentFolder = "Assets/Plugins/Sirenix")] + public string RelativeToParentPath; + + // Using parent path, FilePath can also provide a path relative to a resources folder. + [FilePath(ParentFolder = "Assets/Resources")] + public string ResourcePath; + + // Provide a comma seperated list of allowed extensions. Dots are optional. + [FilePath(Extensions = "cs")] + public string ScriptFiles; + + // By setting AbsolutePath to true, the FilePath will provide an absolute path instead. + [FilePath(AbsolutePath = true)] + [BoxGroup("Conditions")] + public string AbsolutePath; + + // FilePath can also be configured to show an error, if the provided path is invalid. + [FilePath(RequireValidPath = true)] + public string ValidPath; + + // By default, FilePath will enforce the use of forward slashes. It can also be configured to use backslashes instead. + [FilePath(UseBackslashes = true)] + public string Backslashes; + + // FilePath also supports member references with the $ symbol. + [FilePath(ParentFolder = "$DynamicParent", Extensions = "$DynamicExtensions")] + public string DynamicFilePath; + + public string DynamicParent = "Assets/Plugin/Sirenix"; + + public string DynamicExtensions = "cs, unity, jpg"; + } + + + + + + + + If true the FilePath will provide an absolute path, instead of a relative one. + + + + + Comma separated list of allowed file extensions. Dots are optional. + Supports member referencing with $. + + + + + ParentFolder provides an override for where the path is relative to. ParentFolder can be relative to the Unity project, or an absolute path. + Supports member referencing with $. + + + + + If true an error will be displayed for invalid, or missing paths. + + + + + If true an error will be displayed for non-existing paths. + + + + + By default FilePath enforces forward slashes. Set UseBackslashes to true if you want backslashes instead. + + + + + Gets or sets a value indicating whether the path should be read only. + + + + + FolderPath is used on string properties, and provides an interface for directory paths. + + + The following example demonstrates how FolderPath is used. + + public class FolderPathExamples : MonoBehaviour + { + // By default, FolderPath provides a path relative to the Unity project. + [FolderPath] + public string UnityProjectPath; + + // It is possible to provide custom parent patn. ParentFolder paths can be relative to the Unity project, or absolute. + [FolderPath(ParentFolder = "Assets/Plugins/Sirenix")] + public string RelativeToParentPath; + + // Using ParentFolder, FolderPath can also provide a path relative to a resources folder. + [FolderPath(ParentFolder = "Assets/Resources")] + public string ResourcePath; + + // By setting AbsolutePath to true, the FolderPath will provide an absolute path instead. + [FolderPath(AbsolutePath = true)] + public string AbsolutePath; + + // FolderPath can also be configured to show an error, if the provided path is invalid. + [FolderPath(RequireValidPath = true)] + public string ValidPath; + + // By default, FolderPath will enforce the use of forward slashes. It can also be configured to use backslashes instead. + [FolderPath(UseBackslashes = true)] + public string Backslashes; + + // FolderPath also supports member references with the $ symbol. + [FolderPath(ParentFolder = "$DynamicParent")] + public string DynamicFolderPath; + + public string DynamicParent = "Assets/Plugins/Sirenix"; + } + + + + + + + + If true the FolderPath will provide an absolute path, instead of a relative one. + + + + + ParentFolder provides an override for where the path is relative to. ParentFolder can be relative to the Unity project, or an absolute path. + Supports member referencing with $. + + + + + If true an error will be displayed for invalid, or missing paths. + + + + + If true an error will be displayed for non-existing paths. + + + + + By default FolderPath enforces forward slashes. Set UseBackslashes to true if you want backslashes instead. + + + + + Indicates that Odin should hide the reference box, if this property would otherwise be drawn as a reference to another property, due to duplicate reference values being encountered. + Note that if the value is referencing itself recursively, then the reference box will be drawn regardless of this attribute in all recursive draw calls. + + + + +

HideIfGroup allows for showing or hiding a group of properties based on a condition.

+

The attribute is a group attribute and can therefore be combined with other group attributes, and even be used to show or hide entire groups.

+

Note that in the vast majority of cases where you simply want to be able to control the visibility of a single group, it is better to use the VisibleIf parameter that *all* group attributes have.

+
+ + + + + +
+ + + Whether or not to visually animate group visibility changes. + + + + + The optional member value. + + + + + Name of member to use when to hide the group. Defaults to the name of the group, by can be overriden by setting this property. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + Makes a group that can be shown or hidden based on a condition. + + The group path. + If true then a fade animation will be played when the group is hidden or shown. + + + + Makes a group that can be shown or hidden based on a condition. + + The group path. + The value the member should equal for the property to shown. + If true then a fade animation will be played when the group is hidden or shown. + + + + Combines HideIfGroup attributes. + + Another ShowIfGroup attribute. + + + + Hides a property if it is drawn within an . + + + + + Hides a property if it is drawn from a non prefab instance or asset. + + + + + Hides a property if it is drawn from a prefab asset. + + + + + Hides a property if it is drawn from a prefab instance. + + + + + Hides a property if it is drawn from a prefab instance or a prefab asset. + + + + + The HideInTables attribute is used to prevent members from showing up as columns in tables drawn using the . + + + + + Apply HideNetworkBehaviourFields to your class to prevent the special "Network Channel" and "Network Send Interval" properties from being shown in the inspector for a NetworkBehaviour. + This attribute has no effect on classes that are not derived from NetworkBehaviour. + + + The following example shows how to use this attribute. + + [HideNetworkBehaviourFields] + public class MyComponent : NetworkBehaviour + { + // The "Network Channel" and "Network Send Interval" properties will not be shown for this component in the inspector + } + + + + + + + The Inline Property is used to place the contents of a type next to the label, instead of being rendered in a foldout. + + + + public class InlinePropertyExamples : MonoBehaviour + { + public Vector3 Vector3; + + public Vector3Int Vector3Int; + + [InlineProperty(LabelWidth = 12)] // It can be placed on classes as well as members + public Vector2Int Vector2Int; + + } + + [Serializable] + [InlineProperty(LabelWidth = 12)] // It can be placed on classes as well as members + public struct Vector3Int + { + [HorizontalGroup] + public int X; + + [HorizontalGroup] + public int Y; + + [HorizontalGroup] + public int Z; + } + + [Serializable] + public struct Vector2Int + { + [HorizontalGroup] + public int X; + + [HorizontalGroup] + public int Y; + } + + + + + + + Specify a label width for all child properties. + + + + + LabelWidth is used to change the width of labels for properties. + + + The following example shows how LabelText is applied to a few property fields. + + public MyComponent : MonoBehaviour + { + [LabelWidth("3")] + public int MyInt3; + } + + + + + + + The new text of the label. + + + + + Give a property a custom label. + + The width of the label. + + + + + OnCollectionChanged can be put on collections, and provides an event callback when the collection is about to be changed through the inspector, + and when the collection has been changed through the inspector. Additionally, it provides a CollectionChangeInfo struct containing information + about the exact changes made to the collection. This attribute works for all collections with a collection resolver, amongst them arrays, lists, + dictionaries, hashsets, stacks and linked lists. + + + + Note that this attribute only works in the editor! Collections changed by script will not trigger change events! + + + The following example shows how OnCollectionChanged can be used to get callbacks when a collection is being changed. + + [OnCollectionChanged("Before", "After")] + public List<string> list; + + public void Before(CollectionChangeInfo info) + { + if (info.ChangeType == CollectionChangeType.Add || info.ChangeType == CollectionChangeType.Insert) + { + Debug.Log("Adding to the list!"); + } + else if (info.ChangeType == CollectionChangeType.RemoveIndex || info.ChangeType == CollectionChangeType.RemoveValue) + { + Debug.Log("Removing from the list!"); + } + } + + public void After(CollectionChangeInfo info) + { + if (info.ChangeType == CollectionChangeType.Add || info.ChangeType == CollectionChangeType.Insert) + { + Debug.Log("Finished adding to the list!"); + } + else if (info.ChangeType == CollectionChangeType.RemoveIndex || info.ChangeType == CollectionChangeType.RemoveValue) + { + Debug.Log("Finished removing from the list!"); + } + } + + + + + + The OnInspectorDispose attribute takes in an action string as an argument (typically the name of a method to be invoked, or an expression to be executed), and executes that action when the property's drawers are disposed in the inspector. + Disposing will happen at least once, when the inspector changes selection or the property tree is collected by the garbage collector, but may also happen several times before that, most often when the type of a polymorphic property changes and it refreshes its drawer setup and recreates all its children, disposing of the old setup and children. + + + The following example demonstrates how OnInspectorDispose works. + + public class MyComponent : MonoBehaviour + { + [OnInspectorDispose(@"@UnityEngine.Debug.Log(""Dispose event invoked!"")")] + [ShowInInspector, InfoBox("When you change the type of this field, or set it to null, the former property setup is disposed. The property setup will also be disposed when you deselect this example."), DisplayAsString] + public BaseClass PolymorphicField; + + public abstract class BaseClass { public override string ToString() { return this.GetType().Name; } } + public class A : BaseClass { } + public class B : BaseClass { } + public class C : BaseClass { } + } + + + + + + This constructor should be used when the attribute is placed directly on a method. + + + + + This constructor should be used when the attribute is placed on a non-method member. + + + + + The OnInspectorInit attribute takes in an action string as an argument (typically the name of a method to be invoked, or an expression to be executed), and executes that action when the property's drawers are initialized in the inspector. + Initialization will happen at least once during the first drawn frame of any given property, but may also happen several times later, most often when the type of a polymorphic property changes and it refreshes its drawer setup and recreates all its children. + + + The following example demonstrates how OnInspectorInit works. + + public class MyComponent : MonoBehaviour + { + // Display current time for reference. + [ShowInInspector, DisplayAsString, PropertyOrder(-1)] + public string CurrentTime { get { GUIHelper.RequestRepaint(); return DateTime.Now.ToString(); } } + + // OnInspectorInit executes the first time this string is about to be drawn in the inspector. + // It will execute again when the example is reselected. + [OnInspectorInit("@TimeWhenExampleWasOpened = DateTime.Now.ToString()")] + public string TimeWhenExampleWasOpened; + + // OnInspectorInit will not execute before the property is actually "resolved" in the inspector. + // Remember, Odin's property system is lazily evaluated, and so a property does not actually exist + // and is not initialized before something is actually asking for it. + // + // Therefore, this OnInspectorInit attribute won't execute until the foldout is expanded. + [FoldoutGroup("Delayed Initialization", Expanded = false, HideWhenChildrenAreInvisible = false)] + [OnInspectorInit("@TimeFoldoutWasOpened = DateTime.Now.ToString()")] + public string TimeFoldoutWasOpened; + } + + + + + + This constructor should be used when the attribute is placed directly on a method. + + + + + This constructor should be used when the attribute is placed on a non-method member. + + + + + + OnStateUpdate provides an event callback when the property's state should be updated, when the StateUpdaters run on the property instance. + This generally happens at least once per frame, and the callback will be invoked even when the property is not visible. This can be used to + approximate custom StateUpdaters like [ShowIf] without needing to make entire attributes and StateUpdaters for one-off cases. + + + + The following example shows how OnStateUpdate can be used to control the visible state of a property. + + public class MyComponent : MonoBehaviour + { + [OnStateUpdate("@$property.State.Visible = ToggleMyInt")] + public int MyInt; + + public bool ToggleMyInt; + } + + + + The following example shows how OnStateUpdate can be used to control the expanded state of a list. + + public class MyComponent : MonoBehaviour + { + [OnStateUpdate("@$property.State.Expanded = ExpandList")] + public List<string> list; + + public bool ExpandList; + } + + The following example shows how OnStateUpdate can be used to control the state of another property. + + public class MyComponent : MonoBehaviour + { + public List>string< list; + + [OnStateUpdate("@#(list).State.Expanded = $value")] + public bool ExpandList; + } + + + + + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + + These object fields can also be selectively enabled and customized globally from the Odin preferences window. + + + + The following example shows how PreviewField is applied to a few property fields. + + public MyComponent : MonoBehaviour + { + [PreviewField] + public UnityEngine.Object SomeObject; + + [PreviewField] + public Texture SomeTexture; + + [HorizontalGroup, HideLabel, PreviewField(30)] + public Material A, B, C, D, F; + } + + + + + + + The height of the object field + + + + + Left aligned. + + + + + Whether an alignment value is specified. + + + + + Draws a square object field which renders a preview for UnityEngine.Object type objects. + + + + + Draws a square object field which renders a preview for UnityEngine.Object type objects. + + The height of the preview field. + + + + Draws a square object field which renders a preview for UnityEngine.Object type objects. + + The height of the preview field. + The alignment of the preview field. + + + + Draws a square object field which renders a preview for UnityEngine.Object type objects. + + The alignment of the preview field. + + + + Draws a horizontal progress bar based on the value of the property. + Use it for displaying a meter to indicate how full an inventory is, or to make a visual indication of a health bar. + + + The following example shows how ProgressBar can be used. + + public class ProgressBarExample : MonoBehaviour + { + // Default progress bar. + [ProgressBar(0, 100)] + public int ProgressBar; + + // Health bar. + [ProgressBar(0, 100, ColorMember = "GetHealthBarColor")] + public float HealthBar = 50; + + private Color GetHealthBarColor(float value) + { + // Blends between red, and yellow color for when the health is below 30, + // and blends between yellow and green color for when the health is above 30. + return Color.Lerp(Color.Lerp( + Color.red, Color.yellow, MathUtilities.LinearStep(0f, 30f, value)), + Color.green, MathUtilities.LinearStep(0f, 100f, value)); + } + + // Stacked health bar. + // The ProgressBar attribute is placed on property, without a set method, so it can't be edited directly. + // So instead we have this Range attribute on a float to change the value. + [Range(0, 300)] + public float StackedHealth; + + [ProgressBar(0, 100, ColorMember = "GetStackedHealthColor", BackgroundColorMember = "GetStackHealthBackgroundColor")] + private float StackedHealthProgressBar + { + // Loops the stacked health value between 0, and 100. + get { return this.StackedHealth - 100 * (int)((this.StackedHealth - 1) / 100); } + } + + private Color GetStackedHealthColor() + { + return + this.StackedHealth > 200 ? Color.cyan : + this.StackedHealth > 100 ? Color.green : + Color.red; + } + + private Color GetStackHealthBackgroundColor() + { + return + this.StackedHealth > 200 ? Color.green : + this.StackedHealth > 100 ? Color.red : + new Color(0.16f, 0.16f, 0.16f, 1f); + } + + // Custom color and height. + [ProgressBar(-100, 100, r: 1, g: 1, b: 1, Height = 30)] + public short BigProgressBar = 50; + + // You can also reference members by name to dynamically assign the min and max progress bar values. + [ProgressBar("DynamicMin", "DynamicMax")] + public float DynamicProgressBar; + + public float DynamicMin, DynamicMax; + } + + + + + + + + + The minimum value. + + + + + The maximum value. + + + + + The name of a field, property or method to get the min values from. Obsolete; use the MinGetter member instead. + + + + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + + + + + The name of a field, property or method to get the max values from. Obsolete; use the MaxGetter member instead. + + + + + A resolved string that should evaluate to a float value, and will be used as the max bounds. + + + + + The red channel of the color of the progress bar. + + + + + The green channel of the color of the progress bar. + + + + + The blue channel of the color of the progress bar. + + + + + The height of the progress bar in pixels. Defaults to 12 pixels. + + + + + Optional reference to a Color field, property or method, to dynamically change the color of the progress bar. Obsolete; use the ColorGetter member instead. + + + + + Optional resolved string that should evaluate to a Color value, to dynamically change the color of the progress bar. + + + + + Optional reference to a Color field, property or method, to dynamically change the background color of the progress bar. + Default background color is (0.16, 0.16, 0.16, 1). + Obsolete; use the BackgroundColorGetter member instead. + + + + + Optional resolved string that should evaluate to a Color value, to dynamically change the background color of the progress bar. + Default background color is (0.16, 0.16, 0.16, 1). + + + + + If true then the progress bar will be drawn in tiles. + + + + + References a member by name to get a custom value label string from. Obsolete; use the CustomValueStringGetter member instead. + + + + + A resolved string to get a custom value label string from. + + + + + Draws a progress bar for the value. + + The minimum value. + The maximum value. + The red channel of the color of the progress bar. + The green channel of the color of the progress bar. + The blue channel of the color of the progress bar. + + + + Draws a progress bar for the value. + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + The maximum value. + The red channel of the color of the progress bar. + The green channel of the color of the progress bar. + The blue channel of the color of the progress bar. + + + + Draws a progress bar for the value. + + The minimum value. + A resolved string that should evaluate to a float value, and will be used as the max bounds. + The red channel of the color of the progress bar. + The green channel of the color of the progress bar. + The blue channel of the color of the progress bar. + + + + Draws a progress bar for the value. + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + A resolved string that should evaluate to a float value, and will be used as the max bounds. + The red channel of the color of the progress bar. + The green channel of the color of the progress bar. + The blue channel of the color of the progress bar. + + + + If true then there will be drawn a value label on top of the progress bar. + + + + + Gets a value indicating if the user has set a custom DrawValueLabel value. + + + + + The alignment of the value label on top of the progress bar. Defaults to center. + + + + + Gets a value indicating if the user has set a custom ValueLabelAlignment value. + + + + + PropertyRange attribute creates a slider control to set the value of a property to between the specified range. + This is equivalent to Unity's Range attribute, but this attribute can be applied to both fields and property. + + The following example demonstrates how PropertyRange is used. + + public class MyComponent : MonoBehaviour + { + [PropertyRange(0, 100)] + public int MyInt; + + [PropertyRange(-100, 100)] + public float MyFloat; + + [PropertyRange(-100, -50)] + public decimal MyDouble; + + // This attribute also supports dynamically referencing members by name to assign the min and max values for the range field. + [PropertyRange("DynamicMin", "DynamicMax"] + public float MyDynamicValue; + + public float DynamicMin, DynamicMax; + } + + + + + + + + + The minimum value. + + + + + The maximum value. + + + + + The name of a field, property or method to get the min value from. Obsolete; use the MinGetter member instead. + + + + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + + + + + The name of a field, property or method to get the max value from. Obsolete; use the MaxGetter member instead. + + + + + A resolved string that should evaluate to a float value, and will be used as the max bounds. + + + + + Creates a slider control to set the value of the property to between the specified range.. + + The minimum value. + The maximum value. + + + + Creates a slider control to set the value of the property to between the specified range.. + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + The maximum value. + + + + Creates a slider control to set the value of the property to between the specified range.. + + The minimum value. + A resolved string that should evaluate to a float value, and will be used as the max bounds. + + + + Creates a slider control to set the value of the property to between the specified range.. + + A resolved string that should evaluate to a float value, and will be used as the min bounds. + A resolved string that should evaluate to a float value, and will be used as the max bounds. + + + + The PropertySpace attribute have the same function as Unity's existing Space attribute, but can be applied anywhere as opposed to just fields. + + + The following example demonstrates the usage of the PropertySpace attribute. + + [PropertySpace] // Defaults to a space of 8 pixels just like Unity's Space attribute. + public int MyField; + + [ShowInInspector, PropertySpace(16)] + public int MyProperty { get; set; } + + [ShowInInspector, PropertySpace(16, 16)] + public int MyProperty { get; set; } + + [Button, PropertySpace(32)] + public void MyMethod() + { + ... + } + + [PropertySpace(-8)] // A negative space can also be remove existing space between properties. + public int MovedUp; + + + + + + + + + + The space between properties in pixels. + + + + + The space between properties in pixels. + + + + + Adds a space of 8 pixels between properties. + + + + + Adds a space between properties. + + + + + Adds a space between properties. + + + + + Groups buttons into a group that will position and resize the buttons based on the amount of available layout space. + + + + [ResponsiveButtonGroup] + public void Foo() { } + + [ResponsiveButtonGroup] + public void Bar() { } + + [ResponsiveButtonGroup] + public void Baz() { } + + + + + [ResponsiveButtonGroup(UniformLayout = true)] + public void Foo() { } + + [ResponsiveButtonGroup] + public void Bar() { } + + [ResponsiveButtonGroup] + public void Baz() { } + + + + + [ResponsiveButtonGroupAttribute(UniformLayout = true, DefaultButtonSize = ButtonSizes.Large)] + public void Foo() { } + + [GUIColor(0, 1, 0))] + [Button(ButtonSizes.Large)] + [ResponsiveButtonGroup] + public void Bar() { } + + [ResponsiveButtonGroup] + public void Baz() { } + + + + + [TabGroup("SomeTabGroup", "SomeTab")] + [ResponsiveButtonGroup("SomeTabGroup/SomeTab/SomeBtnGroup")] + public void Foo() { } + + [ResponsiveButtonGroup("SomeTabGroup/SomeTab/SomeBtnGroup")] + public void Bar() { } + + [ResponsiveButtonGroup("SomeTabGroup/SomeTab/SomeBtnGroup")] + public void Baz() { } + + + + + + The default size of the button. + + + + + If true then the widths of a line of buttons will be the same. + + + + + Draws a button that will be placed in a group that will respond to the horizontal space available to the group. + + The name of the group to place the button in. + + + + Merges the values of this group with another ResponsiveButtonGroupAttribute. + + The attribute to combine with. + + + +

ShowIfGroup allows for showing or hiding a group of properties based on a condition.

+

The attribute is a group attribute and can therefore be combined with other group attributes, and even be used to show or hide entire groups.

+

Note that in the vast majority of cases where you simply want to be able to control the visibility of a single group, it is better to use the VisibleIf parameter that *all* group attributes have.

+
+ + + + + +
+ + + Whether or not to visually animate group visibility changes. Alias for AnimateVisibility. + + + + + The optional member value. + + + + + Name of member to use when to hide the group. Defaults to the name of the group, by can be overriden by setting this property. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + Makes a group that can be shown or hidden based on a condition. + + The group path. + If true then a fade animation will be played when the group is hidden or shown. + + + + Makes a group that can be shown or hidden based on a condition. + + The group path. + The value the member should equal for the property to shown. + If true then a fade animation will be played when the group is hidden or shown. + + + + Combines ShowIfGroup attributes. + + Another ShowIfGroup attribute. + + + + Only shows a property if it is drawn within an . + + + + + + ShowPropertyResolver shows the property resolver responsible for bringing the member into the property tree. + This is useful in situations where you want to debug why a particular member that is normally not shown in the inspector suddenly is. + + + + + public class MyComponent : MonoBehaviour + { + [ShowPropertyResolver] + public int IndentedInt; + } + + + + + + The SuffixLabel attribute draws a label at the end of a property. + Use this for conveying intend about a property. Is the distance measured in meters, kilometers, or in light years?. + Is the angle measured in degrees or radians? + Using SuffixLabel, you can place a neat label at the end of a property, to clearly show how the the property is used. + + + The following example demonstrates how SuffixLabel is used. + + public class MyComponent : MonoBehaviour + { + // The SuffixLabel attribute draws a label at the end of a property. + // It's useful for conveying intend about a property. + // Fx, this field is supposed to have a prefab assigned. + [SuffixLabel("Prefab")] + public GameObject GameObject; + + // Using the Overlay property, the suffix label will be drawn on top of the property instead of behind it. + // Use this for a neat inline look. + [SuffixLabel("ms", Overlay = true)] + public float Speed; + + [SuffixLabel("radians", Overlay = true)] + public float Angle; + + // The SuffixLabel attribute also supports string member references by using $. + [SuffixLabel("$Suffix", Overlay = true)] + public string Suffix = "Dynamic suffix label"; + } + + + + + + + + + + The label displayed at the end of the property. + + + + + If true the suffix label will be drawn on top of the property, instead of after. + + + + + Draws a label at the end of the property. + + The text of the label. + If true the suffix label will be drawn on top of the property, instead of after. + + + + The TableColumnWidth attribute is used to further customize the width of a column in tables drawn using the . + + + + [TableList] + public List<SomeType> TableList = new List<SomeType>(); + + [Serializable] + public class SomeType + { + [LabelWidth(30)] + [TableColumnWidth(130, false)] + [VerticalGroup("Combined")] + public string A; + + [LabelWidth(30)] + [VerticalGroup("Combined")] + public string B; + + [Multiline(2), Space(3)] + public string fields; + } + + + + + + + The width of the column. + + + + + Whether the column should be resizable. True by default. + + + + + Initializes a new instance of the class. + + The width of the column in pixels. + If true then the column can be resized in the inspector. + + + + Renders lists and arrays in the inspector as tables. + + + + + + + If ShowPaging is enabled, this will override the default setting specified in the Odin Preferences window. + + + + + Mark the table as read-only. This removes all editing capabilities from the list such as Add and delete, + but without disabling GUI for each element drawn as otherwise would be the case if the was used. + + + + + The default minimum column width - 40 by default. This can be overwriten by individual columns using the . + + + + + If true, a label is drawn for each element which shows the index of the element. + + + + + Whether to draw all rows in a scroll-view. + + + + + The number of pixels before a scroll view appears. 350 by default. + + + + + The number of pixels before a scroll view appears. 0 by default. + + + + + If true, expanding and collapsing the table from the table title-bar is no longer an option. + + + + + Whether to hide the toolbar containing the add button and pagin etc.s + + + + + The cell padding. + + + + + Whether paging buttons should be added to the title bar. The default value of this, can be customized from the Odin Preferences window. + + + + + Whether the ShowPaging property has been set. + + + + + Sets the Min and Max ScrollViewHeight. + + + + + The TableMatrix attribute is used to further specify how Odin should draw two-dimensional arrays. + + + + // Inheriting from SerializedMonoBehaviour is only needed if you want Odin to serialize the multi-dimensional arrays for you. + // If you prefer doing that yourself, you can still make Odin show them in the inspector using the ShowInInspector attribute. + public class TableMatrixExamples : SerializedMonoBehaviour + { + [InfoBox("Right-click and drag column and row labels in order to modify the tables."), PropertyOrder(-10), OnInspectorGUI] + private void ShowMessageAtOP() { } + + [BoxGroup("Two Dimensional array without the TableMatrix attribute.")] + public bool[,] BooleanTable = new bool[15, 6]; + + [BoxGroup("ReadOnly table")] + [TableMatrix(IsReadOnly = true)] + public int[,] ReadOnlyTable = new int[5, 5]; + + [BoxGroup("Labled table")] + [TableMatrix(HorizontalTitle = "X axis", VerticalTitle = "Y axis")] + public GameObject[,] LabledTable = new GameObject[15, 10]; + + [BoxGroup("Enum table")] + [TableMatrix(HorizontalTitle = "X axis")] + public InfoMessageType[,] EnumTable = new InfoMessageType[4,4]; + + [BoxGroup("Custom table")] + [TableMatrix(DrawElementMethod = "DrawColoredEnumElement", ResizableColumns = false)] + public bool[,] CustomCellDrawing = new bool[30,30]; + + #if UNITY_EDITOR + + private static bool DrawColoredEnumElement(Rect rect, bool value) + { + if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition)) + { + value = !value; + GUI.changed = true; + Event.current.Use(); + } + + UnityEditor.EditorGUI.DrawRect(rect.Padding(1), value ? new Color(0.1f, 0.8f, 0.2f) : new Color(0, 0, 0, 0.5f)); + + return value; + } + + #endif + } + + + + + + If true, inserting, removing and dragging columns and rows will become unavailable. But the cells themselves will remain modifiable. + If you want to disable everything, you can use the attribute. + + + + + Whether or not columns are resizable. + + + + + The vertical title label. + + + + + The horizontal title label. + + + + + Override how Odin draws each cell. + [TableMatrix(DrawElementMethod='DrawMyElement')] + public MyType[,] myArray; + private static MyType DrawElement(Rect rect, MyType value) { return GUI.DrawMyType(rect, value); } + + + + + The height for all rows. 0 = default row height. + + + + + If true, the height of each row will be the same as the width of the first cell. + + + + + If true, no column indices drawn. + + + + + If true, no row indices drawn. + + + + + Whether the drawn table should respect the current GUI indent level. + + + + + If true, tables are drawn with rows/columns reversed (C# initialization order). + + + + + Name of any field, property or method member that implements IList. E.g. arrays or Lists. Obsolete; use the FilterGetter member instead. + + + + + A resolved string that should evaluate to a value that is assignable to IList; e.g, arrays and lists are compatible. + + + + + Gets or sets the title for the dropdown. Null by default. + + + + + Creates a dropdown menu for a property. + + A resolved string that should evaluate to a value that is assignable to IList; e.g, arrays and lists are compatible. + + + + The TypeInfoBox attribute adds an info box to the very top of a type in the inspector. + Use this to add an info box to the top of a class in the inspector, without having to use neither the PropertyOrder nor the OnInspectorGUI attribute. + + + The following example demonstrates the use of the TypeInfoBox attribute. + + [TypeInfoBox("This is my component and it is mine.")] + public class MyComponent : MonoBehaviour + { + // Class implementation. + } + + + + + + + + The message to display in the info box. + + + + + Draws an info box at the top of a type in the inspector. + + The message to display in the info box. + + + + VerticalGroup is used to gather properties together in a vertical group in the inspector. + This doesn't do much in and of itself, but in combination with other groups, such as it can be very useful. + + + The following example demonstrates how VerticalGroup can be used in conjunction with + + public class MyComponent : MonoBehaviour + { + [HorizontalGroup("Split")] + [VerticalGroup("Split/Left")] + public Vector3 Vector; + + [VerticalGroup("Split/Left")] + public GameObject First; + + [VerticalGroup("Split/Left")] + public GameObject Second; + + [VerticalGroup("Split/Right", PaddingTop = 18f)] + public int A; + + [VerticalGroup("Split/Right")] + public int B; + } + + + + + + + + + + + Space in pixels at the top of the group. + + + + + Space in pixels at the bottom of the group. + + + + + Groups properties vertically. + + The group ID. + The group order. + + + + Groups properties vertically. + GroupId: _DefaultVerticalGroup + + The group order. + + + + Combines properties that have been group vertically. + + The group attribute to combine with. + + + + Not yet documented. + + + + + Not yet documented. + + + + + Adds a search filter that can search the children of the field or type on + which it is applied. Note that this does not currently work when directly + applied to dictionaries, though a search field "above" the dictionary will + still search the dictionary's properties if it is searching recursively. + + + + + Whether to use fuzzy string matching for the search. + Default value: true. + + + + + The options for which things to use to filter the search. + Default value: All. + + + + + Whether to search recursively, or only search the top level properties. + Default value: true. + + + + + When this attribute is added is added to another attribute, then attributes from that attribute + will also be added to the property in the attribute processing step. + + + + + How the InlineEditor attribute drawer should draw the object field. + + + + + Draws the object field in a box. + + + + + Draws the object field with a foldout. + + + + + Hides the object field unless it's null. + + + + + Hidden the object field also when the object is null. + + + + + Implement this interface to create custom matching + logic for search filtering in the inspector. + + + The following example shows how you might do this: + + public class MyCustomClass : ISearchFilterable + { + public bool SearchEnabled; + public string MyStr; + + public bool IsMatch(string searchString) + { + if (SearchEnabled) + { + return MyStr.Contains(searchString); + } + + return false; + } + } + + + + + + How the square object field should be aligned. + + + + + + Left aligned. + + + + + Aligned to the center. + + + + + Right aligned. + + + + + Options for filtering search. + + + + + Title alignment enum used by various attributes. + + + + + + + Title and subtitle left aligned. + + + + + Title and subtitle centered aligned. + + + + + Title and subtitle right aligned. + + + + + Title on the left, subtitle on the right. + + + + + Groups properties vertically together with a title, an optional subtitle, and an optional horizontal line. + + + + + Optional subtitle. + + + + + Title alignment. + + + + + Gets a value indicating whether or not to draw a horizontal line below the title. + + + + + If true the title will be displayed with a bold font. + + + + + Gets a value indicating whether or not to indent all group members. + + + + + Groups properties vertically together with a title, an optional subtitle, and an optional horizontal line. + + The title- + Optional subtitle. + The text alignment. + Horizontal line. + Bold text. + Whether or not to indent all group members. + The group order. + + + + Combines TitleGroup attributes. + + The other group attribute to combine with. + + + + Various built-in button sizes. + + + + + Small button size, fits well with properties in the inspector. + + + + + A larger button. + + + + + A very large button. + + + + + A gigantic button. Twice as big as Large + + + + + ColorPalette is used on any Color property, and allows for choosing colors from different definable palettes. + Use this to allow the user to choose from a set of predefined color options. + + + See and edit the color palettes in Tools > Odin Inspector > Drawers > Color Palettes. + The color property is not tied to the color palette, and can be edited. Therefore the color will also not update if the ColorPalette is edited. + + + The following example shows how ColorPalette is applied to a property. The user can freely choose between all available ColorPalettes. + + public class ColorPaletteExamples : MonoBehaviour + { + [ColorPalette] + public Color ColorOptions; + + [ColorPalette("Underwater")] + public Color UnderwaterColor; + + [ColorPalette("Fall"), HideLabel] + public Color WideColorPalette; + + [ColorPalette("My Palette")] + public Color MyColor; + + [ColorPalette("Clovers")] + public Color[] ColorArray; + } + + + + + + Gets the name of the palette. + + + + + Indicates if the color palette should show alpha values or not. + + + + + Adds a color palette options to a Color property. + + + + + Adds color options to a Color property from a specific palette. + + Name of the palette. + + + + CustomContextMenu is used on any property, and adds a custom options to the context menu for the property. + Use this for when you want to add custom actions to the context menu of a property. + + + CustomContextMenu currently does not support static functions. + + + The following example shows how CustomContextMenu is used to add a custom option to a property. + + public class MyComponent : MonoBehaviour + { + [CustomContextMenu("My custom option", "MyAction")] + public Vector3 MyVector; + + private void MyAction() + { + MyVector = Random.onUnitSphere; + } + } + + + + + + + The name of the menu item. + + + + + The name of the callback method. Obsolete; use the Action member instead. + + + + + A resolved string defining the action to take when the context menu is clicked. + + + + + Adds a custom option to the context menu of the property. + + The name of the menu item. + A resolved string defining the action to take when the context menu is clicked. + + + + Delays applying changes to properties while they still being edited in the inspector. + Similar to Unity's built-in Delayed attribute, but this attribute can also be applied to properties. + + + + + DetailedInfoBox is used on any property, and displays a message box that can be expanded to show more details. + Use this to convey a message to a user, and give them the option to see more details. + + + The following example shows how DetailedInfoBox is used on a field. + + public class MyComponent : MonoBehaviour + { + [DetailedInfoBox("This is a message", "Here is some more details about that message")] + public int MyInt; + } + + + + + + + The message for the message box. + + + + + The hideable details of the message box. + + + + + Type of the message box. + + + + + Optional name of a member to hide or show the message box. + + + + + Displays a message box with hideable details. + + The message for the message box. + The hideable details of the message box. + Type of the message box. + Optional name of a member to hide or show the message box. + + + + Various display modes for the dictionary to draw its items. + + + + + Draws all dictionary items in two columns. The left column contains all key values, the right column displays all values. + + + + + Draws each dictionary item in a box with the key in the header and the value inside the box. + Whether or not the box is expanded or collapsed by default, is determined by the + "Expand Foldout By Default" setting found in the preferences window "Tools > Odin Inspector > Preferences > Drawers > Settings". + + + + + Draws each dictionary item in a collapsed foldout with the key in the header and the value inside the box. + + + + + Draws each dictionary item in an expanded foldout with the key in the header and the value inside the box. + + + + + Customize the behavior for dictionaries in the inspector. + + + + + Specify an alternative key label for the dictionary drawer. + + + + + Specify an alternative value label for the dictionary drawer. + + + + + Specify how the dictionary should draw its items. + + + + + Gets or sets a value indicating whether this instance is read only. + + + + + DisableContextMenu is used on any property and disables the context menu for that property. + Use this if you do not want the context menu to be available for a property. + + + The following example shows how DisableContextMenu is used on a property. + + public class MyComponent : MonoBehaviour + { + [DisableContextMenu] + public Vector3 MyVector; + } + + + + + + + Whether to disable the context menu for the member itself. + + + + + Whether to disable the context menu for collection elements. + + + + + Initializes a new instance of the class. + + Whether to disable the context menu for the member itself. + Whether to also disable the context menu of collection elements. + + + + DisableIf is used on any property, and can disable or enable the property in the inspector. + Use this to disable properties when they are irrelevant. + + + The following example shows how a property can be disabled by the state of a field. + + public class MyComponent : MonoBehaviour + { + public bool DisableProperty; + + [DisableIf("DisableProperty")] + public int MyInt; + + public SomeEnum SomeEnumField; + + [DisableIf("SomeEnumField", SomeEnum.SomeEnumMember)] + public string SomeString; + } + + + + The following examples show how a property can be disabled by a function. + + public class MyComponent : MonoBehaviour + { + [EnableIf("MyDisableFunction")] + public int MyInt; + + private bool MyDisableFunction() + { + // ... + } + } + + + + + + + + The name of a bool member field, property or method. Obsolete; use the Condition member instead. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + The optional condition value. + + + + + Disables a property in the inspector, based on the value of a resolved string. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + Disables a property in the inspector, if the resolved string evaluates to the specified value. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Value to check against. + + + + DisableInEditorMode is used on any property, and disables the property when not in play mode. + Use this when you only want a property to be editable when in play mode. + + + The following example shows how DisableInEditorMode is used to disable a property when in the editor. + + public class MyComponent : MonoBehaviour + { + [DisableInEditorMode] + public int MyInt; + } + + + + + + + + + DisableInPlayMode is used on any property, and disables the property when in play mode. + Use this to prevent users from editing a property when in play mode. + + + The following example shows how DisableInPlayMode is used to disable a property when in play mode. + + public class MyComponent : MonoBehaviour + { + [DisableInPlayMode] + public int MyInt; + } + + + + + + + + + + + DisplayAsString is used on any property, and displays a string in the inspector as text. + Use this for when you want to show a string in the inspector, but not allow for any editing. + + + DisplayAsString uses the property's ToString method to display the property as a string. + + + The following example shows how DisplayAsString is used to display a string property as text in the inspector. + + public class MyComponent : MonoBehaviour + { + [DisplayAsString] + public string MyInt = 5; + + // You can combine with to display a message in the inspector. + [DisplayAsString, HideLabel] + public string MyMessage = "This string will be displayed as text in the inspector"; + + [DisplayAsString(false)] + public string InlineMessage = "This string is very long, but has been configured to not overflow."; + } + + + + + + + + If true, the string will overflow past the drawn space and be clipped when there's not enough space for the text. + If false the string will expand to multiple lines, if there's not enough space when drawn. + + + + + Displays the property as a string in the inspector. + + + + + Displays the property as a string in the inspector. + + Value indicating if the string should overflow past the available space, or expand to multiple lines when there's not enough horizontal space. + + + + DontApplyToListElements is used on other attributes, and indicates that those attributes should be applied only to the list, and not to the elements of the list. + Use this on attributes that should only work on a list or array property as a whole, and not on each element of the list. + + + The following example shows how DontApplyToListElements is used on . + + [DontApplyToListElements] + [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)] + public sealed class VisibleIfAttribute : Attribute + { + public string MemberName { get; private set; } + + public VisibleIfAttribute(string memberName) + { + this.MemberName = memberName; + } + } + + + + + + DrawWithUnity can be applied to a field or property to make Odin draw it using Unity's old drawing system. Use it if you want to selectively disable Odin drawing for a particular member. + + + Note that this attribute does not mean "disable Odin completely for this property"; it is visual only in nature, and in fact represents an Odin drawer which calls into Unity's old property drawing system. As Odin is still ultimately responsible for arranging the drawing of the property, and since other attributes exist with a higher priority than this attribute, and it is not guaranteed that Unity will draw the property if another attribute is present to override this one. + + + + + The inline button adds a button to the end of a property. + + + Due to a bug, multiple inline buttons are currently not supported. + + + The following examples demonstrates how InlineButton can be used. + + public class MyComponent : MonoBehaviour + { + // Adds a button to the end of the A property. + [InlineButton("MyFunction")] + public int A; + + // This is example demonstrates how you can change the label of the button. + // InlineButton also supports refering to string members with $. + [InlineButton("MyFunction", "Button")] + public int B; + + private void MyFunction() + { + // ... + } + } + + + + + + + + Name of member method to call when the button is clicked. Obsolete; use the Action member instead. + + + + + A resolved string that defines the action to perform when the button is clicked, such as an expression or method invocation. + + + + + Optional label of the button. + + + + + Draws a button to the right of the property. + + A resolved string that defines the action to perform when the button is clicked, such as an expression or method invocation. + Optional label of the button. + + + + Not yet documented. + + + + + Not yet documented. + + Not yet documented. + + + + Not yet documented. + + Not yet documented. + Not yet documented. + + + + ShowForPrefabOnlyAttribute is used on any field or property, and only shows properties from prefab assets inspector. + Use this to ensure the same value on a property, across all instances of a prefab. + + + On non-prefab objects or instances, this attribute does nothing, and allows properties to be edited as normal. + + + The following example shows how ShowForPrefabOnlyAttribute is used on properties. + + public class MyComponent + { + [ShowForPrefabOnlyAttribute] + public int MyInt; + } + + + + + + + + + + + EnableForPrefabOnly is used on any field or property, and only allows editing of values from prefab assets inspector. + Use this to ensure the same value on a property, across all instances of a prefab. + + + On non-prefab objects or instances, this attribute does nothing, and allows properties to be edited as normal. + + + The following example shows how EnableForPrefabOnly is used on properties. + + public class MyComponent + { + [EnableForPrefabOnly] + public int MyInt; + } + + + + + + + + + + + EnableIf is used on any property, and can enable or disable the property in the inspector. + Use this to enable properties when they are relevant. + + + The following example shows how a property can be enabled by the state of a field. + + public class MyComponent : MonoBehaviour + { + public bool EnableProperty; + + [EnableIf("EnableProperty")] + public int MyInt; + + public SomeEnum SomeEnumField; + + [EnableIf("SomeEnumField", SomeEnum.SomeEnumMember)] + public string SomeString; + } + + + + The following examples show how a property can be enabled by a function. + + public class MyComponent : MonoBehaviour + { + [EnableIf("MyEnableFunction")] + public int MyInt; + + private bool MyEnableFunction() + { + // ... + } + } + + + + + + + + + + + The name of a bool member field, property or method. Obsolete; use the Condition member instead. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + The optional condition value. + + + + + Enables a property in the inspector, based on the value of a resolved string. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + Enables a property in the inspector, if the resolved string evaluates to the specified value. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Value to check against. + + + + Draws an enum in a horizontal button group instead of a dropdown. + + + + public class MyComponent : MonoBehvaiour + { + [EnumToggleButtons] + public MyBitmaskEnum MyBitmaskEnum; + + [EnumToggleButtons] + public MyEnum MyEnum; + } + + [Flags] + public enum MyBitmaskEnum + { + A = 1 << 1, // 1 + B = 1 << 2, // 2 + C = 1 << 3, // 4 + ALL = A | B | C + } + + public enum MyEnum + { + A, + B, + C + } + + + + + + + HideIf is used on any property and can hide the property in the inspector. + Use this to hide irrelevant properties based on the current state of the object. + + + This example shows a component with fields hidden by the state of another field. + + public class MyComponent : MonoBehaviour + { + public bool HideProperties; + + [HideIf("HideProperties")] + public int MyInt; + + [HideIf("HideProperties", false)] + public string MyString; + + public SomeEnum SomeEnumField; + + [HideIf("SomeEnumField", SomeEnum.SomeEnumMember)] + public string SomeString; + } + + + + This example shows a component with a field that is hidden when the game object is inactive. + + public class MyComponent : MonoBehaviour + { + [HideIf("MyVisibleFunction")] + public int MyHideableField; + + private bool MyVisibleFunction() + { + return !this.gameObject.activeInHierarchy; + } + } + + + + + + + + + The name of a bool member field, property or method. Obsolete; use the Condition member instead. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + The optional condition value. + + + + + Whether or not to slide the property in and out when the state changes. + + + + + Hides a property in the inspector, based on the value of a resolved string. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Whether or not to slide the property in and out when the state changes. + + + + Hides a property in the inspector, if the resolved string evaluates to the specified value. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Value to check against. + Whether or not to slide the property in and out when the state changes. + + + + HideInPlayMode is used on any property, and hides the property when not in editor mode. + Use this when you only want a property to only be visible the editor. + + + The following example shows how HideInPlayMode is used to hide a property when in play mode. + + public class MyComponent : MonoBehaviour + { + [HideInPlayMode] + public int MyInt; + } + + + + + + + + + + HideInEditorMode is used on any property, and hides the property when not in play mode. + Use this when you only want a property to only be visible play mode. + + + The following example shows how HideInEditorMode is used to hide a property when in the editor. + + public class MyComponent : MonoBehaviour + { + [HideInEditorMode] + public int MyInt; + } + + + + + + + + + + Apply HideMonoScript to your class to prevent the Script property from being shown in the inspector. + + This attribute has the same effect on a single type that the global configuration option "Show Mono Script In Editor" in "Preferences -> Odin Inspector -> General -> Drawers" has globally when disabled. + + + + The following example shows how to use this attribute. + + [HideMonoScript] + public class MyComponent : MonoBehaviour + { + // The Script property will not be shown for this component in the inspector + } + + + + + + + Hides the polymorphic object-picker shown above the properties of non-Unity serialized reference types. + + + When the object picker is hidden, you can right click and set the instance to null, in order to set a new value. + If you don't want this behavior, you can use attribute to ensure people can't change the value. + + + + + public class MyComponent : SerializedMonoBehaviour + { + [Header("Hidden Object Pickers")] + [Indent] + [HideReferenceObjectPicker] + public MyCustomReferenceType OdinSerializedProperty1; + + [Indent] + [HideReferenceObjectPicker] + public MyCustomReferenceType OdinSerializedProperty2; + + [Indent] + [Header("Shown Object Pickers")] + public MyCustomReferenceType OdinSerializedProperty3; + + [Indent] + public MyCustomReferenceType OdinSerializedProperty4; + + public class MyCustomReferenceType + { + public int A; + public int B; + public int C; + } + } + + + + + + HorizontalGroup is used group multiple properties horizontally in the inspector. + The width can either be specified as percentage or pixels. + All values between 0 and 1 will be treated as a percentage. + If the width is 0 the column will be automatically sized. + Margin-left and right can only be specified in pixels. + + + The following example shows how three properties have been grouped together horizontally. + + // The width can either be specified as percentage or pixels. + // All values between 0 and 1 will be treated as a percentage. + // If the width is 0 the column will be automatically sized. + // Margin-left and right can only be specified in pixels. + + public class HorizontalGroupAttributeExamples : MonoBehaviour + { + [HorizontalGroup] + public int A; + + [HideLabel, LabelWidth (150)] + [HorizontalGroup(150)] + public LayerMask B; + + // LabelWidth can be helpfull when dealing with HorizontalGroups. + [HorizontalGroup("Group 1"), LabelWidth(15)] + public int C; + + [HorizontalGroup("Group 1"), LabelWidth(15)] + public int D; + + [HorizontalGroup("Group 1"), LabelWidth(15)] + public int E; + + // Having multiple properties in a column can be achived using multiple groups. Checkout the "Combining Group Attributes" example. + [HorizontalGroup("Split", 0.5f, PaddingRight = 15)] + [BoxGroup("Split/Left"), LabelWidth(15)] + public int L; + + [BoxGroup("Split/Right"), LabelWidth(15)] + public int M; + + [BoxGroup("Split/Left"), LabelWidth(15)] + public int N; + + [BoxGroup("Split/Right"), LabelWidth(15)] + public int O; + + // Horizontal Group also has supprot for: Title, MarginLeft, MarginRight, PaddingLeft, PaddingRight, MinWidth and MaxWidth. + [HorizontalGroup("MyButton", MarginLeft = 0.25f, MarginRight = 0.25f)] + public void SomeButton() + { + + } + } + + + + + + + + + + + The width. Values between 0 and 1 will be treated as percentage, 0 = auto, otherwise pixels. + + + + + The margin left. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + The margin right. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + The padding left. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + The padding right. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + The minimum Width. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + The maximum Width. Values between 0 and 1 will be treated as percentage, 0 = ignore, otherwise pixels. + + + + + Adds a title above the horizontal group. + + + + + The label width, 0 = auto. + + + + + Organizes the property in a horizontal group. + + The group for the property. + The width of the property. Values between 0 and 1 are interpolated as a percentage, otherwise pixels. + The left margin in pixels. + The right margin in pixels. + The order of the group in the inspector. + + + + Organizes the property in a horizontal group. + + The width of the property. Values between 0 and 1 are interpolated as a percentage, otherwise pixels. + The left margin in pixels. + The right margin in pixels. + The order of the group in the inspector. + + + + Merges the values of two group attributes together. + + The other group to combine with. + + + + InlineAttribute is used on any property or field with a type that inherits from UnityEngine.Object. This includes components and assets etc. + + + + public class InlineEditorExamples : MonoBehaviour + { + [DisableInInlineEditors] + public Vector3 DisabledInInlineEditors; + + [HideInInlineEditors] + public Vector3 HiddenInInlineEditors; + + [InlineEditor] + public Transform InlineComponent; + + [InlineEditor(InlineEditorModes.FullEditor)] + public Material FullInlineEditor; + + [InlineEditor(InlineEditorModes.GUIAndHeader)] + public Material InlineMaterial; + + [InlineEditor(InlineEditorModes.SmallPreview)] + public Material[] InlineMaterialList; + + [InlineEditor(InlineEditorModes.LargePreview)] + public GameObject InlineObjectPreview; + + [InlineEditor(InlineEditorModes.LargePreview)] + public Mesh InlineMeshPreview; + } + + + + + + + + If true, the inline editor will start expanded. + + + + + Draw the header editor header inline. + + + + + Draw editor GUI inline. + + + + + Draw editor preview inline. + + + + + Maximum height of the inline editor. If the inline editor exceeds the specified height, a scrollbar will appear. + Values less or equals to zero will let the InlineEditor expand to its full size. + + + + + The size of the editor preview if drawn together with GUI. + + + + + The size of the editor preview if drawn alone. + + + + + If false, this will prevent the InlineEditor attribute from incrementing the InlineEditorAttributeDrawer.CurrentInlineEditorDrawDepth. + This is helpful in cases where you want to draw the entire editor, and disregard attributes + such as [] and []. + + + + + How the InlineEditor attribute drawer should draw the object field. + + + + + Whether to set GUI.enabled = false when drawing an editor for an asset that is locked by source control. Defaults to true. + + + + + Initializes a new instance of the class. + + The inline editor mode. + How the object field should be drawn. + + + + Initializes a new instance of the class. + + How the object field should be drawn. + + + + SuppressInvalidAttributeError is used on members to suppress the inspector error message you get when applying an attribute to a value that it's not supposed to work on. + This can be very useful for applying attributes to generic parameter values, when it only applies to some of the possible types that the value might become. + + + The following example shows a case where the attribute might be useful. + + public class NamedValue<T> + { + public string Name; + + // The Range attribute will be applied if T is compatible with it, but if T is not compatible, an error will not be shown. + [SuppressInvalidAttributeError, Range(0, 10)] + public T Value; + } + + + + + + Editor modes for + + + + + + Draws only the editor GUI + + + + + Draws the editor GUI and the editor header. + + + + + Draws the editor GUI to the left, and a small editor preview to the right. + + + + + Draws a small editor preview without any GUI. + + + + + Draws a large editor preview without any GUI. + + + + + Draws the editor header and GUI to the left, and a small editor preview to the right. + + + + + + ShowDrawerChain lists all prepend, append and value drawers being used in the inspector. + This is great in situations where you want to debug, and want to know which drawers might be involved in drawing the property. + + Your own custom drawers are highlighted with a green label. + Drawers, that have not been called during the draw chain, will be greyed out in the inspector to make it clear which drawers have had an effect on the properties. + + + + public class MyComponent : MonoBehaviour + { + [ShowDrawerChain] + public int IndentedInt; + } + + + + + + Marks a type as being specially serialized. Odin uses this attribute to check whether it should include non-Unity-serialized members in the inspector. + + + + + FoldoutGroup is used on any property, and organizes properties into a foldout. + Use this to organize properties, and to allow the user to hide properties that are not relevant for them at the moment. + + + The following example shows how FoldoutGroup is used to organize properties into a foldout. + + public class MyComponent : MonoBehaviour + { + [FoldoutGroup("MyGroup")] + public int A; + + [FoldoutGroup("MyGroup")] + public int B; + + [FoldoutGroup("MyGroup")] + public int C; + } + + + + The following example shows how properties can be organizes into multiple foldouts. + + public class MyComponent : MonoBehaviour + { + [FoldoutGroup("First")] + public int A; + + [FoldoutGroup("First")] + public int B; + + [FoldoutGroup("Second")] + public int C; + } + + + + + + + + + + + Gets a value indicating whether or not the foldout should be expanded by default. + + + + + Gets a value indicating whether or not the Expanded property has been set. + + + + + Adds the property to the specified foldout group. + + Name of the foldout group. + The order of the group in the inspector. + + + + Adds the property to the specified foldout group. + + Name of the foldout group. + Whether or not the foldout should be expanded by default. + The order of the group in the inspector. + + + + Combines the foldout property with another. + + The group to combine with. + + + + GUIColor is used on any property and changes the GUI color used to draw the property. + + + The following example shows how GUIColor is used on a properties to create a rainbow effect. + + public class MyComponent : MonoBehaviour + { + [GUIColor(1f, 0f, 0f)] + public int A; + + [GUIColor(1f, 0.5f, 0f, 0.2f)] + public int B; + + [GUIColor("GetColor")] + public int C; + + private Color GetColor() { return this.A == 0 ? Color.red : Color.white; } + } + + + + + + The GUI color of the property. + + + + + The name of a local field, member or property that returns a Color. Both static and instance methods are supported. + + + + + Sets the GUI color for the property. + + The red channel. + The green channel. + The blue channel. + The alpha channel. + + + + Sets the GUI color for the property. + + Specify the name of a local field, member or property that returns a Color. + + + + HideLabel is used on any property, and hides the label in the inspector. + Use this to hide the label of properties in the inspector. + + + The following example show how HideLabel is used to hide the label of a game object property. + + public class MyComponent : MonoBehaviour + { + [HideLabel] + public GameObject MyGameObjectWithoutLabel; + } + + + + + + + Indent is used on any property and moves the property's label to the right. + Use this to clearly organize properties in the inspector. + + + The following example shows how a property is indented by Indent. + + public class MyComponent : MonoBehaviour + { + [Indent] + public int IndentedInt; + } + + + + + + Indicates how much a property should be indented. + + + + + Indents a property in the inspector. + + How much a property should be indented. + + + + InfoBox is used on any property, and display a text box above the property in the inspector. + Use this to add comments or warn about the use of different properties. + + + The following example shows different info box types. + + public class MyComponent : MonoBehaviour + { + [InfoBox("This is an int property")] + public int MyInt; + + [InfoBox("This info box is a warning", InfoMessageType.Warning)] + public float MyFloat; + + [InfoBox("This info box is an error", InfoMessageType.Error)] + public object MyObject; + + [InfoBox("This info box is just a box", InfoMessageType.None)] + public Vector3 MyVector; + } + + + + The following example how info boxes can be hidden by fields and properties. + + public class MyComponent : MonoBehaviour + { + [InfoBox("This info box is hidden by an instance field.", "InstanceShowInfoBoxField")] + public int MyInt; + public bool InstanceShowInfoBoxField; + + [InfoBox("This info box is hideable by a static field.", "StaticShowInfoBoxField")] + public float MyFloat; + public static bool StaticShowInfoBoxField; + + [InfoBox("This info box is hidden by an instance property.", "InstanceShowInfoBoxProperty")] + public int MyOtherInt; + public bool InstanceShowInfoBoxProperty { get; set; } + + [InfoBox("This info box is hideable by a static property.", "StaticShowInfoBoxProperty")] + public float MyOtherFloat; + public static bool StaticShowInfoBoxProperty { get; set; } + } + + + + The following example shows how info boxes can be hidden by functions. + + public class MyComponent : MonoBehaviour + { + [InfoBox("This info box is hidden by an instance function.", "InstanceShowFunction")] + public int MyInt; + public bool InstanceShowFunction() + { + return this.MyInt == 0; + } + + [InfoBox("This info box is hidden by a static function.", "StaticShowFunction")] + public short MyShort; + public bool StaticShowFunction() + { + return true; + } + + // You can also specify a function with the same type of parameter. + // Use this to specify the same function, for multiple different properties. + [InfoBox("This info box is hidden by an instance function with a parameter.", "InstanceShowParameterFunction")] + public GameObject MyGameObject; + public bool InstanceShowParameterFunction(GameObject property) + { + return property != null; + } + + [InfoBox("This info box is hidden by a static function with a parameter.", "StaticShowParameterFunction")] + public Vector3 MyVector; + public bool StaticShowParameterFunction(Vector3 property) + { + return property.magnitude == 0f; + } + } + + + + + + + + The message to display in the info box. + + + + + The type of the message box. + + + + + Optional member field, property or function to show and hide the info box. + + + + + When true the InfoBox will ignore the GUI.enable flag and always draw as enabled. + + + + + Displays an info box above the property. + + The message for the message box. Supports referencing a member string field, property or method by using $. + The type of the message box. + Name of member bool to show or hide the message box. + + + + Displays an info box above the property. + + The message for the message box. Supports referencing a member string field, property or method by using $. + Name of member bool to show or hide the message box. + + + + Draw a special slider the user can use to specify a range between a min and a max value. + Uses a Vector2 where x is min and y is max. + + + The following example shows how MinMaxSlider is used. + + public class Player : MonoBehaviour + { + [MinMaxSlider(4, 5)] + public Vector2 SpawnRadius; + } + + + + + + The hardcoded min value for the slider. + + + + + The hardcoded max value for the slider. + + + + + The name of a field, property or method to get the min value from. Obsolete; use MinValueGetter instead. + + + + + A resolved string that should evaluate to a float value, which is used as the min bounds. + + + + + The name of a field, property or method to get the max value from. Obsolete; use MaxValueGetter instead. + + + + + A resolved string that should evaluate to a float value, which is used as the max bounds. + + + + + The name of a Vector2 field, property or method to get the min max values from. Obsolete; use MinMaxValueGetter instead. + + + + + A resolved string that should evaluate to a Vector2 value, which is used as the min/max bounds. If this is non-null, it overrides the behaviour of the MinValue, MinValueGetter, MaxValue and MaxValueGetter members. + + + + + Draw float fields for min and max value. + + + + + Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. + + The min value. + The max value. + If true number fields will drawn next to the MinMaxSlider. + + + + Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. + + A resolved string that should evaluate to a float value, which is used as the min bounds. + The max value. + If true number fields will drawn next to the MinMaxSlider. + + + + Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. + + The min value. + A resolved string that should evaluate to a float value, which is used as the max bounds. + If true number fields will drawn next to the MinMaxSlider. + + + + Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. + + A resolved string that should evaluate to a float value, which is used as the min bounds. + A resolved string that should evaluate to a float value, which is used as the max bounds. + If true number fields will drawn next to the MinMaxSlider. + + + + Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max. + + A resolved string that should evaluate to a Vector2 value, which is used as the min/max bounds. If this is non-null, it overrides the behaviour of the MinValue, MinValueGetter, MaxValue and MaxValueGetter members. + If true number fields will drawn next to the MinMaxSlider. + + + + Draws the checkbox before the label instead of after. + + ToggleLeftAttribute can be used an all fields and properties of type boolean + + + public class MyComponent : MonoBehaviour + { + [ToggleLeft] + public bool MyBoolean; + } + + + + + + LabelText is used to change the labels of properties. + Use this if you want a different label than the name of the property. + + + The following example shows how LabelText is applied to a few property fields. + + public MyComponent : MonoBehaviour + { + [LabelText("1")] + public int MyInt1; + + [LabelText("2")] + public int MyInt2; + + [LabelText("3")] + public int MyInt3; + } + + + + + + + The new text of the label. + + + + + Whether the label text should be nicified before it is displayed, IE, "m_someField" becomes "Some Field". + If the label text is resolved via a member reference, an expression, or the like, then the evaluated result + of that member reference or expression will be nicified. + + + + + Give a property a custom label. + + The new text of the label. + + + + Give a property a custom label. + + The new text of the label. + Whether to nicify the label text. + + + + Customize the behavior for lists and arrays in the inspector. + + + This example shows how you can add your own custom add button to a list. + + [ListDrawerSettings(HideAddButton = true, OnTitleBarGUI = "DrawTitleBarGUI")] + public List<MyType> SomeList; + + #if UNITY_EDITOR + private void DrawTitleBarGUI() + { + if (SirenixEditorGUI.ToolbarButton(EditorIcons.Plus)) + { + this.SomeList.Add(new MyType()); + } + } + #endif + + + + This attribute is scheduled for refactoring. + + + + + If true, the add button will not be rendered in the title toolbar. You can use OnTitleBarGUI to implement your own add button. + + + true if [hide add button]; otherwise, false. + + + + + If true, the remove button will not be rendered on list items. You can use OnBeginListElementGUI and OnEndListElementGUI to implement your own remove button. + + + true if [hide remove button]; otherwise, false. + + + + + Specify the name of a member inside each list element which defines the label being drawn for each list element. + + + + + Override the default behaviour for adding objects to the list. + If the referenced member returns the list type element, it will be called once per selected object. + If the referenced method returns void, it will only be called once regardless of how many objects are selected. + + + + + Calls a method before each list element. The member referenced must have a return type of void, and an index parameter of type int which represents the element index being drawn. + + + + + Calls a method after each list element. The member referenced must have a return type of void, and an index parameter of type int which represents the element index being drawn. + + + + + If true, object/type pickers will never be shown when the list add button is clicked, and default(T) will always be added instantly instead, where T is the element type of the list. + + + + + Whether adding a new element should copy the last element. False by default. + + + + + Override the default setting specified in the Advanced Odin Preferences window and explicitly tell whether paging should be enabled or not. + + + + + Override the default setting specified in the Advanced Odin Preferences window and explicitly tell whether items should be draggable or not. + + + + + Override the default setting specified in the Advanced Odin Preferences window and explicitly tells how many items each page should contain. + + + + + Mark a list as read-only. This removes all editing capabilities from the list such as Add, Drag and delete, + but without disabling GUI for each element drawn as otherwise would be the case if the was used. + + + + + Override the default setting specified in the Advanced Odin Preferences window and explicitly tell whether or not item count should be shown. + + + + + Override the default setting specified in the Advanced Odin Preferences window and explicitly tell whether or not the list should be expanded or collapsed by default. + + + + + If true, a label is drawn for each element which shows the index of the element. + + + + + Use this to inject custom GUI into the title-bar of the list. + + + + + Whether the Paging property is set. + + + + + Whether the ShowItemCount property is set. + + + + + Whether the NumberOfItemsPerPage property is set. + + + + + Whether the Draggable property is set. + + + + + Whether the IsReadOnly property is set. + + + + + Whether the Expanded property is set. + + + + + Whether the ShowIndexLabels property is set. + + + + + MaxValue is used on primitive fields. It caps value of the field to a maximum value. + Use this to define a maximum value for the field. + + + Note that this attribute only works in the editor! Values changed from scripting will not be capped at a maximum. + + + The following example shows a component where a speed value must be less than or equal to 200. + + public class Car : MonoBehaviour + { + // The speed of the car must be less than or equal to 200. + [MaxValue(200)] + public float Speed; + } + + + + The following example shows how MaxValue can be combined with . + + public class Health : MonoBehaviour + { + // The speed value must be between 0 and 200. + [MinValue(0), MaxValue(200)] + public float Speed; + } + + + + + + + The maximum value for the property. + + + + + The string with which to resolve a maximum value. This could be a field, property or method name, or an expression. + + + + + Sets a maximum value for the property in the inspector. + + The max value. + + + + Sets a maximum value for the property in the inspector. + + The string with which to resolve a maximum value. This could be a field, property or method name, or an expression. + + + + MinValue is used on primitive fields. It caps value of the field to a minimum value. + Use this to define a minimum value for the field. + + + Note that this attribute only works in the editor! Values changed from scripting will not be capped at a minimum. + + + The following example shows a player component that must have at least 1 life. + + public class Player : MonoBehaviour + { + // The life value must be set to at least 1. + [MinValue(1)] + public int Life; + } + + + + The following example shows how MinValue can be combined with + + public class Health : MonoBehaviour + { + // The health value must be between 0 and 100. + [MinValue(0), MaxValue(100)] + public float Health; + } + + + + + + + The minimum value for the property. + + + + + The string with which to resolve a minimum value. This could be a field, property or method name, or an expression. + + + + + Sets a minimum value for the property in the inspector. + + The minimum value. + + + + Sets a minimum value for the property in the inspector. + + The string with which to resolve a minimum value. This could be a field, property or method name, or an expression. + + + + MultiLineProperty is used on any string property. + Use this to allow users to edit strings in a multi line textbox. + + + MultiLineProperty is similar to Unity's but can be applied to both fields and properties. + + + The following example shows how MultiLineProperty is applied to properties. + + public class MyComponent : MonoBehaviour + { + [MultiLineProperty] + public string MyString; + + [ShowInInspector, MultiLineProperty(10)] + public string PropertyString; + } + + + + + + The number of lines for the text box. + + + + + Makes a multiline textbox for editing strings. + + The number of lines for the text box. + + + + PropertyTooltip is used on any property, and creates tooltips for when hovering the property in the inspector. + Use this to explain the purpose, or how to use a property. + + + This is similar to Unity's but can be applied to both fields and properties. + + + The following example shows how PropertyTooltip is applied to various properties. + + public class MyComponent : MonoBehaviour + { + [PropertyTooltip("This is an int property.")] + public int MyField; + + [ShowInInspector, PropertyTooltip("This is another int property.")] + public int MyProperty { get; set; } + } + + + + + + + + + + + The message shown in the tooltip. + + + + + Adds a tooltip to the property in the inspector. + + The message shown in the tooltip. + + + + ReadOnly is used on any property, and disabled the property from being changed in the inspector. + Use this for when you want to see the value of a property in the inspector, but don't want it to be changed. + + + This attribute only affects the inspector! Values can still be changed by script. + + + The following example shows how a field can be displayed in the editor, but not be editable. + + public class Health : MonoBehaviour + { + public int MaxHealth; + + [ReadOnly] + public int CurrentHealth; + } + + + + ReadOnly can also be combined with . + + public class Health : MonoBehaviour + { + public int MaxHealth; + + [ShowInInspector, ReadOnly] + private int currentHealth; + } + + + + + + + OnInspectorGUI is used on any property, and will call the specified function whenever the inspector code is running. + Use this to create custom inspector GUI for an object. + + + + + public MyComponent : MonoBehaviour + { + [OnInspectorGUI] + private void MyInspectorGUI() + { + GUILayout.Label("Label drawn from callback"); + } + } + + + + The following example shows how a callback can be set before another property. + + public MyComponent : MonoBehaviour + { + [OnInspectorGUI("MyInspectorGUI", false)] + public int MyField; + + private void MyInspectorGUI() + { + GUILayout.Label("Label before My Field property"); + } + } + + + + The following example shows how callbacks can be added both before and after a property. + + public MyComponent : MonoBehaviour + { + [OnInspectorGUI("GUIBefore", "GUIAfter")] + public int MyField; + + private void GUIBefore() + { + GUILayout.Label("Label before My Field property"); + } + + private void GUIAfter() + { + GUILayout.Label("Label after My Field property"); + } + } + + + + + + The resolved action string that defines the action to be invoked before the property is drawn, if any. + + + + + The resolved action string that defines the action to be invoked after the property is drawn, if any. + + + + + The name of the method to be called before the property is drawn, if any. Obsolete; use the Prepend member instead. + + + + + The name of the method to be called after the property is drawn, if any. Obsolete; use the Append member instead. + + + + + Calls a function decorated with this attribute, when the inspector is being drawn. + + + + + Adds callbacks to the specified action when the property is being drawn. + + The resolved action string that defines the action to be invoked. + If true the method will be called after the property has been drawn. Otherwise the method will be called before. + + + + Adds callbacks to the specified actions when the property is being drawn. + + The resolved action string that defines the action to be invoked before the property is drawn, if any. + The resolved action string that defines the action to be invoked after the property is drawn, if any. + + + + + OnValueChanged works on properties and fields, and calls the specified function + whenever the value has been changed via the inspector. + + + + Note that this attribute only works in the editor! Properties changed by script will not call the function. + + + The following example shows how OnValueChanged is used to provide a callback for a property. + + public class MyComponent : MonoBehaviour + { + [OnValueChanged("MyCallback")] + public int MyInt; + + private void MyCallback() + { + // .. + } + } + + + + The following example show how OnValueChanged can be used to get a component from a prefab property. + + public class MyComponent : MonoBehaviour + { + [OnValueChanged("OnPrefabChange")] + public GameObject MyPrefab; + + // RigidBody component of MyPrefab. + [SerializeField, HideInInspector] + private RigidBody myPrefabRigidbody; + + private void OnPrefabChange() + { + if(MyPrefab != null) + { + myPrefabRigidbody = MyPrefab.GetComponent<Rigidbody>(); + } + else + { + myPrefabRigidbody = null; + } + } + } + + + + + + Name of callback member function. Obsolete; use the Action member instead. + + + + + A resolved string that defines the action to perform when the value is changed, such as an expression or method invocation. + + + + + Whether to perform the action when a child value of the property is changed. + + + + + Whether to perform the action when an undo or redo event occurs via UnityEditor.Undo.undoRedoPerformed. True by default. + + + + + Adds a callback for when the property's value is changed. + + A resolved string that defines the action to perform when the value is changed, such as an expression or method invocation. + Whether to perform the action when a child value of the property is changed. + + + + Attribute to derive from if you wish to create a new property group type, such as box groups or tab groups. + Note that this attribute has special behaviour for "combining" several attributes into one, as one group, + may be declared across attributes in several members, completely out of order. See . + + + All group attributes for a group with the same name (and of the same attribute type) are combined into a single representative group attribute using the method, which is called by the method. + This behaviour is a little unusual, but it is important that you understand it when creating groups with many custom parameters that may have to be combined. + + + This example shows how could be implemented. + + [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] + public class BoxGroupAttribute : PropertyGroupAttribute + { + public string Label { get; private set; } + public bool ShowLabel { get; private set; } + public bool CenterLabel { get; private set; } + + public BoxGroupAttribute(string group, bool showLabel = true, bool centerLabel = false, float order = 0) + : base(group, order) + { + this.Label = group; + this.ShowLabel = showLabel; + this.CenterLabel = centerLabel; + } + + protected override void CombineValuesWith(PropertyGroupAttribute other) + { + // The given attribute parameter is *guaranteed* to be of type BoxGroupAttribute. + var attr = other as BoxGroupAttribute; + + // If this attribute has no label, we the other group's label, thus preserving the label across combines. + if (this.Label == null) + { + this.Label = attr.Label; + } + + // Combine ShowLabel and CenterLabel parameters. + this.ShowLabel |= attr.ShowLabel; + this.CenterLabel |= attr.CenterLabel; + } + } + + + + + + + + + + + The ID used to grouping properties together. + + + + + The name of the group. This is the last part of the group ID if there is a path, otherwise it is just the group ID. + + + + + The order of the group. + + + + + Whether to hide the group by default when all its children are not visible. True by default. + + + + + If not null, this resolved string controls the group's visibility. Note that if is true, there must be *both* a visible child *and* this condition must be true, before the group is shown. + + + + + Whether to animate the visibility changes of this group or make the visual transition instantly. True by default. + + + + + Initializes a new instance of the class. + + The group identifier. + The group order. + + + + Initializes a new instance of the class. + + The group identifier. + + + + Combines this attribute with another attribute of the same type. + This method invokes the virtual method to invoke custom combine logic. + All group attributes are combined to one attribute used by a single OdinGroupDrawer. + Example: protected override void CombineValuesWith(PropertyGroupAttribute other) { this.Title = this.Title ?? (other as MyGroupAttribute).Title; } + + The attribute to combine with. + The instance that the method was invoked on. + The argument 'other' was null. + + Attributes to combine are not of the same type. + or + PropertyGroupAttributes to combine must have the same group id. + + + + + Override this method to add custom combine logic to your group attribute. This method determines how your group's parameters combine when spread across multiple attribute declarations in the same class. + Remember, in .NET, member order is not guaranteed, so you never know which order your attributes will be combined in. + + The attribute to combine with. This parameter is guaranteed to be of the correct attribute type. + + This example shows how attributes are combined. + + protected override void CombineValuesWith(PropertyGroupAttribute other) + { + // The given attribute parameter is *guaranteed* to be of type BoxGroupAttribute. + var attr = other as BoxGroupAttribute; + + // If this attribute has no label, we the other group's label, thus preserving the label across combines. + if (this.Label == null) + { + this.Label = attr.Label; + } + + // Combine ShowLabel and CenterLabel parameters. + this.ShowLabel |= attr.ShowLabel; + this.CenterLabel |= attr.CenterLabel; + } + + + + + + PropertyOrder is used on any property, and allows for ordering of properties. + Use this to define in which order your properties are shown. + + + Lower order values will be drawn before higher values. + There is unfortunately no way of ensuring that properties are in the same order, as they appear in your class. PropertyOrder overcomes this. + + + The following example shows how PropertyOrder is used to order properties in the inspector. + + public class MyComponent : MonoBehaviour + { + [PropertyOrder(1)] + public int MySecondProperty; + + [PropertyOrder(-1)] + public int MyFirstProperty; + } + + + + + + The order for the property. + + + + + Initializes a new instance of the class. + + + + + Defines a custom order for the property. + + The order for the property. + + + + Required is used on any object property, and draws a message in the inspector if the property is missing. + Use this to clearly mark fields as necessary to the object. + + + The following example shows different uses of the Required attribute. + + public class MyComponent : MonoBehaviour + { + [Required] + public GameObject MyPrefab; + + [Required(InfoMessageType.Warning)] + public Texture2D MyTexture; + + [Required("MyMesh is nessessary for this component.")] + public Mesh MyMesh; + + [Required("MyTransform might be important.", InfoMessageType.Info)] + public Transform MyTransform; + } + + + + + + + + The message of the info box. + + + + + The type of the info box. + + + + + Adds an error box to the inspector, if the property is missing. + + + + + Adds an info box to the inspector, if the property is missing. + + The message to display in the error box. + The type of info box to draw. + + + + Adds an error box to the inspector, if the property is missing. + + The message to display in the error box. + + + + Adds an info box to the inspector, if the property is missing. + + The type of info box to draw. + + + + SceneObjectsOnly is used on object properties, and restricts the property to scene objects, and not project assets. + Use this when you want to ensure an object is a scene object, and not from a project asset. + + + The following example shows a component with a game object property, that must be from a scene, and not a prefab asset. + + public MyComponent : MonoBehaviour + { + [SceneObjectsOnly] + public GameObject MyPrefab; + } + + + + + + + ValueDropdown is used on any property and creates a dropdown with configurable options. + Use this to give the user a specific set of options to select from. + + + Due to a bug in Unity, enums will sometimes not work correctly. The last example shows how this can be fixed. + + + The following example shows a how the ValueDropdown can be used on an int property. + + public class MyComponent : MonoBehaviour + { + [ValueDropdown("myValues")] + public int MyInt; + + // The selectable values for the dropdown. + private int[] myValues = { 1, 2, 3 }; + } + + + + The following example shows how ValueDropdownList can be used for objects, that do not implement a usable ToString. + + public class MyComponent : MonoBehaviour + { + [ValueDropdown("myVectorValues")] + public Vector3 MyVector; + + // The selectable values for the dropdown, with custom names. + private ValueDropdownList<Vector3> myVectorValues = new ValueDropdownList<Vector3>() + { + {"Forward", Vector3.forward }, + {"Back", Vector3.back }, + {"Up", Vector3.up }, + {"Down", Vector3.down }, + {"Right", Vector3.right }, + {"Left", Vector3.left }, + }; + } + + + + The following example shows how the ValueDropdown can on any member that implements IList. + + public class MyComponent : MonoBehaviour + { + // Member field of type float[]. + private float[] valuesField; + + [ValueDropdown("valuesField")] + public float MyFloat; + + // Member property of type List<thing>. + private List<string> ValuesProperty { get; set; } + + [ValueDropdown("ValuesProperty")] + public string MyString; + + // Member function that returns an object of type IList. + private IList<ValueDropdownItem<int>> ValuesFunction() + { + return new ValueDropdownList<int> + { + { "The first option", 1 }, + { "The second option", 2 }, + { "The third option", 3 }, + }; + } + + [ValueDropdown("ValuesFunction")] + public int MyInt; + } + + + + Due to a bug in Unity, enums member arrays will in some cases appear as empty. This example shows how you can get around that. + + public class MyComponent : MonoBehaviour + { + // Make the field static. + private static MyEnum[] MyStaticEnumArray = MyEnum[] { ... }; + + // Force Unity to serialize the field, and hide the property from the inspector. + [SerializeField, HideInInspector] + private MyEnum MySerializedEnumArray = MyEnum[] { ... }; + } + + + + + + + Name of any field, property or method member that implements IList. E.g. arrays or Lists. Obsolete; use the ValuesGetter member instead. + + + + + A resolved string that should evaluate to a value that is assignable to IList; e.g, arrays and lists are compatible. + + + + + The number of items before enabling search. Default is 10. + + + + + False by default. + + + + + True by default. If the ValueDropdown attribute is applied to a list, then disabling this, + will render all child elements normally without using the ValueDropdown. The ValueDropdown will + still show up when you click the add button on the list drawer, unless is true. + + + + + False by default. + + + + + If the ValueDropdown attribute is applied to a list, and is set to true, then enabling this, + will exclude existing values, instead of rendering a checkbox indicating whether the item is already included or not. + + + + + If the dropdown renders a tree-view, then setting this to true will ensure everything is expanded by default. + + + + + If true, instead of replacing the drawer with a wide dropdown-field, the dropdown button will be a little button, drawn next to the other drawer. + + + + + Disables the the GUI for the appended drawer. False by default. + + + + + By default, a single click selects and confirms the selection. + + + + + By default, the dropdown will create a tree view. + + + + + Gets or sets the width of the dropdown. Default is zero. + + + + + Gets or sets the height of the dropdown. Default is zero. + + + + + Gets or sets the title for the dropdown. Null by default. + + + + + False by default. + + + + + Whether to draw all child properties in a foldout. + + + + + Creates a dropdown menu for a property. + + A resolved string that should evaluate to a value that is assignable to IList; e.g, arrays and lists are compatible. + + + + + + + + + Gets the label for the dropdown item. + + The label text for the item. + + + + Gets the value of the dropdown item. + + The value for the item. + + + + Use this with to specify custom names for values. + + The type of the value. + + + + Adds the specified value with a custom name. + + The name of the item. + The value. + + + + Adds the specified value. + + The value. + + + + + + + + + The name of the item. + + + + + The value of the item. + + + + + Initializes a new instance of the class. + + The text to display for the dropdown item. + The value for the dropdown item. + + + + The name of this item. + + + + + Gets the text. + + + + + Gets the value. + + + + + + + + + + The name of the item. + + + + + The value of the item. + + + + + Initializes a new instance of the class. + + The text to display for the dropdown item. + The value for the dropdown item. + + + + Gets the text. + + + + + Gets the value. + + + + + The name of this item. + + + + + ShowInInspector is used on any member, and shows the value in the inspector. Note that the value being shown due to this attribute DOES NOT mean that the value is being serialized. + + + This can for example be combined with to allow for live debugging of values. + + + + The following example shows how ShowInInspector is used to show properties in the inspector, that otherwise wouldn't. + + public class MyComponent : MonoBehaviour + { + [ShowInInspector] + private int myField; + + [ShowInInspector] + public int MyProperty { get; set; } + } + + + + + + TabGroup is used on any property, and organizes properties into different tabs. + Use this to organize different value to make a clean and easy to use inspector. + + + Use groups to create multiple tab groups, each with multiple tabs and even sub tabs. + + + The following example shows how to create a tab group with two tabs. + + public class MyComponent : MonoBehaviour + { + [TabGroup("First")] + public int MyFirstInt; + + [TabGroup("First")] + public int AnotherInt; + + [TabGroup("Second")] + public int MySecondInt; + } + + + + The following example shows how multiple groups of tabs can be created. + + public class MyComponent : MonoBehaviour + { + [TabGroup("A", "FirstGroup")] + public int FirstGroupA; + + [TabGroup("B", "FirstGroup")] + public int FirstGroupB; + + // The second tab group has been configured to have constant height across all tabs. + [TabGroup("A", "SecondGroup", true)] + public int SecondgroupA; + + [TabGroup("B", "SecondGroup")] + public int SecondGroupB; + + [TabGroup("B", "SecondGroup")] + public int AnotherInt; + } + + + + This example demonstrates how multiple tabs groups can be combined to create tabs in tabs. + + public class MyComponent : MonoBehaviour + { + [TabGroup("ParentGroup", "First Tab")] + public int A; + + [TabGroup("ParentGroup", "Second Tab")] + public int B; + + // Specify 'First Tab' as a group, and another child group to the 'First Tab' group. + [TabGroup("ParentGroup/First Tab/InnerGroup", "Inside First Tab A")] + public int C; + + [TabGroup("ParentGroup/First Tab/InnerGroup", "Inside First Tab B")] + public int D; + + [TabGroup("ParentGroup/Second Tab/InnerGroup", "Inside Second Tab")] + public int E; + } + + + + + + + The default tab group name which is used when the single-parameter constructor is called. + + + + + Name of the tab. + + + + + Should this tab be the same height as the rest of the tab group. + + + + + If true, the content of each page will not be contained in any box. + + + + + If true, the tab group will be hidden if it only contains one tab. + + + + + Organizes the property into the specified tab in the default group. + Default group name is '_DefaultTabGroup' + + The tab. + if set to true [use fixed height]. + The order. + + + + Organizes the property into the specified tab in the specified group. + + The group to attach the tab to. + The name of the tab. + Set to true to have a constant height across the entire tab group. + The order of the group. + + + + Name of all tabs in this group. + + + + + Combines the tab group with another group. + + The other group. + + + + Not yet documented. + + Not yet documented. + + + + Not yet documented. + + Not yet documented. + + + + Title is used to make a bold header above a property. + + + The following example shows how Title is used on different properties. + + public class TitleExamples : MonoBehaviour + { + [Title("Titles and Headers")] + [InfoBox( + "The Title attribute has the same purpose as Unity's Header attribute," + + "but it also supports properties, and methods." + + "\n\nTitle also offers more features such as subtitles, options for horizontal underline, bold text and text alignment." + + "\n\nBoth attributes, with Odin, supports either static strings, or refering to members strings by adding a $ in front.")] + public string MyTitle = "My Dynamic Title"; + public string MySubtitle = "My Dynamic Subtitle"; + + [Title("Static title")] + public int C; + public int D; + + [Title("Static title", "Static subtitle")] + public int E; + public int F; + + [Title("$MyTitle", "$MySubtitle")] + public int G; + public int H; + + [Title("Non bold title", "$MySubtitle", bold: false)] + public int I; + public int J; + + [Title("Non bold title", "With no line seperator", horizontalLine: false, bold: false)] + public int K; + public int L; + + [Title("$MyTitle", "$MySubtitle", TitleAlignments.Right)] + public int M; + public int N; + + [Title("$MyTitle", "$MySubtitle", TitleAlignments.Centered)] + public int O; + public int P; + + [Title("$Combined", titleAlignment: TitleAlignments.Centered)] + public int Q; + public int R; + + [ShowInInspector] + [Title("Title on a Property")] + public int S { get; set; } + + [Title("Title on a Method")] + [Button] + public void DoNothing() + { } + + public string Combined { get { return this.MyTitle + " - " + this.MySubtitle; } } + } + + + + + + + + The title displayed above the property in the inspector. + + + + + Optional subtitle. + + + + + If true the title will be displayed with a bold font. + + + + + Gets a value indicating whether or not to draw a horizontal line below the title. + + + + + Title alignment. + + + + + Creates a title above any property in the inspector. + + The title displayed above the property in the inspector. + Optional subtitle + Title alignment + Horizontal line + If true the title will be drawn with a bold font. + + + + Toggle is used on any field or property, and allows to enable or disable the property in the inspector. + Use this to create a property that can be turned off or on. + + + Toggle does current not support any static members for toggling. + + + The following example shows how Toggle is used to create a toggleable property. + + public class MyComponent : MonoBehaviour + { + [Toggle("Enabled")] + public MyToggleable MyToggler = new MyToggleable(); + } + + public class MyToggleable + { + public bool Enabled; + + public int MyValue; + } + + + + + + + + Name of any bool field or property to enable or disable the object. + + + + + If true, all other open toggle groups will collapse once another one opens. + + + + + Create a togglable property in the inspector. + + Name of any bool field or property to enable or disable the object. + + + + ToggleGroup is used on any field, and create a toggleable group of options. + Use this to create options that can be enabled or disabled. + + + The functions as the ID for the ToggleGroup, and therefore all members of a toggle group must specify the same toggle member. + This attribute does not support static members! + + + The following example shows how ToggleGroup is used to create two separate toggleable groups. + + public class MyComponent : MonoBehaviour + { + // This attribute has a title specified for the group. The title only needs to be applied to a single attribute for a group. + [ToggleGroup("FirstToggle", order: -1, groupTitle: "First")] + public bool FirstToggle; + + [ToggleGroup("FirstToggle")] + public int MyInt; + + // This group specifies a member string as the title of the group. A property or a function can also be used. + [ToggleGroup("SecondToggle", titleStringMemberName: "SecondGroupTitle")] + public bool SecondToggle { get; set; } + + [ToggleGroup("SecondToggle")] + public float MyFloat; + + [HideInInspector] + public string SecondGroupTitle = "Second"; + } + + + + "/> + + + + Title of the toggle group in the inspector. + If null will be used instead. + + + + + If true, all other open toggle groups will collapse once another one opens. + + + + + Creates a ToggleGroup. See . + + Name of any bool field or property to enable or disable the ToggleGroup. + The order of the group. + Use this to name the group differently than toggleMemberName. + + + + Creates a ToggleGroup. See . + + Name of any bool field or property to enable or disable the ToggleGroup. + Use this to name the group differently than toggleMemberName. + + + + Obsolete constructor overload. + + Obsolete overload. + Obsolete overload. + Obsolete overload. + Obsolete overload. + + + + Name of any bool field, property or function to enable or disable the ToggleGroup. + + + + + Name of any string field, property or function, to title the toggle group in the inspector. + If null will be used instead. + + + + + Combines the ToggleGroup with another ToggleGroup. + + Another ToggleGroup. + + + + ValidateInput is used on any property, and allows to validate input from inspector. + Use this to enforce correct values. + + + ValidateInput refuses invalid values. + ValidateInput only works in the editor. Values changed through scripting will not be validated. + + + The following examples shows how a speed value can be forced to be above 0. + + public class MyComponent : MonoBehaviour + { + [ValidateInput("ValidateInput")] + public float Speed; + + // Specify custom output message and message type. + [ValidateInput("ValidateInput", "Health must be more than 0!", InfoMessageType.Warning)] + public float Health; + + private bool ValidateInput(float property) + { + return property > 0f; + } + } + + + + The following example shows how a static function could also be used. + + public class MyComponent : MonoBehaviour + { + [ValidateInput("StaticValidateFunction")] + public int MyInt; + + private static bool StaticValidateFunction(int property) + { + return property != 0; + } + } + + + + + + + + Default message for invalid values. + + + + + Name of callback function to validate input. The function must have at least one parameter of the same type as the property. + + + + + A resolved string that should evaluate to a boolean value, and which should validate the input. Note that in expressions, the $value named parameter, and in methods, a parameter named value, can be used to get the validated value instead of referring to the value by its containing member. This makes it easier to reuse validation strings. + + + + + The type of the message. + + + + + Whether to also trigger validation when changes to child values happen. This is true by default. + + + + + If true, the validation method will not only be executed when the User has changed the value. It'll run once every frame in the inspector. + + + + + Initializes a new instance of the class. + + A resolved string that should evaluate to a boolean value, and which should validate the input. Note that in expressions, the $value named parameter, and in methods, a parameter named value, can be used to get the validated value instead of referring to the value by its containing member. This makes it easier to reuse validation strings. + Default message for invalid values. + Type of the message. + + + + Obsolete. Rejecting invalid input is no longer supported. Use the other constructors instead. + + Obsolete overload. + Obsolete overload. + Obsolete overload. + Obsolete overload. + + + + ShowIf is used on any property and can hide the property in the inspector. + Use this to hide irrelevant properties based on the current state of the object. + + + This example shows a component with fields hidden by the state of another field. + + public class MyComponent : MonoBehaviour + { + public bool ShowProperties; + + [ShowIf("showProperties")] + public int MyInt; + + [ShowIf("showProperties", false)] + public string MyString; + + public SomeEnum SomeEnumField; + + [ShowIf("SomeEnumField", SomeEnum.SomeEnumMember)] + public string SomeString; + } + + + + This example shows a component with a field that is hidden when the game object is inactive. + + public class MyComponent : MonoBehaviour + { + [ShowIf("MyVisibleFunction")] + public int MyHideableField; + + private bool MyVisibleFunction() + { + return this.gameObject.activeInHierarchy; + } + } + + + + + + + + + The name of a bool member field, property or method. Obsolete; use the Condition member instead. + + + + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + + + + + The optional condition value. + + + + + Whether or not to slide the property in and out when the state changes. + + + + + Shows a property in the inspector, based on the value of a resolved string. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Whether or not to slide the property in and out when the state changes. + + + + Shows a property in the inspector, if the resolved string evaluates to the specified value. + + A resolved string that defines the condition to check the value of, such as a member name or an expression. + Value to check against. + Whether or not to slide the property in and out when the state changes. + + + + Wrap is used on most primitive property, and allows for wrapping the value when it goes out of the defined range. + Use this when you want a value that goes around in circle, like for example an angle. + + + Currently unsigned primitives are not supported. + + + The following example show how Wrap is used on a property. + + public class MyComponent : MonoBehaviour + { + [Wrap(-100, 100)] + public float MyFloat; + } + + + + + + + The lowest value for the property. + + + + + The highest value for the property. + + + + + Wraps the value of the property round when the values goes out of range. + + The lowest value for the property. + The highest value for the property. + + + + Type of info message box. This enum matches Unity's MessageType enum which could not be used since it is located in the UnityEditor assembly. + + + + + Generic message box with no type. + + + + + Information message box. + + + + + Warning message box. + + + + + Error message box. + + +
+
diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml.meta new file mode 100644 index 00000000..3d2c5c15 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Attributes.xml.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93b27126aee925a42abd2896e56704b9 +timeCreated: 1602076756 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll new file mode 100644 index 00000000..498cac9f Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.mdb b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.mdb new file mode 100644 index 00000000..8d7d1cd3 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.mdb differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.mdb.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.mdb.meta new file mode 100644 index 00000000..8122e635 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.mdb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e2065b50daafb44da4a1781c391b85f +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.meta new file mode 100644 index 00000000..c0512dfb --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.dll.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: a4865f1ab4504ed8a368670db22f409c +timeCreated: 1488828285 +licenseType: Store +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude N3DS: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude PS4: 1 + Exclude PSM: 1 + Exclude PSP2: 1 + Exclude SamsungTV: 1 + Exclude Tizen: 1 + Exclude WebGL: 1 + Exclude WiiU: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 1 + Exclude XboxOne: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + Editor: + enabled: 1 + settings: + DefaultValueInitialized: true + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml new file mode 100644 index 00000000..b02943ff --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml @@ -0,0 +1,10843 @@ + + + + Sirenix.OdinInspector.Editor + + + + + An ActionResolver resolves a string to an action, given an InspectorProperty instance to use as context. Call to get an instance of an ActionResolver. + Action resolvers are a globally extendable system that can be hooked into and modified or changed by creating and registering an . + See Odin's tutorials for details and examples of how to use ActionResolvers. + + + + + The context of this ActionResolver, containing all of its configurations and values it needs to function. For performance and simplicity reasons, this is a single very large struct that is passed around by ref to anything that needs it. + + + + + The delegate that executes the actual action. You should not call this manually, but instead call . + + + + + The current error message that the resolver has, or null if there is no error message. This is a shortcut for writing "resolver.Context.ErrorMessage". + + + + + Whether there is an error message at the moment. This is a shortcut for writing "resolver.Context.ErrorMessage != null". + + + + + Draws an error message box if there is an error, and does nothing if there is no error. + + + + + Executes the resolved action for a given selection index. + + The selection index to execute the action on. Defaults to 0. + + + + Executes the action for all selection indices. + + + + + Creates a new action resolver instance for a given string. + + The property that is the context for the resolution to happen in. + The string that should be resolved to an action. + + + + Creates a new action resolver instance for a given string. + + The property that is the context for the resolution to happen in. + The string that should be resolved to an action. + The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. + + + + Gets a nicely formatted string that lists all the errors in the given set of action resolvers. The returned value is null if there are no errors. + + + + + Gets a nicely formatted string that lists all the errors in the given set of action resolvers. The returned value is null if there are no errors. + + + + + Draws error boxes for all errors in the given action resolvers, or does nothing if there are no errors. This is equivalent to calling DrawError() on all resolvers passed to this method. + + + + + Draws error boxes for all errors in the given action resolvers, or does nothing if there are no errors. This is equivalent to calling DrawError() on all resolvers passed to this method. + + + + + This struct contains all of an ActionResolver's configurations and values it needs to function. For performance and simplicity reasons, this is a single very large struct that lives on an ActionResolver instance and is passed around by ref to anything that needs it. + + + + + The property that *provides* the context for the action resolution. This is the instance that was passed to the resolver when it was created. Note that this is different from , which is based on this value, but almost always isn't the same InspectorProperty instance. + + + + + The string that is resolved to perform an action. + + + + + The error message, if a valid action resolution wasn't found, or if creation of the action resolver failed because was invalid, or if the action was executed but threw an exception. (In this last case, will be true.) + + + + + The named values that are available to the action resolver. Use this field only to get and set named values - once the ValueResolver has been created, new named values will have no effect. + + + + + Whether the action resolver should sync ref parameters of invoked methods with named values. If this is true, then if a ref or out parameter value is changed during action execution, the named value associated with that parameter will also be changed to the same value. + + + + + This will be true if is not null and the message was caused by an exception thrown by code invoked during execution of the resolved action. + + + + + Whether exceptions thrown during action execution should be logged to the console. + + + + + The type that is the parent of the action resolution, ie, the type that is the context. This is the same as .ValueEntry.TypeOfValue. + + + + + The property that *is* the context for the action resolution. This is not the instance that was passed to the resolver when it was created, but this value is based on that instance. This is the property that provides the actual context - for example, if is for a member of a type - or for an element in a collection contained by a member - this value will be the parent property for the type that contains that member. Only if is the tree's root property is the same as . + + + + + Gets the parent value which provides the context of the resolver. + + The selection index of the parent value to get. + + + + Sets the parent value which provides the context of the resolver. + + The selection index of the parent value to set. + The value to set. + + + + Adds the default named values of "property" and "value" to the context's named values. + This method is usually automatically invoked when a resolver is created, so there + is no need to invoke it manually. + + + + + A color palette. + + + + + Name of the color palette. + + + + + The colors. + + + + + Whether to show the alpha channel. + + + + + Add, Edit or remove custom color palettes used by the . + + You can modify the configuration in the Odin Preferences window found in 'Tools -> Odin Inspector -> Preferences -> Drawers -> Color Palettes', + or by locating the configuration file stored as a serialized object in the Sirenix folder under 'Odin Inspector/Config/Editor/ColorPaletteManager'. + + + + + + Specify the amount of spacing between each color in a color palette. + + + + + Specify the width of each color in a color palette. If StretchPalette is set to true, this will become the min-width. + + + + + If true, all color in a color palette is stretch so that the entire color-palette area is filled. + + + + + If true, a toolbar with the name of the color palette is shown above each color palette. + + + + + Gives you the list of all custom color palettes. + Remember to call UnityEditor.EditorUtility.SetDirty(ColorPaletteManager.Instance) after modifying the list. + + + + + Configurations for Odin DLLs import settings. + + + + + Gets or sets a value indicating whether or not Odin should automatically configure the import settings of its DLLs in a preprocess build step. + Keep in mind that this feature is only supported by Unity version 5.6 and up. + + + + + Gets a value indicating whether or not automatic configuration of Odin's DLL import settings is supported by the current Unity version. + + + + + Installed Odin Inspector Version Info. + + + + + Gets the name of the current running version of Odin Inspector. + + + + + Gets the current running version of Odin Inspector. + + + + + Whether the current version of Odin is an enterprise version. + + + + + This is a class for creating, getting and modifying a property's various states. An instance of this class always comes attached to an InspectorProperty. + See Odin's tutorials for more information about usage of the state system. + + + + + If set to true, all state changes for this property will be logged to the console. + + + + + Whether the property is visible in the inspector. + + + + + Whether the Visible state was true or not during the last layout event. + + + + + Whether the property is enabled in the inspector. + + + + + Whether the Enabled state was true or not during the last layout event. + + + + + Whether the property is expanded in the inspector. + + + + + Whether the Expanded state was true or not during the last layout event. + + + + + Creates a custom state with a given name. + + + + + + + + + Determines whether a state with the given key exists. + + The key to check. + True if the state exists, otherwise, false. + + + + Determines whether a state with the given key exists. + + The key to check. + If the state exists, this out parameter will be true if the state is persistent. + True if the state exists, otherwise, false. + + + + Determines whether a state with the given key exists. + + The key to check. + If the state exists, this out parameter will contain the type of value that the state contains. + True if the state exists, otherwise, false. + + + + Determines whether a state with the given key exists. + + The key to check. + If the state exists, this out parameter will be true if the state is persistent. + If the state exists, this out parameter will contain the type of value that the state contains. + True if the state exists, otherwise, false. + + + + Gets the value of a given state as an instance of type T. + + The type to get the state value as. An will be thrown if the state's value type cannot be assigned to T. + The key of the state to get. An will be thrown if a state with the given key does not exist. + The value of the state. + + + + Gets the value that a given state contained last layout as an instance of type T. + + The type to get the state value as. An will be thrown if the state's value type cannot be assigned to T. + The key of the state to get. An will be thrown if a state with the given key does not exist. + The value of the state during the last layout event. + + + + Sets the value of a given state to a given value. + + The type to set the state value as. An will be thrown if T cannot be assigned to the state's value type. + The key of the state to set the value of. An will be thrown if a state with the given key does not exist. + The value to set. + + + + Cleans the property state and prepares it for cached reuse of its containing PropertyTree. This will also reset the state. + + + + + Resets all states to their default values. Persistent states will be updated to their persistent cached value if one exists. + + + + + Contains information about a change that is going to occur/has occurred to a collection. + + + + + + Specifies the kinds of changes that can occur to collections. + + + + + Unknown collection change, the change was not specified by the invoking code. + + + + + The change is adding a value to the collection. Value and SelectionIndex will be set. + + + + + The change is inserting a value into the collection. Index, Value and SelectionIndex will be set. + + + + + The change is removing a value from the collection. Value and SelectionIndex will be set. + + + + + The change is removing a value at an index from the collection. Index and SelectionIndex will be set. + + + + + The change is clearing the collection. SelectionIndex will be set. + + + + + The change is removing a key from the collection. Key and SelectionIndex will be set. + + + + + The change is setting the value of a key in the collection. Key, Value and SelectionIndex will be set. + + + + + Handles all prefab modifications that apply to the targets of a property tree, if any. This class determines which properties have modifications, what the modifications are, auto-applies modifications if the current instance values do not correspond to the prefab values, and also provides an API for modifying those modifications. + NOTE: This class is liable to see a lot of changes, as the prefab modification system is slated to be redesigned for increased extendability in the future. Do not depend overly on the current API. + + + + + The prefabs for each prefab instance represented by the property tree, if any. + + + + + Whether any of the values the property tree represents are prefab instances. + + + + + A prefab tree for the prefabs of this property tree's prefab instances, if any exist. + + + + + Gets the prefab modification type of a given property, if any. + + The property to check. + + + The prefab modification type of the property if it has one, otherwise null. + + + + + Registers a modification of type for a given property. + + The property to register a modification for. + Selection index of the target to register a modification for. + The modified list length. + + Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + or + newLength cannot be negative! + + + + + Registers a modification of type for a given property. + + The property to register a modification for. + Selection index of the target to register a modification for. + Whether to force the change to be registered immediately, rather than at the end of frame. + Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + + + + Calculates a delta between the current dictionary property and its prefab counterpart, and registers that delta as a modification. + + The property to register a modification for. + Selection index of the target. + Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + + + + Adds a remove key modification to the dictionary modifications of a given property. + + The property to register a modification for. + Selection index of the target. + The key to be removed. + Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + + + + Adds an add key modification to the dictionary modifications of a given property. + + The property to register a modification for. + Selection index of the target. + The key to be added. + Property " + property.Path + " does not have a value entry; cannot register prefab modification to this property. + + + + Removes all dictionary modifications on a property for a given dictionary key value. + + The property to remove a key modification for. + Selection index of the target. + The key to remove modifications for. + key + + + + Removes all prefab modifications of a given type on a given property. + + The property to remove modifications for. + Selection index of the target. + Type of the modification to remove. + + + + Gets all prefab modifications in this property tree for a given selection index. + + + + + + + Default implementation and the version that will be used when no other OdinAttributeProcessorLocator instance have been given to a PropertyTree. + This implementation will find all AttributeProcessor definitions not marked with the . + + + + + Singleton instance of the DefaultOdinAttributeProcessorLocator class. + + + + + Type search index used for matching to properties. + + + + + Gets a list of to process attributes for the specified child member of the parent property. + + The parent of the member. + Child member of the parent property. + List of to process attributes for the specified member. + + + + Gets a list of to process attributes for the specified property. + + The property to find attribute porcessors for. + List of to process attributes for the speicied member. + + + + This attribute processor will take any attribute already applied to the property with the applied to, + and take all attributes applied to the attribute (except any ) and add to them to the property. + This allows for adding attributes to attributes in the property system. + + + + + Looks for attributes in the attributes list with a applied, and adds the attribute from those attributes to the property. + + The parent of the member. + The member that is being processed. + The list of attributes currently applied to the property. + + + + Finds all attributes attached to the specified member and adds to them to attribute list. + + + + + This attribute processor can only process for members. + + The property to process. + false. + + + + Finds all attributes attached to the specified member and adds to them to the attributes list. + + The parent property of the specified member. + The member to process attributes for. + The current attributes applied to the property. + + + + Attribute processor that can add, change and remove attributes from a property. + + + + + Instanciates an OdinAttributeProcessor instance of the specified type. + + The type of processor to instanciate. The type must inherit from . + A new instance of the specified type. + + + + Checks if the processor can process attributes for the specified member. + + The parent property of the member. + The member to be processed. + true if the processor can process for the specified member. Otherwise false. + + + + Checks if the processor can process attributes for the specified property. + + The property to process. + true if the processor can process attributes for the specified property. Otherwise false. + + + + Processes attributes for the specified member. + + The parent property of the specified member. + The member to process attributes for. + The current attributes applied to the property. + + + + Processes attributes for the specified property. + + The property to process attributes for. + The current attributes applied to the property. + + + + Attribute processor that can add, change and remove attributes from a property. + + + + + Base class definition for OdinAttributeProcessorLocator. Responsible for finding and creating instances to process attributes for properties. + Default OdinAttributeProcessorLocator have been implemented as . + + + + + Gets a list of to process attributes for the specified child member of the parent property. + + The parent of the member. + Child member of the parent property. + List of to process attributes for the specified member. + + + + Gets a list of to process attributes for the specified property. + + The property to find attribute porcessors for. + List of to process attributes for the speicied member. + + + + Find attributes attached to the type definition of a property and adds to them to attribute list. + + + + + This attribute processor can only process for properties. + + The parent of the specified member. + The member to process. + false. + + + + This attribute processor can only process for properties with an attached value entry. + + The property to process. + true if the specified property has a value entry. Otherwise false. + + + + Finds all attributes attached to the type and base types of the specified property value and adds them to the attribute list. + + The property to process. + The list of attributes for the property. + + + + Default implementation and the version that will be used by if no other instance have been specified. + + + + + Singleton instance of . + + + + + Gets an instance for the specified property. + + The property to get an instance for. + An instance of to resolver the specified property. + + + + Base class for locator of . Use for default implementation. + + + + + Gets an instance for the specified property. + + The property to get an instance for. + An instance of to resolver the specified property. + + + + Note: this interface may be temporary, and may eventually be substituted for a public-facing way of extending the prefab modification system. + + For now, it only exists to denote which internally defined resolvers support prefab modifications being set. + + + + + Responsible for getting and setting values on properties. + + The type of the owner. + The type of the value. + + + + + Whether the value is readonly. + + + + + Gets the type of the owner. + + + + + Gets the type of the value. + + + + + Initializes a new instance of the class. + + The field member to represent. + if set to true [is readonly]. + + + + Initializes a new instance of the class. + + The getter. + The setter. + getter + + + + Initializes a new instance of the class. + + The getter. + The setter. + getter + + + + Gets the value from a given owner. + + The owner. + The found value. + owner is null + + + + Gets the value from a given weakly typed owner. + + The weakly typed owner. + The found value. + + + + Sets the weakly typed value on a given weakly typed owner. + + The owner. + The value. + + + + Sets the value on a given owner. + + The owner. + The value. + + + + Gets all s for a given type. + + The parent property. + The type to get infos for. + if set to true members that are serialized by Odin will be included. + + + + Gets an aliased version of a member, with the declaring type name included in the member name, so that there are no conflicts with private fields and properties with the same name in different classes in the same inheritance hierarchy. + + + + + Gets the attribute that the OdinAttributeStateUpdater applies to. + + + + + Gets the strongly typed ValueEntry of the OdinAttributeStateUpdater's property. + + + + + Gets the strongly typed ValueEntry of the OdinValueStateUpdater's property. + + + + + Initializes this instance. + + + + + Draws the property with GUILayout support. This method is called by DrawPropertyImplementation if the GUICallType is set to GUILayout, which is the default. + + + + + Draws members marked with . + + + + + Draws a warning message for non-serialized properties that sports both the SerializeField and the ShowInInspector attribute. + + + + + Determines if the drawer can draw the property. + + The property to test. + true if the drawer can draw the property; otherwise false. + + + + Initializes the drawer. + + + + + Draws the warning message and calls the next drawer. + + The label for the property. + + + + Draws properties marked with . + + + + + + + + + + Draws a space for properties marked with the PropertySpace attribute. + + + + + Initializes this instance. + + + + + Draws the property. + + + + + Drawer for the ShowPropertyResolver attribute. + + + + + + TextArea attribute drawer. + + + + + Draws the property in the Rect provided. This method does not support the GUILayout, and is only called by DrawPropertyImplementation if the GUICallType is set to Rect, which is not the default. + If the GUICallType is set to Rect, both GetRectHeight and DrawPropertyRect needs to be implemented. + If the GUICallType is set to GUILayout, implementing DrawPropertyLayout will suffice. + + The label. This can be null, so make sure your drawer supports that. + + + + Draws properties marked with . + + + + + Initializes this instance. + + + + + Draws the property with GUILayout support. This method is called by DrawPropertyImplementation if the GUICallType is set to GUILayout, which is the default. + + + + + Drawer for the ResponsiveButtonGroupAttribute. + + + + + Draws the property with GUILayout support. + + + + + Drawer for the attribute. + + + + + Draws the property. + + + + + The default method drawer that draws most buttons. + + + + + Initializes this instance. + + + + + Draws the property layout. + + + + + Draws Color properties marked with . + + + + + Draws the property. + + + + + Draws char properties marked with . + + + + + Draws the property. + + + + + Draws string properties marked with . + + + + + Draws the property. + + + + + Draws sbyte properties marked with . + + + + + Draws the property. + + + + + Draws byte properties marked with . + + + + + Draws the property. + + + + + Draws short properties marked with . + + + + + Draws the property. + + + + + Draws ushort properties marked with . + + + + + Draws the property. + + + + + Draws int properties marked with . + + + + + Draws the property. + + + + + Draws uint properties marked with . + + + + + Draws the property. + + + + + Draws long properties marked with . + + + + + Draws the property. + + + + + Draws ulong properties marked with . + + + + + Draws the property. + + + + + Draws float properties marked with . + + + + + Draws the property. + + + + + Draws double properties marked with . + + + + + Draws the property. + + + + + Draws decimal properties marked with . + + + + + Draws the property. + + + + + Odin drawer for the . + + + + + Returns true if the drawer can draw the type. + + + + + Draws the property. + + + + + Draws properties marked with as a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + + + + Draws the property. + + + + + The TableList attirbute drawer. + + + + + + Determines whether this instance [can draw attribute property] the specified property. + + + + + Initializes this instance. + + + + + Draws the property layout. + + + + + Draws Color properties marked with . + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + Not yet documented. + + + + + Initializes the drawer. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Initializes the drawer. + + + + + Not yet documented. + + + + + Adds customs generic menu options. + + + + + Draws properties marked with + + + + + Draws the property. + + + + + Draws properties marked with the . + + + + + + + + + + + + Draws the attribute. + + + + + + When first learning to use the Odin Inspector, it is common for people to misunderstand the OdinSerialize attribute, + and use it in places where it does not achive the deceired goal. + + + This drawer will display a warning message if the OdinSerialize attribute is potentially used in such cases. + + + + + + + Draws The Property. + + + + + Common base implementation for progress bar attribute drawers. + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Generic implementation of progress bar field drawing. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a byte property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a sbyte property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a short property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a ushort property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for an int property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a uint property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a long property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a ulong property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a float property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a double property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws values decorated with . + + + + + + + Draws a progress bar for a decimal property. + + + + + Converts the generic value to a double. + + The generic value to convert. + The generic value as a double. + + + + Draws byte properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws double properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws float properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws decimal properties marked with . + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws short properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws int properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws long properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws sbyte properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws ushort properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws uint properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws ulong properties marked with . + + + + + + + + + + + Initialized the drawer. + + + + + Draws the property. + + + + + Draws an enum in a horizontal button group instead of a dropdown. + + + + + Returns true if the drawer can draw the type. + + + + + Draws the property. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Draws char properties marked with . + + + + + Draws the property. + + + + + Draws string properties marked with . + + + + + Draws the property. + + + + + Draws sbyte properties marked with . + + + + + Draws the property. + + + + + Draws byte properties marked with . + + + + + Draws the property. + + + + + Draws short properties marked with . + + + + + Draws the property. + + + + + Draws ushort properties marked with . + + + + + Draws the property. + + + + + Draws int properties marked with . + + + + + Draws the property. + + + + + Draws uint properties marked with . + + + + + Draws the property. + + + + + Draws long properties marked with . + + + + + Draws the property. + + + + + Draws ulong properties marked with . + + + + + Draws the property. + + + + + Draws float properties marked with . + + + + + Draws the property. + + + + + Draws double properties marked with . + + + + + Draws the property. + + + + + Draws decimal properties marked with . + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + + + + Initializes this instance. + + + + + Draws the property. + + + + + Draws properties marked with . + This drawer sets the current GUI color, before calling the next drawer in the chain. + + + + + + + + + + Draws the property. + + + + + Static GUI information reguarding the InlineEditor attribute. + + + + + Gets a value indicating how many InlineEditors we are currently in. + + + + + Draws properties marked with . + + + + + + + Initializes this instance. + + + + + Draws the property layout. + + The label. + + + + Draws Vector2 properties marked with . + + + + + + + + + + + Show drawer chain attribute drawer. + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + Initializes this instance. + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + Draws the property. + + + + + Draws byte properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws double properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws float properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws decimal properties marked with . + + + + + Draws the property. + + + + + Draws short properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws int properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws long properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws sbyte properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws ushort properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws uint properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws ulong properties marked with . + + + + + + + + + + + Draws the property. + + + + + Draws properties marked with . + Calls the properties ToString method to get the string to draw. + + + + + + + + + + + Draws the property. + + + + + Drawer for the + + + + + + Draws the property. + + + + + Drawer for the + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + + Draws the property. + + + + + Char property drawer. + + + + + Draws the property. + + + + + Delegate property drawer. This drawer is rather simplistic for now, and will receive significant upgrades in the future. + + + + + See . + + + + + Draws the property. + + + + + Property drawer for . + + + + + Draws the property. + + + + + Base class to derive from for value drawers that merely wish to cause a value to be drawn by Unity. + + + + + Draws the property. + + + + + Gradient property drawer. + + + + + Int property drawer. + + + + + Draws the property. + + + + + The GUIStyleState Drawer + + + + + + Initializes this instance. + + + + + Draws the property with GUILayout support. + + + + + LayerMask property drawer. + + + + + Draws the property. + + + + + Base class for two-dimensional array drawers. + + + + + Override this method in order to define custom type constraints to specify whether or not a type should be drawn by the drawer. + Note that Odin's has full support for generic class constraints, so most often you can get away with not overriding CanDrawTypeFilter. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Draws the property. + + + + + This method gets called from DrawPropertyLayout right before the table and error message is drawn. + + + + + Compares the element. + + + + + Draws a table cell element. + + The rect. + The input value. + The output value. + + + + Draws the element. + + + + + Property drawer for nullables. + + + + + Draws the property. + + + + + Quaternion property drawer. + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + + + + Type property drawer + + + + + + Draws the property. + + + + + Draws properties marked with . + Displays a configurable list of assets, where each item can be enabled or disabled. + + + + + + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + + + + Odin drawer for . + + + + + Initializes the drawer. + + + + + Not yet documented. + + + + + Adds a generic menu option to properties marked with . + + + + + + + + Populates the generic menu for the property. + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + Draws the property. + + + + + Draws properties marked with . + Draws an info box above the property. Error and warning info boxes can be tracked by Odin Scene Validator. + + + + + + + + + Draws the property. + + + + + Draws properties marked with . + Creates a new GUIContent, with the provided label text, before calling further down in the drawer chain. + + + + + + + + + + + + Draws the attribute. + + + + + Draws string properties marked with . + This drawer only works for string fields, unlike . + + + + + + + + + + Draws the property. + + + + + Draws string properties marked with . + This drawer works for both string field and properties, unlike . + + + + + + + + + + Draws the property. + + + + + Draws properties marked with . + Calls the method, the attribute is either attached to, or the method that has been specified in the attribute, to allow for custom GUI drawing. + + + + + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + + + + + Draws properties marked with . + + + + + Draws the property. + + + + + Initializes this instance. + + + + + Draws the property with GUILayout support. This method is called by DrawPropertyImplementation if the GUICallType is set to GUILayout, which is the default. + + + + + Draws properties marked with . + + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + Draws the property. + + + + + Draws all Unity DecoratorDrawers within prepend attribute drawers within Odin. + + + + + Initializes the class. + + + + + Draws the property. + + + + + Draws all properties grouped together with the + + + + + + Initializes this instance. + + + + + Draws the property. + + + + + Draws all properties grouped together with the + + + + + + Draws the property. + + + + + Draws all properties grouped together with the + + + + + + Initializes this instance. + + + + + Draws the property. + + + + + Draws all properties grouped together with the + + + + + + Draws the property. + + + + + Draws properties marked with . + + + + + + Draws the property. + + + + + Draws all properties grouped together with the + + + + + + Draws the property. + + + + + Draws all nullable reference types, with an object field. + + + + + Draws the property. + + + + + Returns a value that indicates if this drawer can be used for the given property. + + + + + Evaluates all strings, enums and primitive types and ensures EditorGUI.showMixedValue is true if there are any value conflicts in the current selection. + + + + + Sets the drawer to only be evaluated on primitive types, strings and enums. + + + + + Draws the property. + + + + + Adds the right click area. + + + + + Opens a context menu for any given property on right click. The context menu is populated by all relevant drawers that implements . + + + + + + Initializes the drawer. + + + + + Draws the property. + + + + + Draws all reference type properties, which has already been drawn elsewhere. This drawer adds an additional foldout to prevent infinite draw depth. + + + + + Prevents the drawer from being applied to UnityEngine.Object references since they are shown as an object field, and is not drawn in-line. + + + + + Draws the property. + + + + + Draws properties with a set. + + + + + Draws the property. + + + + + + When multiple objects are selected and inspected, this his drawer ensures UnityEditor.EditorGUI.showMixedValue + gets set to true if there are any conflicts in the selection for any given property. + Otherwise the next drawer is called. + + This drawer also implements and provides a right-click context menu item for resolving conflicts if any. + + + + + Draws the property. + + + + + Animation curve property drawer. + + + + + Bool property drawer. + + + + + Draws the property. + + + + + Byte property drawer. + + + + + Draws the property. + + + + + Color32 property drawer. + + + + + Draws the property. + + + + + Color property drawer. + + + + + Draws the property. + + + + + Color palette property drawer. + + + + + Draws the property. + + + + + Drawer for composite properties. + + + + + Draws the property. + + + + + Decimal property drawer. + + + + + Draws the property. + + + + + Double property drawer. + + + + + Draws the property. + + + + + Enum property drawer. + + + + + Returns true if the drawer can draw the type. + + + + + Draws the property. + + + + + Short property drawer. + + + + + Draws the property. + + + + + Int property drawer. + + + + + Draws the property. + + + + + Long property drawer. + + + + + Draws the property. + + + + + Property drawer for anything that has a . + + + + + Initializes the drawer. + + + + + Draws the property. + + + + + SByte property drawer. + + + + + Draws the property. + + + + + Float property drawer. + + + + + Draws the property. + + + + + String property drawer. + + + + + Draws the property. + + + + + Ushort property drawer. + + + + + Draws the property. + + + + + Uint property drawer. + + + + + Draws the property. + + + + + Ulong property drawer. + + + + + Draws the property. + + + + + Unity event drawer. + + + + + Draws the property. + + + + + Unity object drawer. + + + + + Initializes this instance. + + + + + Draws the property. + + + + + Vector2 proprety drawer. + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + + + + Vector3 property drawer. + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + + + + Vector4 property drawer. + + + + + Draws the property. + + + + + Populates the generic menu for the property. + + + + + Draws the property. + + + + + Descripes an attribute example. + + + + + The type of the example object. + + + + + The name of the example. + + + + + The description of the example. + + + + + Raw code of the example. + + + + + Sorting value of the example. Examples with lower order values should come before examples with higher order values. + + + + + Preview object of the example. + + + + + Extension method for List<Attribute> + + + + + Determines whether the list contains a specific attribute. + + The type of attribute. + The attribute list. + + true if the specified attribute list has attribute; otherwise, false. + + + + + Adds the attribute if not exist. + + The type of attribute. + The attribute list. + + + + + Adds the attribute if not exist. + + The type of attribute. + The attribute list. + + + + + Adds the attribute if not exist. + + The type of attribute. + The attribute list. + + + + + Adds the attribute if not exist. + + The type of attribute. + The attribute list. + The attribute. + + + + + Removes the type of the attribute of. + + The type of attribute. + The attribute list. + + + + + Odin has its own implementations for these attribute drawers; never use Unity's. + + + + + Gets the priority of a given drawer type. + + + + + Helper class to get values from InspectorProperties. This class is deprecated and fully replaced by . + + + + + If any error occurred while looking for members, it will be stored here. + + + + + Gets the referenced member information. + + + + + Gets the value. + + + + + Gets all values from all targets. + + + + + The content padding + + + + + Draws the menu tree. + + + + + Gets the value selected value. + + + + + Invokes BuildMenuTree. + + + + + Use this attribute to prevent a type from being included in Odin systems. + The attribute can be applied to Odin drawers, Odin property resolvers and Odin attribute processor types. + + + + + To safely change anything in the type cache, you must be holding this lock. + + + + + Put this attribute on a validator class to prevent the ValidatorDrawer from running that validator in the inspector. + Typically you would use this for a validation-related attribute that has its own, complex custom drawer that should + handle the validation and error/warning drawing while the inspector is being drawn, but still needs a validator to + run for the project validation scans. + + + + + Apply this to an assembly to register validators for the validation system. + This enables locating of all relevant validator types very quickly. + + + + + This attribute can be placed on an assembly to register a value resolver creator that should be queried when a value resolver is being created. + + + + + This attribute can be placed on an assembly to register a value resolver creator that should be queried when a value resolver is being created. + + The resolver + + + + + A ValueResolver resolves a string to a value of a given type, given an InspectorProperty instance to use as context. Call to get an instance of a ValueResolver. + Value resolvers are a globally extendable system that can be hooked into and modified or changed by creating and registering a . + See Odin's tutorials for details and examples of how to use ValueResolvers. + + + + + The context of this ValueResolver, containing all of its configurations and values it needs to function. For performance and simplicity reasons, this is a single very large struct that is passed around by ref to anything that needs it. + + + + + The current error message that the resolver has, or null if there is no error message. This is a shortcut for writing "resolver.Context.ErrorMessage". + + + + + Whether there is an error message at the moment. This is a shortcut for writing "resolver.Context.ErrorMessage != null". + + + + + The type of value that this resolver instance is supposed to get. + + + + + Gets a value from the value resolver in a weakly typed manner. + + The selection index at which to get the value, in the case of multi-selection. Defaults to 0. + The value that was gotten. + + + + Draws an error message box if there is an error, and does nothing if there is no error. + + + + + Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. + This is useful when you don't know at compile time which type you want to resolve. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + + + + Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. + This is useful when you don't know at compile time which type you want to resolve. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. + + + + Creates a new value resolver instance. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + + + + Creates a new value resolver instance. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. + + + + Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. + This is useful when you don't know at compile time which type you want to resolve. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. + + + + Creates a new value resolver instance in a weakly typed fashion, though the result is the same as using a strongly typed generic overload. + This is useful when you don't know at compile time which type you want to resolve. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. + The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. + + + + Creates a new value resolver instance meant to resolve a string value in particular. This is a shorthand for creating a string resolver that has the resolved string as a fallback value. + This special case will get you the behaviour where, if you pass in a string that is not meant to be resolved in a special way, the value resolver will just pass you that string back as the result value. + + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + + + + Creates a new value resolver instance meant to resolve a string value in particular. This is a shorthand for creating a string resolver that has the resolved string as a fallback value. + This special case will get you the behaviour where, if you pass in a string that is not meant to be resolved in a special way, the value resolver will just pass you that string back as the result value. + + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. + + + + Creates a new value resolver instance. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. + + + + Creates a new value resolver instance. + + The type of value that the new resolver should resolve. + The property that is the context for the resolution to happen in. + The string that should be resolved to a value. + The value that the resolver should return if the string cannot be resolved to anything, or if there is an error in creating a resolver, or if resolution itself throws an exception. + The extra named args that this resolver has access to. Passing in a named arg that already exists will silently override the pre-existing named arg. + + + + Gets a nicely formatted string that lists all the errors in the given set of value resolvers. The returned value is null if there are no errors. + + + + + Gets a nicely formatted string that lists all the errors in the given set of value resolvers. The returned value is null if there are no errors. + + + + + Draws error boxes for all errors in the given value resolvers, or does nothing if there are no errors. This is equivalent to calling DrawError() on all resolvers passed to this method. + + + + + Draws error boxes for all errors in the given value resolvers, or does nothing if there are no errors. This is equivalent to calling DrawError() on all resolvers passed to this method. + + + + + A ValueResolver resolves a string to a value of a given type, given an InspectorProperty instance to use as context. Call to get an instance of a ValueResolver. + Value resolvers are a globally extendable system that can be hooked into and modified or changed by creating and registering a . + See Odin's tutorials for details and examples of how to use ValueResolvers. + + + + + The delegate that does the actual value resolution. You should not call this manually, but instead call . + + + + + The type of value that this resolver instance is supposed to get. Always equal to typeof(). + + + + + Gets a value from the value resolver. + + The selection index at which to get the value, in the case of multi-selection. Defaults to 0. + The value that was gotten. + + + + Gets a value from the value resolver in a weakly typed manner. + + The selection index at which to get the value, in the case of multi-selection. Defaults to 0. + The value that was gotten. + + + + This struct contains all of a ValueResolver's configurations and values it needs to function. For performance and simplicity reasons, this is a single very large struct that lives on a ValueResolver instance and is passed around by ref to anything that needs it. + + + + + The type of value that the resolver is resolving. + + + + + The property that *provides* the context for the value resolution. This is the instance that was passed to the resolver when it was created. Note that this is different from , which is based on this value, but almost always isn't the same InspectorProperty instance. + + + + + The string that is resolved to get a value. + + + + + The error message, if a valid value resolution wasn't found, or if creation of the value resolver failed because was invalid, or if value resolution was run but threw an exception. (In this last case, will be true.) + + + + + The named values that are available to the value resolver. Use this field only to get and set named values - once the ValueResolver has been created, new named values will have no effect. + + + + + Whether the value resolver should sync ref parameters of invoked methods with named values. If this is true, then if a ref or out parameter value is changed during value resolution, the named value associated with that parameter will also be changed to the same value. + + + + + This is the fallback value that the value resolver will return if there is an error or failed resolution for any reason. + + + + + Whether there is a fallback value. This boolean exists because then null is also a valid fallback value. This boolean will always be true if an overload is used that takes a fallback value parameter. + + + + + This will be true if is not null and the message was caused by an exception thrown by code invoked during an actual value resolution. + + + + + Whether exceptions thrown during value resolution should be logged to the console. + + + + + The type that is the parent of the value resolution, ie, the type that is the context. This is the same as .ValueEntry.TypeOfValue. + + + + + The property that *is* the context for the value resolution. This is not the instance that was passed to the resolver when it was created, but this value is based on that instance. This is the property that provides the actual context - for example, if is for a member of a type - or for an element in a collection contained by a member - this value will be the parent property for the type that contains that member. Only if is the tree's root property is the same as . + + + + + Gets the parent value which provides the context of the resolver. + + The selection index of the parent value to get. + + + + Sets the parent value which provides the context of the resolver. + + The selection index of the parent value to set. + The value to set. + + + + Adds the default named values of "property" and "value" to the context's named values. + This method is usually automatically invoked when a resolver is created, so there + is no need to invoke it manually. + + + + + The Odin Getting Started Window + + + + + + Shows the window. + + + + + Initialize get called by OnEnable and by OnGUI after assembly reloads + which often happens when you recompile or enter and exit play mode. + + + + + Gets a value indicating whether the window should draw a scroll view. + + + + + Draws the Odin Editor Window. + + + + + Priority for and types. + + + + + Priority of the resolver. + + + + + Initializes a new instance of the class. + + The higher the priority, the earlier it will be processed. + + + + Draws an editor window with a menu tree. + + + + public class OdinMenuEditorWindowExample : OdinMenuEditorWindow + { + [SerializeField, HideLabel] + private SomeData someData = new SomeData(); + + protected override OdinMenuTree BuildMenuTree() + { + OdinMenuTree tree = new OdinMenuTree(supportsMultiSelect: true) + { + { "Home", this, EditorIcons.House }, // draws the someDataField in this case. + { "Odin Settings", null, EditorIcons.SettingsCog }, + { "Odin Settings/Color Palettes", ColorPaletteManager.Instance, EditorIcons.EyeDropper }, + { "Odin Settings/AOT Generation", AOTGenerationConfig.Instance, EditorIcons.SmartPhone }, + { "Camera current", Camera.current }, + { "Some Class", this.someData } + }; + + tree.AddAllAssetsAtPath("More Odin Settings", SirenixAssetPaths.OdinEditorConfigsPath, typeof(ScriptableObject), true) + .AddThumbnailIcons(); + + tree.AddAssetAtPath("Odin Getting Started", SirenixAssetPaths.SirenixPluginPath + "Getting Started With Odin.asset"); + + var customMenuItem = new OdinMenuItem(tree, "Menu Style", tree.DefaultMenuStyle); + tree.MenuItems.Insert(2, customMenuItem); + + tree.Add("Menu/Items/Are/Created/As/Needed", new GUIContent()); + tree.Add("Menu/Items/Are/Created", new GUIContent("And can be overridden")); + + // As you can see, Odin provides a few ways to quickly add editors / objects to your menu tree. + // The API also gives you full control over the selection, etc.. + // Make sure to check out the API Documentation for OdinMenuEditorWindow, OdinMenuTree and OdinMenuItem for more information on what you can do! + + return tree; + } + } + + + + + + + + + + + + + Called when the window is destroyed. Remember to call base.OnDestroy(); + + + + + Builds the menu tree. + + + + + Gets or sets the width of the menu. + + + + + Gets a value indicating whether the menu is resizable. + + + + + Gets the menu tree. + + + + + Gets or sets a value indicating whether to draw the menu search bar. + + + + + Gets or sets the custom search function. + + + + + Forces the menu tree rebuild. + + + + + Tries to select the menu item with the specified object. + + + + + Draws the menu tree selection. + + + + + Draws the Odin Editor Window. + + + + + The method that draws the menu. + + + + + A menu item that represents one or more objects. + + + + + + + + + + The default toggled state + + + + + Initializes a new instance of the class. + + The Odin menu tree instance the menu item belongs to. + The name of the menu item. + The instance the value item represents. + + + + Occurs right after the menu item is done drawing, and right before mouse input is handles so you can take control of that. + + + + + Occurs when the user has right-clicked the menu item. + + + + + Gets the child menu items. + + + The child menu items. + + + + + Gets the index location of the menu item. + + + + + Gets or sets a value indicating whether the menu item is visible. + Not that setting this to false will not hide its children as well. For that see use Toggled. + + + + + Gets or sets the icon that is used when the menu item is not selected. + + + + + Gets or sets the icon that is used when the menu item is selected. + + + + + Gets a value indicating whether this instance is selected. + + + + + Gets the menu tree instance. + + + + + Gets or sets the raw menu item name. + + + + + Gets or sets the search string used when searching for menu items. + + + + + Gets the next visual menu item. + + + + + Gets the parent menu item. + + + + + Gets the previous visual menu item. + + + + + Gets the drawn rect. + + + + + Gets the drawn label rect. + + + + + Gets or sets the style. If null is specified, then the menu trees DefaultMenuStyle is used. + + + + + Deselects this instance. + + + + + Selects the specified add to selection. + + + + + Gets the child menu items recursive in a DFS. + + Whether to include it self in the collection. + + + + Gets the child menu items recursive in a DFS. + + Whether to include it self in the collection. + Whether to include the root. + + + + Gets the full menu item path. + + + + + Gets the first object of the + + + + + Gets the object instances the menu item represents + + + + + Sets the object instance + + + + + Sets the object instances + + + + + Gets or sets the value the menu item represents. + + + + + Gets a nice menu item name. If the raw name value is null or a dollar sign, then the name is retrieved from the object itself via ToString(). + + + + + Gets or sets a value indicating whether this is toggled / expanded. This value tries it best to be persistent. + + + + + Gets or sets the icon getter. + + + + + Draws this menu item followed by all of its child menu items + + The indent level. + + + + Draws the menu item with the specified indent level. + + + + + Override this to add custom GUI to the menu items. + This is called right after the menu item is done drawing, and right before mouse input is handles so you can take control of that. + + + + + Handles the mouse events. + + The rect. + The triangle rect. + + + + The style settings used by . + + A nice trick to style your menu is to add the tree.DefaultMenuStyle to the tree itself, + and style it live. Once you are happy, you can hit the Copy CSharp Snippet button, + remove the style from the menu tree, and paste the style directly into your code. + + + + + + + + + + + Gets or sets the default selected style. + + + + + Gets or sets the selected label style. + + + + + The height of the menu item. + + + + + The global offset of the menu item content + + + + + The vertical offset of the menu item label + + + + + The number of pixels to indent per level indent level. + + + + + The size of the icon. + + + + + The size of the icon. + + + + + The transparency of icons when the menu item is not selected. + + + + + The padding between the icon and other content. + + + + + Whether to draw the a foldout triangle for menu items with children. + + + + + The size of the foldout triangle icon. + + + + + The padding between the foldout triangle icon and other content. + + + + + Whether or not to align the triangle left or right of the content. + If right, then the icon is pushed all the way to the right at a fixed position ignoring the indent level. + + + + + Whether to draw borders between menu items. + + + + + The horizontal border padding. + + + + + The border alpha. + + + + + The background color for when a menu item is selected. + + + + + The background color for when a menu item is selected. + + + + + The background color for when a menu item is selected. + + + + + The background color for when a menu item is selected. + + + + + Sets the height of the menu item. + + + + + Sets the global offset of the menu item content + + + + + Sets the number of pixels to indent per level indent level. + + + + + Sets the size of the icon. + + + + + Sets the size of the icon. + + + + + Sets the transparency of icons when the menu item is not selected. + + + + + Sets the padding between the icon and other content. + + + + + Sets whether to draw the a foldout triangle for menu items with children. + + + + + Sets the size of the foldout triangle icon. + + + + + Sets the padding between the foldout triangle icon and other content. + + + + + Sets whether or not to align the triangle left or right of the content. + If right, then the icon is pushed all the way to the right at a fixed position ignoring the indent level. + + + + + Sets whether to draw borders between menu items. + + + + + Sets the border alpha. + + + + + Sets the border alpha. + + + + + Sets the background color for when a menu item is selected. + + + + + Sets the background color for when a menu item is selected. + + + + + Creates and returns an instance of a menu style that makes it look like Unity's project window. + + + + + OdinMenuTree provides a tree of s, and helps with selection, inserting menu items into the tree, and can handle keyboard navigation for you. + + + + OdinMenuTree tree = new OdinMenuTree(supportsMultiSelect: true) + { + { "Home", this, EditorIcons.House }, + { "Odin Settings", null, EditorIcons.SettingsCog }, + { "Odin Settings/Color Palettes", ColorPaletteManager.Instance, EditorIcons.EyeDropper }, + { "Odin Settings/AOT Generation", AOTGenerationConfig.Instance, EditorIcons.SmartPhone }, + { "Camera current", Camera.current }, + { "Some Class", this.someData } + }; + + tree.AddAllAssetsAtPath("Some Menu Item", "Some Asset Path", typeof(ScriptableObject), true) + .AddThumbnailIcons(); + + tree.AddAssetAtPath("Some Second Menu Item", "SomeAssetPath/SomeAssetFile.asset"); + + var customMenuItem = new OdinMenuItem(tree, "Menu Style", tree.DefaultMenuStyle); + tree.MenuItems.Insert(2, customMenuItem); + + tree.Add("Menu/Items/Are/Created/As/Needed", new GUIContent()); + tree.Add("Menu/Items/Are/Created", new GUIContent("And can be overridden")); + + OdinMenuTrees are typically used with s but is made to work perfectly fine on its own for other use cases. + OdinMenuItems can be inherited and and customized to fit your needs. + + // Draw stuff + someTree.DrawMenuTree(); + // Draw stuff + someTree.HandleKeybaordMenuNavigation(); + + + + + + + + + + + Gets the currently active menu tree. + + + + + Gets the selection. + + + + + Gets the root menu items. + + + + + Gets the root menu item. + + + + + If true, all indent levels will be ignored, and all menu items with IsVisible == true will be drawn. + + + + + Adds a menu item with the specified object instance at the the specified path. + + + + + Adds a menu item with the specified object instance and icon at the the specified path. + + + + + Adds a menu item with the specified object instance and icon at the the specified path. + + + + + Adds a menu item with the specified object instance and icon at the the specified path. + + + + + Adds a collection of objects to the menu tree and returns all menu items created in random order. + + + + + Adds a collection of objects to the menu tree and returns all menu items created in random order. + + + + + Gets or sets the default menu item style from Config.DefaultStyle. + + + + + Gets or sets the default drawing configuration. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + if set to true [supports multi select]. + + + + Initializes a new instance of the class. + + if set to true [supports multi select]. + The default menu item style. + + + + Initializes a new instance of the class. + + + + + Scrolls to the specified menu item. + + + + + Enumerates the tree with a DFS. + + if set to true then the invisible root menu item is included. + + + + Enumerates the tree with a DFS. + + The predicate. + if set to true then the invisible root menu item is included. + + + + Enumerates the tree with a DFS. + + + + + Draws the menu tree recursively. + + + + + Marks the dirty. This will cause a tree.UpdateTree() in the beginning of the next Layout frame. + + + + + Draws the search toolbar. + + + + + Updates the menu tree. This method is usually called automatically when needed. + + + + + Handles the keyboard menu navigation. Call this at the end of your GUI scope, to prevent the menu tree from stealing input events from other text fields. + + Returns true, if anything was changed via the keyboard. + + + + Handles the keyboard menu navigation. Call this at the end of your GUI scope, to prevent the menu tree from stealing input events from other text fields. + + Returns true, if anything was changed via the keyboard. + + + + This class fixes a bug where Unity's Undo.RecordObject does not mark ScriptableObjects dirty when + a change is recorded for them. It does this by subscribing to the Undo.postprocessModifications + event, and marking all modified ScriptableObjects dirty manually. + + + + + The config used by OdinMenuTree to specify which features of the Menu Tree should be used when drawing. + + + + + Gets or sets the default menu item style. + + + + + The automatic scroll on selection changed. True by default. + + + + + Whether to draw the tree in a scrollable view. True by default. + + + + + Whether to handle keyboard navigation after it's done drawing. True by default. + + + + + Whether to draw a searchbar above the menu tree. True by default. + + + + + Whether to the menu items expanded state should be cached. True by default. + + + + + Whether to automatically set focus on the search bar when the tree is drawn for the first time. True by default. + + + + + The scroll-view position. + + + + + The search term. + + + + + The height of the search toolbar. + + + + + Gets or sets the search function. Null by default. + + + + + By default, the MenuTree.Selection is confirmed when menu items are double clicked, + Set this to false if you don't want that behaviour. + + + + + By default, the MenuTree.Selection is confirmed when menu items are double clicked, + Set this to false if you don't want that behaviour. + + + + + Class with utility methods for s and s. + + + + OdinMenuTree tree = new OdinMenuTree(); + tree.AddAllAssetsAtPath("Some Menu Item", "Some Asset Path", typeof(ScriptableObject), true) + .AddThumbnailIcons(); + tree.AddAssetAtPath("Some Second Menu Item", "SomeAssetPath/SomeAssetFile.asset"); + // etc... + + + + + + + + + + + Adds the menu item at the specified menu item path and populates the result list with all menu items created in order to add the menuItem at the specified path. + + The tree instance. + The result list. + The menu item path. + The menu item. + + + + Adds the menu item at specified menu item path, and returns all menu items created in order to add the menuItem at the specified path. + + The tree. + The menu item path. + The menu item. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Gets the menu item at the specified path, returns null non was found. + + + + + Adds all asset instances from the specified path and type into a single at the specified menu item path, and returns all menu items created in order to add the menuItem at the specified path.. + + The tree. + The menu item path. + The asset folder path. + The type of objects. + Whether to search for assets in subdirectories as well. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Adds all assets at the specified path. Each asset found gets its own menu item inside the specified menu item path. + + The tree. + The menu item path. + The asset folder path. + The type. + Whether to search for assets in subdirectories as well. + If true, sub-directories in the assetFolderPath will no longer get its own sub-menu item at the specified menu item path. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Adds all assets at the specified path. Each asset found gets its own menu item inside the specified menu item path. + + The tree. + The menu item path. + The asset folder path. + Whether to search for assets in subdirectories as well. + If true, sub-directories in the assetFolderPath will no longer get its own sub-menu item at the specified menu item path. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Adds the asset at the specified menu item path and returns all menu items created in order to end up at the specified menu path. + + The tree. + The menu item path. + The asset path. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Adds the asset at the specified menu item path and returns all menu items created in order to end up at the specified menu path. + + The tree. + The menu item path. + The asset path. + The type. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Sorts the entire tree of menu items recursively by name with respects to numbers. + + + + + Sorts the collection of menu items recursively by name with respects to numbers. + + + + + Adds the specified object at the specified menu item path and returns all menu items created in order to end up at the specified menu path. + + The tree. + The menu path. + The object instance. + Set this to true if you want Odin serialzied members such as dictionaries and generics to be shown as well. + Returns all menu items created in order to add the menu item at the specified menu item path. + + + + Assigns the specified icon to all menu items in the collection with the specified ObjectInstanceType. + + + + + Assigns the specified icon to all menu items in the collection with the specified ObjectInstanceType. + + + + + Assigns the specified icon to all menu items in the collection. + + + + + Assigns the specified icon to all menu items in the collection. + + + + + Assigns the specified icon to the last menu item in the collection. + + + + + Assigns the specified icon to the last menu item in the collection. + + + + + Assigns the specified icon to the last menu item in the collection. + + + + + Assigns the specified icon to the last menu item in the collection. + + + + + Assigns the specified icon to all menu items in the collection. + + + + + Assigns the specified icon to all menu items in the collection. + + + + + Assigns the specified icon to all menu items in the collection. + + + + + Assigns the asset mini thumbnail as an icon to all menu items in the collection. If the menu items object is null then a Unity folder icon is assigned. + + + + + Assigns the asset mini thumbnail as an icon to all menu items in the collection. If the menu items object is null then a Unity folder icon is assigned. + + + + + Constants which describe the type of change that was made to the OdinMenuTrees's Selection + + + + + + A menu item was removed. + + + + + A menu item was selected. + + + + + The selection was cleared. + + + + + Handles the selection of a Odin Menu Tree with support for multi selection. + + + + + + + + + + Initializes a new instance of the class. + + if set to true [supports multi select]. + + + + Occurs whenever the selection has changed. + + + + + Occurs whenever the selection has changed. + + + + + Usually occurs whenever the user hits return, or double click a menu item. + + + + + Gets the count. + + + + + Gets the first selected value, returns null if non is selected. + + + + + Gets all selected values. + + + + + Gets or sets a value indicating whether multi selection is supported. + + + + + Gets the at the specified index. + + + + + Adds a menu item to the selection. If the menu item is already selected, then the item is pushed to the bottom of the selection list. + If multi selection is off, then the previous selected menu item is removed first. + Adding a item to the selection triggers . + + The item. + + + + Clears the selection and triggers . + + + + + Determines whether an OdinMenuItem is selected. + + + + + Copies all the elements of the current array to the specified array starting at the specified destination array index. + + + + + Gets the enumerator. + + + + + Searches for the specified menu item and returns the index location. + + + + + Removes the specified menu item and triggers . + + + + + Removes the menu item at the specified index and triggers . + + + + + Triggers OnSelectionConfirmed. + + + + + Used in to associate name to a value in the GenericSelector. + + + + + + The value. + + + + + The name. + + + + + Initializes a new instance of the struct. + + + + + If the + + + + + Opens a window which displays a list of all icons available from . + + + + + Opens a window which displays a list of all icons available from . + + + + + Builds the selection tree. + + + + + A feature-rich enum selector with support for flag enums. + + + + KeyCode someEnumValue; + + [OnInspectorGUI] + void OnInspectorGUI() + { + // Use the selector manually. See the documentation for OdinSelector for more information. + if (GUILayout.Button("Open Enum Selector")) + { + EnumSelector<KeyCode> selector = new EnumSelector<KeyCode>(); + selector.SetSelection(this.someEnumValue); + selector.SelectionConfirmed += selection => this.someEnumValue = selection.FirstOrDefault(); + selector.ShowInPopup(); // Returns the Odin Editor Window instance, in case you want to mess around with that as well. + } + + // Draw an enum dropdown field which uses the EnumSelector popup: + this.someEnumValue = EnumSelector<KeyCode>.DrawEnumField(new GUIContent("My Label"), this.someEnumValue); + } + + // All Odin Selectors can be rendered anywhere with Odin. This includes the EnumSelector. + EnumSelector<KeyCode> inlineSelector; + + [ShowInInspector] + EnumSelector<KeyCode> InlineSelector + { + get { return this.inlineSelector ?? (this.inlineSelector = new EnumSelector<KeyCode>()); } + set { } + } + + + + + + + + + + + By default, the enum type will be drawn as the title for the selector. No title will be drawn if the string is null or empty. + + + + + Gets a value indicating whether this instance is flag enum. + + + + + Initializes a new instance of the class. + + + + + Populates the tree with all enum values. + + + + + When ShowInPopup is called, without a specified window width, this method gets called. + Here you can calculate and give a good default width for the popup. + The default implementation returns 0, which will let the popup window determine the width itself. This is usually a fixed value. + + + + + Gets the currently selected enum value. + + + + + Selects an enum. + + + + + Draws an enum selector field using the enum selector. + + + + + Draws an enum selector field using the enum selector. + + + + + Draws an enum selector field using the enum selector. + + + + + Draws an enum selector field using the enum selector. + + + + + In simple one-off use cases, making a custom OdinSelector might not be needed, as the GenericSelecor + can be populated with anything and customized a great deal. + + + + SomeType someValue; + + [OnInspectorGUI] + void OnInspectorGUI() + { + if (GUILayout.Button("Open Generic Selector Popup")) + { + List<SomeType> source = ...; + GenericSelector<SomeType> selector = new GenericSelector<SomeType>("Title", false, x => x.Path, source); + selector.SetSelection(this.someValue); + selector.SelectionTree.Config.DrawSearchToolbar = false; + selector.SelectionTree.DefaultMenuStyle.Height = 22; + selector.SelectionConfirmed += selection => this.someValue = selection.FirstOrDefault() + var window = selector.ShowInPopup(); + window.OnEndGUI += () => { EditorGUILayout.HelpBox("A quick way of injecting custom GUI to the editor window popup instance.", MessageType.Info); }; + window.OnClose += selector.SelectionTree.Selection.ConfirmSelection; // Confirm selection when window clses. + } + } + + + + + + + + + + + Gets or sets a value indicating whether [flattened tree]. + + + + + Gets or sets a value indicating whether [checkbox toggle]. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Gets the title. No title will be drawn if the string is null or empty. + + + + + Draws the selection tree. This gets drawn using the OnInspectorGUI attribute. + + + + + Builds the selection tree. + + + + + OdinSelectors is an abstract base class that combines OdinMenuTrees and OdinEditorWindows to help making feature-rich selectors and popup selectors. + + + + public class MySelector : OdinSelector<SomeType> + { + private readonly List<SomeType> source; + private readonly bool supportsMultiSelect; + + public MySelector(List<SomeType> source, bool supportsMultiSelect) + { + this.source = source; + this.supportsMultiSelect = supportsMultiSelect; + } + + protected override void BuildSelectionTree(OdinMenuTree tree) + { + tree.Config.DrawSearchToolbar = true; + tree.Selection.SupportsMultiSelect = this.supportsMultiSelect; + + tree.Add("Defaults/None", null); + tree.Add("Defaults/A", new SomeType()); + tree.Add("Defaults/B", new SomeType()); + + tree.AddRange(this.source, x => x.Path, x => x.SomeTexture); + } + + [OnInspectorGUI] + private void DrawInfoAboutSelectedItem() + { + SomeType selected = this.GetCurrentSelection().FirstOrDefault(); + + if (selected != null) + { + GUILayout.Label("Name: " + selected.Name); + GUILayout.Label("Data: " + selected.Data); + } + } + } + + Usage: + + void OnGUI() + { + if (GUILayout.Button("Open My Selector")) + { + List<SomeType> source = this.GetListOfThingsToSelectFrom(); + MySelector selector = new MySelector(source, false); + + selector.SetSelection(this.someValue); + + selector.SelectionCancelled += () => { }; // Occurs when the popup window is closed, and no slection was confirmed. + selector.SelectionChanged += col => { }; + selector.SelectionConfirmed += col => this.someValue = col.FirstOrDefault(); + + selector.ShowInPopup(); // Returns the Odin Editor Window instance, in case you want to mess around with that as well. + } + } + + // All Odin Selectors can be rendered anywhere with Odin. + [ShowInInspector] + MySelector inlineSelector; + + + + + + + + + + + If true, a confirm selection button will be drawn in the title-bar. + + + + + Enables the single click to select. + + + + + Occurs when the window is closed, and no slection was confirmed. + + + + + Occurs when the menuTrees selection is changed and IsValidSelection returns true. + + + + + Occurs when the menuTrees selection is confirmed and IsValidSelection returns true. + + + + + Gets the selection menu tree. + + + + + Gets the title. No title will be drawn if the string is null or empty. + + + + + Gets the current selection from the menu tree whether it's valid or not. + + + + + Determines whether the specified collection is a valid collection. + If false, the SlectionChanged and SelectionConfirm events will not be called. + By default, this returns true if the collection contains one or more items. + + + + + Sets the selection. + + + + + Sets the selection. + + + + + Opens up the selector instance in a popup at the specified rect position. + The width of the popup is determined by DefaultWindowWidth, and the height is automatically calculated. + + + + + Opens up the selector instance in a popup at the specified rect position. + + + + + Opens up the selector instance in a popup at the specified rect position. + + + + + The mouse position is used as the position for the window. + Opens up the selector instance in a popup at the specified position. + + + + + Opens up the selector instance in a popup at the specified position. + + + + + Opens up the selector instance in a popup at the specified rect position. + + + + + Opens up the selector instance in a popup at the specified position. + The width of the popup is determined by DefaultWindowWidth, and the height is automatically calculated. + + + + + Opens up the selector instance in a popup with the specified width and height. + The mouse position is used as the position for the window. + + + + + Builds the selection tree. + + + + + When ShowInPopup is called, without a specifed window width, this methods gets called. + Here you can calculate and give a good default width for the popup. + The default implementation returns 0, which will let the popup window determain the width itself. This is usually a fixed value. + + + + + Triggers the selection changed event, but only if the current selection is valid. + + + + + Draw the selecotr manually. + + + + + Draws the selection tree. This gets drawn using the OnInspectorGUI attribute. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + Draws dropwdown field, that creates and binds the selector to the dropdown field. + + + + + A feature-rich type selector. + + + + Type[] selectedTypes; + + void OnGUI() + { + // Use the selector manually. See the documentation for OdinSelector for more information. + if (GUILayout.Button("Open My Selector")) + { + TypeSelector selector = new TypeSelector(customListOfTypes); + TypeSelector selector = new TypeSelector(AssemblyTypeFlags.CustomTypes, supportsMultiSelect: true); + selector.SetSelection(this.selectedTypes); + selector.SelectionConfirmed += selection => this.selectedTypes = selection.ToArray(); + selector.ShowInPopup(); // Returns the Odin Editor Window instance, in case you want to mess around with that as well. + } + } + + + + + private static Type currentSelectedType; + private static IEnumerable<Type> currentSource; + private static Func<Rect, OdinSelector<Type>> createTypeSelector = (rect) => + { + TypeSelector selector = new TypeSelector(currentSource, false); + selector.SetSelection(currentSelectedType); + selector.ShowInPopup(rect); + return selector; + }; + + public static Type DrawTypeSelectorDropdown(GUIContent label, Type selectedType, IEnumerable<Type> source) + { + currentSource = source; + currentSelectedType = selectedType; + + var dropdownText = selectedType == null ? "None" : selectedType.GetNiceName(); + var selected = TypeSelector.DrawSelectorDropdown(label, dropdownText, createTypeSelector); + if (selected != null && selected.Any()) + { + selectedType = selected.FirstOrDefault(); + } + return selectedType; + } + + + + + + Builds the selection tree. + + + + + 450 + + + + + Sets the selected types. + + + + + Editor Only Mode Utility. + + + + + Gaither all necessary information about the editor only state. + + + + + Disables Editor Only Mode. + + + + + Enables editor only mode. + + + + + Checks to see whether Editor Only Mode is enabled. + + + + + Checks to see whether Odin Inspector is installed in Source Code mode. + + + + + Contains general configuration for all Odin drawers. + + You can modify the configuration in the Odin Preferences window found in 'Tools -> Odin Inspector -> Preferences -> Drawers -> General', + or by locating the configuration file stored as a serialized object in the Sirenix folder under 'Odin Inspector/Config/Editor/GeneralDrawerConfig'. + + + + + + Specify whether or not the script selector above components should be drawn. + + + + + Specify whether or not the warning for properties that do not support prefab modifications should be shown in the inspector. + + + + + Specify whether or not the warning for properties that do not support prefab modifications should be shown in the inspector. + + + + + Specifies the maximum depth to which a property can draw itself recursively before the system refuses to draw it any deeper. + + + + + If set to true, most foldouts throughout the inspector will be expanded by default. + + + + + If set to true, buttons will show the result values from invoking them in the inspector by default. + + + + + If set to true, type matching for things such as drawers will be precomputed in a separate thread based on a cache from the previously loaded AppDomain that is stored on disk in the Project's Temp folder, resulting in some overall speedups in some cases when doing first-time type matching. Requires a recompile/project reload before it takes any effect. + + + + + Specify the animation speed for most foldouts throughout the inspector. + + + + + Specify the shaking duration for most shaking animations throughout the inspector. + + + + + Specify the animation speed for + + + + + When true the component labels, for vector fields, will be hidden when the field is too narrow. + + + + + Specify how the Quaternion struct should be shown in the inspector. + + + + + Gets or sets a value indicating whether [use improved enum drop down]. + + + + + Gets or sets a value indicating whether [use improved enum drop down]. + + + + + Specify whether or not a list should hide the foldout triangle when the list is empty. + + + + + Specifies whether a list should hide the foldout triangle when the list is empty. + + + + + Specify whether or not lists should hide the paging buttons when the list is collapsed. + + + + + Specify whether or not lists should hide the paging buttons when there is only one page. + + + + + Specify the number of elements drawn per page. + + + + + Specify whether or not lists should be expanded or collapsed by default. + + + + + Specify whether or not to include a button which expands the list, showing all pages at once. + + + + + Specify whether or not lists should show item count. + + + + + Specify whether or not lists should show item count. + + + + + Gets or sets the default size of the preview object field. + + + + + Gets or sets the default alignment of the preview object field. + + + + + Gets or sets which types should be drawn by default by the preview object field. + + + + + Resets all settings to default. + + + + + + Tell Odin which types should be drawn or should not be drawn by Odin. + + + You can modify which types should be drawn by Odin in the Preferences window found in 'Tools -> Odin Inspector -> Preferences -> Editor Types', + or by locating the configuration file stored as a serialized object in the Sirenix folder under 'Odin Inspector/Config/Editor/InspectorConfig'. + + + + + + Whether Odin is enabled in the inspector or not. + + + + + InspectorDefaultEditors is a bitmask used to tell which types should have an Odin Editor generated. + + + + + The config which contains configuration data for which types Odin should draw in the inspector. + + + + + Updates Unity with the current Odin editor configuration. + + + + + InspectorDefaultEditors is a bitmask used to tell which types should have an Odin Editor generated. + + + + + + Excludes all types. + + + + + UserTypes includes all custom user scripts that are not located in an editor or plugin folder. + + + + + PluginTypes includes all types located in the plugins folder and are not located in an editor folder. + + + + + UnityTypes includes all types depended on UnityEngine and from UnityEngine, except editor, plugin and user types. + + + + + OtherTypes include all other types that are not depended on UnityEngine or UnityEditor. + + + + + Contains configuration data for which types Odin should draw in the inspector. + + + Note that this class supports assigning arbitrary editor types to inspect any Unity object type. The Editor Types GUI in preferences simply does not, as of now, support assigning editors of any other type than . However, the API is open to further customization. + When an editor is generated for a type, a new editor type is added to the GeneratedOdinEditors assembly, which is derived from the assigned editor type - in most cases, . + You can check if an editor is compatible using . + + . + . + + + + The type binder that the uses to bind types to names, and names to types. + This is usually an instance of . + + + + + Resets the drawing configuration to the default values. + + + + + Gets a list of all drawn types that have entries in the drawing config. + + + + + Forces the config's internal drawer type to value type lookup cache to rebuild itself. + + + + + Clears the editor type entry for the given drawer, so it will be set to Unity's default. + + The drawn type to clear the editor for. + drawnType is null + + + + Assigns a given editor to draw a given type. + + The drawn type to assign an editor type for. + The editor type to assign. When generating editors, a type derived from this editor will be created and set to draw the given drawn type. + drawnType + The type " + editorType.GetNiceName() + " is not a valid base editor for type " + drawnType.GetNiceName() + ". Check criteria using . + + + + Determines whether an editor value has been assigned for a given drawn type. + + The drawn type to check. + drawnType is null + + + + Gets which editor type would draw the given type. If the type has not been assigned a custom editor type in the config, the default editor type is returned using . + + The drawn type to get an editor type for. + The editor that would draw the given type. + drawnType is null + + + + Gets the default editor that this type would have, if no custom editor was set for this type in particular. This is calculated using the value of . + + The drawn type to get the default editor for. + The editor that would draw this type by default, or null, if there is no default Odin-defined editor for the drawn type. + drawnType is null + + + + Checks whether the given editor can be assigned to draw any type using the class. + + Type of the editor to check. + True if the editor is valid, otherwise false + + + + Checks whether the given editor can be assigned to draw a given type using the class. + This method checks the attribute on the type for whether the given type is compatible. + + Type of the editor to check. + Type of the drawn value to check. If this parameter is null, the drawn type is not checked for compatibility with the editor type; only the editor type itself is checked for validity. + True if the editor is valid, otherwise false + editorType + + + + Gets the type that an editor draws, by extracting it from the editor's attribute, if it is declared. + This method returns null for abstract editor types, as those can never draw anything. + + Type of the editor. + Whether the editor in question is also an editor for types derived from the given type. + + editorType + + + + A type that indicates that a drawer is missing. + + + + + Draws an instance, and contains methods getting all types that should be drawn by Odin. + Note that this class keeps a lot of static state, and is only intended to draw the instance of that exists in the singleton asset. If used to draw other instances, odd behaviour may occur. + + . + . + + + + Determines whether Odin is capable of creating a custom editor for a given type. + + + + + Gets an array of all assigned editor types, and the types they have to draw. + + + + + Draws the property. + + + + + Contains information about an editor type which is assigned to draw a certain type in the inspector. + This class uses the instance to bind types to names, and names to types. + + . + . + . + + + + A default, empty value. + + + + + The name of the type to be drawn. + + + + + The name of the editor type. + + + + + Initializes a new instance of the struct. + + The drawn type. + drawnType is null + + + + Initializes a new instance of the struct. + + The drawn type. + The editor type. + drawnType is null + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified , is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Implements the operator ==. + + The x. + The y. + + The result of the operator. + + + + + Implements the operator !=. + + The x. + The y. + + The result of the operator. + + + + + Represents a weakly typed collection of values for a - one value per selected inspector target. + + + + + Whether the values have been changed since was last called. + + + + + Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . + + + + + Marks the value collection as being dirty, regardless of any value changes. + + + + + Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. + + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + The original values of the value collection, such as they were immediately after the last call. + + + + + Represents a strongly typed collection of values for a - one value per selected inspector target. + + + + + Gets the value at the given selection index. + + + + + The number of values in the collection. + + + + + The original values of the value collection, such as they were immediately after the last call. + + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + Represents an alias for a strongly typed collection of values for a - one value per selected inspector target. + This class ensures that polymorphism works in the inspector, and can be strongly typed in applicable cases. + + The type of the aliased collection. + The polymorphic type of this collection, which is assignable to . + + + + + + Initializes a new instance of the class. + + The property. + The aliased collection. + Not yet documented. + Not yet documented. + aliasedCollection + + + + Whether the values have been changed since was last called. + + + + + The number of values in the collection. + + + + + Gets a value indicating whether this instance is synchronized. + + + true if this instance is synchronized; otherwise, false. + + + + + Gets the synchronization root object. + + + The synchronization root object. + + + + + The original values of the (loosely typed) value collection, such as they were immediately after the last call. + + + + + The original values of the value collection, such as they were immediately after the last call. + + + + + Gets or sets the at the specified index. + + + The . + + The index. + + + + + Gets an enumerator for the collection. + + + + + + Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . + + + + + Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. + + + + + Determines whether the collection contains the specified value. + + The value. + + true if the collection contains the specified value; otherwise, false. + + + + + Gets the index of the given value, or -1 if the value was not found. + + The value to get the index of. + + The index of the given value, or -1 if the value was not found. + + + + + Copies the collection to an array. + + The array to copy to. + The index to copy from. + + + + Gets the weakly typed value at the given index. + + The index of the value to get. + + The weakly typed value at the given index + + + + + Sets the weakly typed value at the given index. + + The index to set the value of. + The value to set. + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + Marks the value collection as being dirty, regardless of any value changes. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Represents the values of an , and contains utilities for querying the values' type and getting and setting them. + + + + + The number of parallel values this entry represents. This will always be exactly equal to the count of . + + + + + Whether this value entry is editable or not. + + + + + If this value entry has the override type , this is the path of the property it references. + + + + + The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. + Note that this is *not* always equal to . + + + + + The property whose values this value entry represents. + + + + + Provides access to the weakly typed values of this value entry. + + + + + Whether this value entry has been changed from its prefab counterpart. + + + + + Whether this value entry has had its list length changed from its prefab counterpart. + + + + + Whether this value entry has had its dictionary values changes from its prefab counterpart. + + + + + A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. + + + + + The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . + + + + + The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. + + + + + The special state of the value entry. + + + + + Whether this value entry is an alias, or not. Value entry aliases are used to provide strongly typed value entries in the case of polymorphism. + + + + + The context container of this property. + + + + + Whether this type is marked as an atomic type using a . + + + + + An event that is invoked during , when any values have changed. + + + + + An event that is invoked during , when any child values have changed. + + + + + Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. + + + + + Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. + + True if any changes were made, otherwise, false. + + + + Checks whether the values in this value entry are equal to the values in another value entry. + Note, both value entries must have the same value type, and must represent values that are .NET value types. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Represents the strongly typed values of an , and contains utilities for querying the values' type and getting and setting them. + + + + + Provides access to the strongly typed values of this value entry. + + + + + A strongly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + A polymorphic alias for a instance, used to implement strongly typed polymorphism in Odin. + + + + + The number of parallel values this entry represents. This will always be exactly equal to the count of . + + + + + Whether this value entry is editable or not. + + + + + If this value entry has the override type , this is the path of the property it references. + + + + + The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. + Note that this is *not* always equal to . + + + + + The property whose values this value entry represents. + + + + + Provides access to the weakly typed values of this value entry. + + + + + Whether this value entry has been changed from its prefab counterpart. + + + + + Whether this value entry has had its list length changed from its prefab counterpart. + + + + + Whether this value entry has had its dictionary values changes from its prefab counterpart. + + + + + A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. + + + + + The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . + + + + + The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. + + + + + The special state of the value entry. + + + + + Whether this value entry is an alias, or not. Value entry aliases are used to provide strongly typed value entries in the case of polymorphism. + + + + + The context container of this property. + + + + + Whether this type is marked as an atomic type using a . + + + + + An event that is invoked during , when any values have changed. + + + + + An event that is invoked during , when any child values have changed. + + + + + Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. + + + True if any changes were made, otherwise, false. + + + + + Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. + + + + + Checks whether the values in this value entry are equal to the values in another value entry. + Note, both value entries must have the same value type, and must represent values that are .NET value types. + + + + + Sets the actual value of a value entry, for a given selection index. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + A polymorphic alias for a instance, used to implement strongly typed polymorphism in Odin. + + + + + Initializes a new instance of the class. + + The value entry to alias. + valueEntry is null + + + + Provides access to the strongly typed values of this value entry. + + + + + A strongly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + The number of parallel values this entry represents. This will always be exactly equal to the count of . + + + + + Whether this value entry is editable or not. + + + + + If this value entry has the override type , this is the path of the property it references. + + + + + The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. + Note that this is *not* always equal to . + + + + + The property whose values this value entry represents. + + + + + Provides access to the weakly typed values of this value entry. + + + + + Whether this value entry has been changed from its prefab counterpart. + + + + + Whether this value entry has had its list length changed from its prefab counterpart. + + + + + Whether this value entry has had its dictionary values changes from its prefab counterpart. + + + + + The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. + + + + + The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . + + + + + The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. + + + + + The special state of the value entry. + + + + + Whether this type is marked as an atomic type using a . + + + + + An event that is invoked during , when any values have changed. + + + + + An event that is invoked during , when any child values have changed. + + + + + Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. + + + True if any changes were made, otherwise, false. + + + + + Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. + + + + + Checks whether the values in this value entry are equal to the values in another value entry. + Note, both value entries must have the same value type, and must represent values that are .NET value types. + + + + + Sets the actual value of a value entry, for a given selection index. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Draws short properties marked with . + + + + + + Not yet documented. + + + + + Draws int properties marked with . + + + + + + Not yet documented. + + + + + Draws long properties marked with . + + + + + + Not yet documented. + + + + + Draws float properties marked with . + + + + + + Not yet documented. + + + + + Draws double properties marked with . + + + + + + Not yet documented. + + + + + Draws decimal properties marked with . + + + + + + Not yet documented. + + + + + Draws Vector2 properties marked with . + + + + + + Not yet documented. + + + + + Draws Vector3 properties marked with . + + + + + + Not yet documented. + + + + + Draws Vector4 properties marked with . + + + + + + Not yet documented. + + + + + Draws properties marked with . + + + + + + + + + Draws the property. + + + + + Base class for creating editor windows using Odin. + + + + public class SomeWindow : OdinEditorWindow + { + [MenuItem("My Game/Some Window")] + private static void OpenWindow() + { + GetWindow<SomeWindow>().Show(); + } + + [Button(ButtonSizes.Large)] + public void SomeButton() { } + + [TableList] + public SomeType[] SomeTableData; + } + + + + + public class DrawSomeSingletonInAnEditorWindow : OdinEditorWindow + { + [MenuItem("My Game/Some Window")] + private static void OpenWindow() + { + GetWindow<DrawSomeSingletonInAnEditorWindow>().Show(); + } + + protected override object GetTarget() + { + return MySingleton.Instance; + } + } + + + + + private void InspectObjectInWindow() + { + OdinEditorWindow.InspectObject(someObject); + } + + private void InspectObjectInDropDownWithAutoHeight() + { + var btnRect = GUIHelper.GetCurrentLayoutRect(); + OdinEditorWindow.InspectObjectInDropDown(someObject, btnRect, btnRect.width); + } + + private void InspectObjectInDropDown() + { + var btnRect = GUIHelper.GetCurrentLayoutRect(); + OdinEditorWindow.InspectObjectInDropDown(someObject, btnRect, new Vector2(btnRect.width, 100)); + } + + private void InspectObjectInACenteredWindow() + { + var window = OdinEditorWindow.InspectObject(someObject); + window.position = GUIHelper.GetEditorWindowRect().AlignCenter(270, 200); + } + + private void OtherStuffYouCanDo() + { + var window = OdinEditorWindow.InspectObject(this.someObject); + + window.position = GUIHelper.GetEditorWindowRect().AlignCenter(270, 200); + window.titleContent = new GUIContent("Custom title", EditorIcons.RulerRect.Active); + window.OnClose += () => Debug.Log("Window Closed"); + window.OnBeginGUI += () => GUILayout.Label("-----------"); + window.OnEndGUI += () => GUILayout.Label("-----------"); + } + + + + + + + Occurs when the window is closed. + + + + + Occurs at the beginning the OnGUI method. + + + + + Occurs at the end the OnGUI method. + + + + + Gets the label width to be used. Values between 0 and 1 are treated as percentages, and values above as pixels. + + + + + Gets or sets the window padding. x = left, y = right, z = top, w = bottom. + + + + + Gets a value indicating whether the window should draw a scroll view. + + + + + Gets a value indicating whether the window should draw a Unity editor preview, if possible. + + + + + Gets the default preview height for Unity editors. + + + + + Gets the target which which the window is supposed to draw. By default it simply returns the editor window instance itself. By default, this method is called by (). + + + + + Gets the targets to be drawn by the editor window. By default this simply yield returns the method. + + + + + At the start of each OnGUI event when in the Layout event, the GetTargets() method is called and cached into a list which you can access from here. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + This particular overload uses a few frames to calculate the height of the content before showing the window with a height that matches its content. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + + Pops up an editor window for the given object in a drop-down window which closes when it loses its focus. + + Protip: You can subscribe to OnClose if you want to know when that occurs. + + + + + Pops up an editor window for the given object. + + + + + Inspects the object using an existing OdinEditorWindow. + + + + + Creates an editor window instance for the specified object, without opening the window. + + + + + The Odin property tree drawn. + + + + + Draws the Odin Editor Window. + + + + + Calls DrawEditor(index) for each of the currently drawing targets. + + + + + Initialize get called by OnEnable and by OnGUI after assembly reloads + which often happens when you recompile or enter and exit play mode. + + + + + Called when the window is enabled. Remember to call base.OnEnable(); + + + + + Draws the editor for the this.CurrentDrawingTargets[index]. + + + + + Uses the method to draw a preview for the this.CurrentDrawingTargets[index]. + + + + + Called when the window is destroyed. Remember to call base.OnDestroy(); + + + + + Called before starting to draw all editors for the . + + + + + Called after all editors for the has been drawn. + + + + + See ISerializationCallbackReceiver.OnBeforeSerialize for documentation on how to use this method. + + + + + Implement this method to receive a callback after unity serialized your object. + + + + + Unity property drawer for abstract types. + + + + + Initializes the property drawer. + + + + + Draws the property. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Draws the default Odin inspector. + + + + + Draws the default Unity inspector. + + + + + Not yet documented. + + + + + Draws the property tree. + + + + + Called by Unity. + + + + + Called by Unity. + + + + + Unity property attribute drawer. + + + + + Initializes the drawer. + + + + + Draws the proprety. + + + + + Not yet documented. + + + + + Utility class for locating and sorting property drawers for the inspector. + See Odin manual section 'Drawers in Depth' for details on how the DrawerLocator determines which drawers to use. + + + + + + Base class for all group drawers. Use this class to create your own custom group drawers. OdinGroupDrawer are used to group multiple properties together using an attribute. + + + + Note that all box group attributes needs to inherit from the + + + + Remember to provide your custom drawer with an + in order for it to be located by the . + + + + + + Checkout the manual for more information. + + + + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + public class MyBoxGroupAttribute : PropertyGroupAttribute + { + public MyBoxGroupAttribute(string group, float order = 0) : base(group, order) + { + } + } + + // Remember to wrap your custom group drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. + + public class BoxGroupAttributeDrawer : OdinGroupDrawer<MyBoxGroupAttribute> + { + protected override void DrawPropertyGroupLayout(InspectorProperty property, MyBoxGroupAttribute attribute, GUIContent label) + { + GUILayout.BeginVertical("box"); + for (int i = 0; i < property.Children.Count; i++) + { + InspectorUtilities.DrawProperty(property.Children[i]); + } + GUILayout.EndVertical(); + } + } + + // Usage: + public class MyComponent : MonoBehaviour + { + [MyBoxGroup("MyGroup")] + public int A; + + [MyBoxGroup("MyGroup")] + public int B; + + [MyBoxGroup("MyGroup")] + public int C; + } + + + + + + + + + + + + + + + + + + Draws the property with GUILayout support. + + The label. This can be null, so make sure your drawer supports that. + + + + Base drawer to inherit from to draw methods. + + + + + + DrawerPriority is used in conjunction with + to specify the priority of any given drawer. It consists of 3 components: + Super, Wrapper, Value, where Super is the most significant component, + and Standard is the least significant component. + + + + + + + + Auto priority is defined by setting all of the components to zero. + If no is defined on a drawer, it will default to AutoPriority. + + + + + The standard priority. Mostly used by s. + + + + + The attribute priority. Mostly used by s. + + + + + The wrapper priority. Mostly used by drawers used to decorate properties. + + + + + The super priority. Mostly used by drawers that wants to wrap the entire property but don't draw the actual property. + These drawers typically don't draw the property itself, and calls CallNextDrawer. + + + + + The value priority. Mostly used by s and s. + + + + + The wrapper priority. Mostly used by drawers used to decorate properties. + + + + + The super priority. Mostly used by drawers that wants to wrap the entire property but don't draw the actual property. + These drawers typically don't draw the property itself, and calls CallNextDrawer. + + + + + Initializes a new instance of the struct. + + The priority. + + + + Initializes a new instance of the struct. + + + The super priority. Mostly used by drawers that wants to wrap the entire property but don't draw the actual property. + These drawers typically don't draw the property itself, and calls CallNextDrawer. + The wrapper priority. Mostly used by drawers used to decorate properties. + The value priority. Mostly used by s and s. + + + + Implements the operator >. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator <. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator <=. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator >=. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator +. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator -. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator ==. + + The LHS. + The RHS. + + The result of the operator. + + + + + Implements the operator !=. + + The LHS. + The RHS. + + The result of the operator. + + + + + Gets the priority level. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Determines whether the specified , is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Equals the specified other. + + The other. + + + + + Compares to. + + The other. + + + + + DrawerPriority is used on inspector drawers and indicates the priority of the drawer. + Use this to make your custom drawer to come before or after other drawers, and potentially hide other drawers. + + + The following example shows how DrawerPriority could be apply to a value drawer. + + [DrawerPriority(DrawerPriorityLevel.ValuePriority)] + + public sealed class MyIntDrawer : InspectorValuePropertyDrawer<int> + { + // ... + } + + + + The following example shows how DrawerPriority is used to mark a custom int drawer as a high priority drawer. + + [DrawerPriority(1, 0, 0)] + + public sealed class MySpecialIntDrawer : InspectorValuePropertyDrawer<int> + { + // ... + } + + + + + + + + The priority of the drawer. + + + + + Indicates the priority of an inspector drawer. + + Option for priority for the inspector drawer. + + + + Indicates the priority of an inspector drawer. + + + The super priority. Mostly used by drawers that wants to wrap the entire property but don't draw the actual property. + These drawers typically don't draw the property itself, and calls CallNextDrawer. + The wrapper priority. Mostly used by drawers used to decorate properties. + The value priority. Mostly used by s and s. + + + + + DrawerPriorityLevel is used in conjunction with . + + + + + + + + Auto priority is defined by setting all of the components to zero. + If no is defined on a drawer, it will default to AutoPriority. + + + + + The value priority. Mostly used by s. + + + + + The attribute priority. Mostly used by s. + + + + + The wrapper priority. Mostly used by drawers used to decorate properties. + + + + + The super priority. Mostly used by drawers that wants to wrap the entire property but don't draw the actual property. + These drawers typically don't draw the property itself, and calls CallNextDrawer. + + + + + Base class for emitted MonoBehaviour-derived types that have been created by the . + + + + + The field that backs the value of this MonoBehaviour. + + + + + Sets the value contained in this scriptable object. + + + + + Gets the value contained in this scriptable object. + + + + + Strongly typed base class for emitted MonoBehaviour-derived types that have been created by the . + + + + + Sets the value contained in this scriptable object. + + + + + Gets the value contained in this scriptable object. + + + + + Sets the value contained in this scriptable object. + + + + + Gets the value contained in this scriptable object. + + + + + Base class for emitted ScriptableObject-derived types that have been created by the . + + + + + The field that backs the value of this scriptable object. + + + + + Sets the value contained in this scriptable object. + + + + + Gets the value contained in this scriptable object. + + + + + Strongly typed base class for emitted scriptable object types that have been created by the . + + + + + Sets the value contained in this scriptable object. + + + + + Gets the value contained in this scriptable object. + + + + + Sets the value contained in this scriptable object. + + + + + Gets the value contained in this scriptable object. + + + + + This class fixes Unity's about window, by invoking "UnityEditor.VisualStudioIntegration.UnityVSSupport.GetAboutWindowLabel" before any dynamic assemblies have been defined. + This is because dynamic assemblies in the current AppDomain break that method, and Unity's about window depends on it. + + + + + + If you mark any of Unity's assemblies with the [AssemblyVersion] attribute to get a rolling assembly + version that changes sometimes (or all the time), Odin's hardcoded assembly references to user types + will break. + + + To fix this case, and all other cases of references to wrongly versioned Unity types not being resolved, + we overload the app domain's type resolution and resolve Unity user assemblies properly regardless of + version. + + + + + + Specifies hows any given drawer should drawer the property. + Changing this behavior, also changes which methods should be overridden in the drawer. + + + + + + + + + GUILayout enabled the use of GUILayout, EditorGUILayout and + + + + + Draws the property using Unity's GUI, and EditorGUI. + + + + + + Base class for attribute drawers. Use this class to create your own custom attribute drawers that will work for all types. + Alternatively you can derive from if you want to only support specific types. + + + + Remember to provide your custom drawer with an + in order for it to be located by the . + + + + Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection + in many simple cases. Checkout the manual for more information on handling multi-selection. + + + + Also note that Odin does not require that your custom attribute inherits from Unity's PropertyAttribute. + + + + The attribute that this drawer should be applied to. + + + Checkout the manual for more information. + + + + Example using the . + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] + public class CustomRangeAttribute : System.Attribute + { + public float Min; + public float Max; + + public CustomRangeAttribute(float min, float max) + { + this.Min = min; + this.Max = max; + } + } + + // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. + + public sealed class CustomRangeAttributeDrawer : OdinAttributeDrawer<CustomRangeAttribute, float> + { + protected override void DrawPropertyLayout(IPropertyValueEntry<float> entry, CustomRangeAttribute attribute, GUIContent label) + { + entry.SmartValue = EditorGUILayout.Slider(label, entry.SmartValue, attribute.Min, attribute.Max); + } + } + + // Usage: + public class MyComponent : MonoBehaviour + { + [CustomRangeAttribute(0, 1)] + public float MyFloat; + } + + + + + Example using the . + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] + public class GUITintColorAttribute : System.Attribute + { + public Color Color; + + public GUITintColorAttribute(float r, float g, float b, float a = 1) + { + this.Color = new Color(r, g, b, a); + } + } + + // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. + + public sealed class GUITintColorAttributeDrawer : OdinAttributeDrawer<GUITintColorAttribute> + { + protected override void DrawPropertyLayout(InspectorProperty property, GUITintColorAttribute attribute, GUIContent label) + { + Color prevColor = GUI.color; + GUI.color *= attribute.Color; + this.CallNextDrawer(label); + GUI.color = prevColor; + } + } + + // Usage: + public class MyComponent : MonoBehaviour + { + [GUITintColor(0, 1, 0)] + public float MyFloat; + } + + + + + + Odin uses multiple drawers to draw any given property, and the order in which these drawers are + called are defined using the . + Your custom drawer injects itself into this chain of drawers based on its . + If no is defined, a priority is generated automatically based on the type of the drawer. + Each drawer can ether choose to draw the property or not, or pass on the responsibility to the + next drawer by calling CallNextDrawer(), as the f attribute does in the example above. + + + + This means that there is no guarantee that your drawer will be called, sins other drawers + could have a higher priority than yours and choose not to call CallNextDrawer(). + + + + Note that Odin's have full support for generic class constraints, + and if that is not enough, you can also add additional type constraints by overriding CanDrawTypeFilter + + + + Also note that all custom property drawers needs to handle cases where the label provided by the DrawPropertyLayout is null, + otherwise exceptions will be thrown when in cases where the label is hidden. For instance when [HideLabel] is used, or the property is drawn within a list where labels are also not shown. + + + + [DrawerPriority(DrawerPriorityLevel.AttributePriority)] + public sealed class MyCustomAttributeDrawer<T> : OdinAttributeDrawer<MyCustomAttribute, T> where T : class + { + public override bool CanDrawTypeFilter(Type type) + { + return type != typeof(string); + } + + protected override void DrawPropertyLayout(GUIContent label) + { + // Draw property here. + } + } + + + + + + + + + + + + + + + + + + Gets the attribute that the OdinAttributeDrawer draws for. + + + + + Tells whether or not multiple attributes are allowed. + + + + + Draws the property with the given label. + Override this to implement your custom OdinAttributeDrawer. + + Optional label for the property. + + + + Tests if the drawer can draw for the specified property. + + The property to test. + true if the drawer can drawn the property. Otherwise false. + + + + Tests if the attribute drawer can draw for the specified property. + + The property to test. + true if the drawer can drawn the property. Otherwise false. + + + + + Base class for all type specific attribute drawers. For non-type specific attribute drawers see . + + + + Remember to provide your custom drawer with an + in order for it to be located by the . + + + + Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection + in many simple cases. Checkout the manual for more information on handling multi-selection. + + + + Also note that Odin does not require that your custom attribute inherits from Unity's PropertyAttribute. + Furthermore have full support for generic class constraints. + + + + The attribute that this drawer should be applied to. + The type of the value the drawer should be drawing. Note that Odin's has full support for generic constraints. + + + Checkout the manual for more information. + + + + Example using the . + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] + public class CustomRangeAttribute : System.Attribute + { + public float Min; + public float Max; + + public CustomRangeAttribute(float min, float max) + { + this.Min = min; + this.Max = max; + } + } + + // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. + + public sealed class CustomRangeAttributeDrawer : OdinAttributeDrawer<CustomRangeAttribute, float> + { + protected override void DrawPropertyLayout(IPropertyValueEntry<float> entry, CustomRangeAttribute attribute, GUIContent label) + { + entry.SmartValue = EditorGUILayout.Slider(label, entry.SmartValue, attribute.Min, attribute.Max); + } + } + + // Usage: + public class MyComponent : MonoBehaviour + { + [CustomRangeAttribute(0, 1)] + public float MyFloat; + } + + + + + Example using the . + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] + public class GUITintColorAttribute : System.Attribute + { + public Color Color; + + public GUITintColorAttribute(float r, float g, float b, float a = 1) + { + this.Color = new Color(r, g, b, a); + } + } + + // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. + + public sealed class GUITintColorAttributeDrawer : OdinAttributeDrawer<GUITintColorAttribute> + { + protected override void DrawPropertyLayout(InspectorProperty property, GUITintColorAttribute attribute, GUIContent label) + { + Color prevColor = GUI.color; + GUI.color *= attribute.Color; + this.CallNextDrawer(label); + GUI.color = prevColor; + } + } + + // Usage: + public class MyComponent : MonoBehaviour + { + [GUITintColor(0, 1, 0)] + public float MyFloat; + } + + + + + + Odin uses multiple drawers to draw any given property, and the order in which these drawers are + called is defined using the . + Your custom drawer injects itself into this chain of drawers based on its . + If no is defined, a priority is generated automatically based on the type of the drawer. + Each drawer can ether choose to draw the property or not, or pass on the responsibility to the + next drawer by calling CallNextDrawer(), as the GUITintColor attribute does in the example above. + + + + This means that there is no guarantee that your drawer will be called, sins other drawers + could have a higher priority than yours and choose not to call CallNextDrawer(). + + + + Note that Odin's have full support for generic class constraints, + and if that is not enough, you can also add additional type constraints by overriding CanDrawTypeFilter + + + + Also note that all custom property drawers needs to handle cases where the label provided by the DrawPropertyLayout is null, + otherwise exceptions will be thrown when in cases where the label is hidden. For instance when [HideLabel] is used, or the property is drawn within a list where labels are also not shown. + + + + [DrawerPriority(DrawerPriorityLevel.AttributePriority)] + public class MyCustomAttributeDrawer<T> : OdinAttributeDrawer<MyCustomAttribute, T> where T : class + { + public override bool CanDrawTypeFilter(Type type) + { + return type != typeof(string); + } + + protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, MyCustomAttribute attribute, GUIContent label) + { + // Draw property here. + } + } + + + + + + + + + + + + + + + + + + Gets the strongly typed ValueEntry of the OdinAttributeDrawer's property. + + + + + Draws the property with the given label. + Override this to implement your custom OdinAttributeDrawer. + + Optional label for the property. + + + + Tests if the drawer can draw for the specified property. + + The property to test. + true if the drawer can drawn the property. Otherwise false. + + + + Tests if the attribute drawer can draw for the specified property. + + The property to test. + true if the drawer can drawn the property. Otherwise false. + + + + Some drawers don't want to have its GUI disabled, even if the property is read-only or a ReadOnly attribute is defined on the property. + Use this attribute on any drawer to force GUI being enabled in these cases. + + + + + [AllowGUIEnabledForReadonly] + public sealed class SomeDrawerDrawer<T> : OdinValueDrawer<T> where T : class + { + } + + + + + + + Base class for all Odin drawers. In order to create your own custom drawers you need to derive from one of the following drawers: + + + + + + + + Remember to provide your custom drawer with an in order for it to be located by the . + Drawers require a context, and are instantiated automatically by the . + Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection in many simple cases. Checkout the manual for more information. + + + + + + + + + + + + + + + + + If true then this drawer will be skipped in the draw chain. Otherwise the drawer will be called as normal in the draw chain. + + + + + Gets a value indicating if the drawer has been initialized yet. + + + + + Gets the property this drawer draws for. + + + + + Override this method in order to define custom type constraints to specify whether or not a type should be drawn by the drawer. + Note that Odin's has full support for generic class constraints, so most often you can get away with not overriding CanDrawTypeFilter. + + The type. + + Returns true by default, unless overridden. + + + + + Initializes the drawer instance. + + + + + + Initializes the drawer instance. Override this to implement your own initialization logic. + + + + + Draws the property with a custom label. + + The label. Null is allow if you wish no label should be drawn. + + + + Draws the property with GUILayout support. + + The label. This can be null, so make sure your drawer supports that. + + + + Calls the next drawer in the draw chain. + + The label to pass on to the next drawer. + + + + Gets a value indicating if the drawer can draw for the specified property. + Override this to implement a custom property filter for your drawer. + + The property to test. + true if the drawer can draw for the property. Otherwise false. + + + + Provides a variety of miscellaneous utilities widely used in the inspector. + + + + + Converts an Odin property path to a deep reflection path. + + + + + Converts an Odin property path (without groups included) into a Unity property path. + + + + + Prepares a property tree for drawing, and handles management of undo, as well as marking scenes and drawn assets dirty. + + The tree to be drawn. + Whether to register undo commands for the changes made to the tree. This can only be set to true if the tree has a to represent. + tree is null + + + + Ends drawing a property tree, and handles management of undo, as well as marking scenes and drawn assets dirty. + + The tree. + + + + Draws all properties in a given property tree; must be wrapped by a and . + + The tree to be drawn. + + + + Draws a property in the inspector using a given label. + + + + + Odin property system exception. + + + + + Initializes a new instance of OdinPropertyException. + + The message for the exception. + An inner exception. + + + + + Base class for all value drawers. Use this class to create your own custom drawers for any specific type. + + + + Remember to provide your custom drawer with an + in order for it to be located by the . + + + + Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection + in many simple cases. Checkout the manual for more information on handling multi-selection. + + + + + Checkout the manual for more information. + + + + + public class MyCustomBaseType + { + + } + + public class MyCustomType : MyCustomBaseType + { + + } + + // Remember to wrap your custom attribute drawer within a #if UNITY_EDITOR condition, or locate the file inside an Editor folder. + + public sealed class MyCustomBaseTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomBaseType + { + protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label) + { + T value = entry.SmartValue; + // Draw your custom drawer here using GUILayout and EditorGUILAyout. + } + } + + // Usage: + // Both values will be drawn using the MyCustomBaseTypeDrawer + public class MyComponent : SerializedMonoBehaviour + { + public MyCustomBaseType A; + + public MyCustomType B; + } + + + + + + Odin uses multiple drawers to draw any given property, and the order in which these drawers are + called are defined using the . + Your custom drawer injects itself into this chain of drawers based on its . + If no is defined, a priority is generated automatically based on the type of the drawer. + Each drawer can ether choose to draw the property or not, or pass on the responsibility to the + next drawer by calling CallNextDrawer(). An example of this is provided in the documentation for . + + + + This means that there is no guarantee that your drawer will be called, sins other drawers + could have a higher priority than yours and choose not to call CallNextDrawer(). + + + + To avoid this, you can tell Odin, that your drawer is a PrependDecorator or an AppendDecorator drawer (see ) as shown in the example shows below. + Prepend and append decorators are always drawn and are also ordered by the . + + + + Note that Odin's have full support for generic class constraints, + and if that is not enough, you can also add additional type constraints by overriding CanDrawTypeFilter(Type type). + + + + Also note that all custom property drawers needs to handle cases where the label provided by the DrawPropertyLayout is null, + otherwise exceptions will be thrown when in cases where the label is hidden. For instance when [HideLabel] is used, or the property is drawn within a list where labels are also not shown. + + + + // [OdinDrawer(OdinDrawerBehaviour.DrawProperty)] // default + // [OdinDrawer(OdinDrawerBehaviour.AppendDecorator)] + [OdinDrawer(OdinDrawerBehaviour.PrependDecorator)] + [DrawerPriority(DrawerPriorityLevel.AttributePriority)] + public sealed class MyCustomTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomType + { + public override bool CanDrawTypeFilter(Type type) + { + return type != typeof(SomeType); + } + + protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label) + { + T value = entry.SmartValue; + // Draw property here. + } + } + + + + + + + + + + + + + + + + + + + The value entry of the property. + + + + + Draws the property with GUILayout support. + + The label. This can be null, so make sure your drawer supports that. + + + + Gets a value indicating if the drawer can draw for the specified property. + + The property to test. + true if the drawer can draw for the property. Otherwise false. + + + + Gets a value indicating if the drawer can draw for the specified property. + Override this to implement a custom property filter for your drawer. + + The property to test. + true if the drawer can draw for the property. Otherwise false. + + + + Custom types used by the can choose to implement the ITemporaryContext + interface in order to be notified when the context gets reset. + + + + + Called by when the context gets reset. + + + + + Used by all InspectorProperty to tell Odin how to set or get a value on any given property. + + + + + Whether the value is readonly. + + + + + Gets the type of the owner. + + + + + Gets the type of the value. + + + + + Sets the weakly typed value on a given weakly typed owner. + + The owner. + The value. + + + + Gets the value from a given weakly typed owner. + + The weakly typed owner. + The found value. + + + + Used by all to tell Odin how to set or get a value on any given property. + + + + + Sets the value on a given owner. + + The owner. + The value. + + + + Gets the value from a given owner. + + The owner. + + + + When creating custom property drawers with or etc, + an OdinDrawerAttribute must be defined on the custom drawer class itself in order to specify that the drawer is meant to be included in the inspector. + If no OdinDrawerAttribute is defined, the will ignore your drawer. + + + Checkout the manual for more information. + + + + // Specify that this drawer must be included in the inspector; without this, it will not be drawn + public class MyCustomTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomBaseType + { + protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label) + { + T value = entry.SmartValue; + // Draw property here. + + // Optionally, call the next drawer in line. + this.CallNextDrawer(entry, label); + } + } + + + + + + + + + + + + Initializes a new instance of the class. + + + + + Property drawer for primitive composite properties. + + + + + Draws the property. + + + + + Draws the property field. + + + + + Represents the children of an . + + + + + The that this instance handles children for. + + + + + Gets a child by index. This is an alias for . + + The index of the child to get. + The child at the given index. + + + + Gets a child by name. This is an alias for . + + The name of the child to get. + The child, if a child was found; otherwise, null. + + + + Initializes a new instance of the class. + + The property to handle children for. + property is null + + + + The number of children on the property. + + + + + Updates this instance of . + + + + + Gets a child by name. + + The name of the child to get. + The child, if a child was found; otherwise, null. + name + + + + Gets a child by index. + + The index of the child to get. + + The child at the given index. + + The given index was out of range. + + + + Gets the path of the child at a given index. + + The index to get the path of. + The path of the child at the given index. + The given index was out of range. + + + + Returns an IEnumerable that recursively yields all children of the property, depth first. + + + + + Gets the property's already created children. If the child count is less than or equal to 10000, children are returned in order. If the count is larger than 10000, they are returned in no particular order. + + + + + Gets the enumerator. + + + + + Gets the enumerator. + + + + + Represents a weakly typed collection of values for a - one value per selected inspector target. + + + + + The property whose values are represented. + + + + + Initializes a new instance of the class. + + The property to represent. + property is null + + + + Whether the values have been changed since was last called. + + + + + The number of values in the collection. + + + + + Gets a value indicating whether this instance is synchronized. + + + true if this instance is synchronized; otherwise, false. + + + + + Gets the synchronization root object. + + + The synchronization root object. + + + + + The original values of the (loosely typed) value collection, such as they were immediately after the last call. + + + + + Gets or sets the weakly typed at the specified index. + + + The value. + + The index to set. + + + + Gets an enumerator for the collection. + + + + + Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . + + + + + Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. + + + + + Determines whether the collection contains the specified value. + + The value. + + true if the collection contains the specified value; otherwise, false. + + + + + Copies the collection to an array. + + The array to copy to. + The index to copy from. + + + + Gets the index of the given value, or -1 if the value was not found. + + The value to get the index of. + The index of the given value, or -1 if the value was not found. + + + + Gets the weakly typed value at the given index. + + The index of the value to get. + The weakly typed value at the given index + + + + Sets the weakly typed value at the given index. + + The index to set the value of. + The value to set. + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + Marks the value collection as being dirty, regardless of any value changes. + + + + + Represents a strongly typed collection of values for a - one value per selected inspector target. + + The element type of the collection. + + + + + Initializes a new instance of the class. + + The property. + The internal array. + The original array. + The internal atom array. + The original atom array. + + + + Whether the values have been changed since was last called. + + + + + The number of values in the collection. + + + + + Gets a value indicating whether this instance is synchronized. + + + true if this instance is synchronized; otherwise, false. + + + + + Gets the synchronization root object. + + + The synchronization root object. + + + + + The original values of the (loosely typed) value collection, such as they were immediately after the last call. + + + + + Gets or sets the at the specified index. + + + The . + + The index. + + + + + Gets an enumerator for the collection. + + + + + Marks the value collection as being clean again. This is typically called at the end of the current GUI frame, during . + + + + + Reverts the value collection to its origin values (found in ) from the last call, and marks the value collection as being clean again. + + + + + Copies the collection to an array. + + The array to copy to. + The index to copy from. + + + + Gets the weakly typed value at the given index. + + The index of the value to get. + + The weakly typed value at the given index + + + + + Sets the weakly typed value at the given index. + + The index to set the value of. + The value to set. + + + + Determines whether the collection contains the specified value. + + The value. + + true if the collection contains the specified value; otherwise, false. + + + + + Gets the index of the given value, or -1 if the value was not found. + + The value to get the index of. + + The index of the given value, or -1 if the value was not found. + + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + Force sets the value, ignoring whether it is editable or not. + Note that this will fail on list element value entries where is true on the parent value entry. + + The selection index of the value. + The value to be set. + + + + + Marks the value collection as being dirty, regardless of any value changes. + + + + + A contextual value attached to an , mapped to a key, contained in a . + + + + + The contained value. + + + + + Creates a new PropertyContext. + + + + + Performs an explicit conversion from to . + + The context. + + The result of the conversion. + + + + + Returns a that represents this instance, of the format ": Value.ToString()". + + + A that represents this instance. + + + + + Contains a context for an , which offers the ability to address persistent values by key across several editor GUI frames. + Use this in drawers to store contextual editor-only values such as the state of a foldout. + + + + + Initializes a new instance of the class. + + The property. + property + + + + Gets a global context value for a given key, using a given delegate to generate a default value if the context doesn't already exist. + Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property. + + The type of the context value to get. + The key of the context value to get. + A delegate for generating a default value. + The found context. + + + + Gets a global context value for a given key, using a given default value if the context doesn't already exist. + Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property. + + The type of the context value to get. + The key of the context value to get. + The default value to set if the context value doesn't exist yet. + The found context. + + + + Gets a global context value for a given key, and creates a new instance of as a default value if the context doesn't already exist. + Global contexts are not associated with any one specific drawer, and so are shared across all drawers for this property. + + The type of the context value to get. + The key of the context value to get. + The found context. + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Local property contexts are obsolete. Use local drawer fields instead. + + + + + Gets a object and creates a object for it. + + The type of the value of the context. + The instance of the drawer. + The key for the context. + The default value for the context. + + + + Gets a object and creates a object for it. + Returns true when the is first created. Otherwise false. + + The type of the value of the context. + The instance of the drawer. + The key for the context. + The object. + Returns true when the is first created. Otherwise false. + + + + Swaps context values with a given . + + The context to swap with. + + + + An can implement this interface to indicate that it defines right-click context menu items for properties that it draws. + + + + + Method that is invoked when a user has right-clicked a property, and the context menu is being built. The method is invoked in order of drawer priority. + + The property that has been right-clicked on. + The generic menu instance that is being built. Add items to this. + + + + A polymorphic alias for getting and setting the values of an . + + The type of the owner. + The type of the value. + The type of the property owner. + The type of the property value. + + + + Gets the type of the owner. + + + + + Gets the type of the value. + + + + + Whether the value is readonly. + + + + + Initializes a new instance of the class. + + The information. + info + + + + Gets the value from a given weakly typed owner. + + The weakly typed owner. + The found value. + + + + Gets the value from a given owner. + + The owner. + owner is null + + + + Sets the weakly typed value on a given weakly typed owner. + + The owner. + The value. + + + + Sets the value on a given owner. + + The owner. + The value. + + + + Contains meta-data information about a property in the inspector, that can be used to create an actual property instance. + + + + + The name of the property. + + + + + Gets a value indicating whether this InspectorPropertyInfo has any backing members. + + + + + Gets a value indicating whether this InspectorPropertyInfo has only a single backing member. + + + + + The member info of the property. If the property has many member infos, such as if it is a group property, the first member info of is returned. + + + + + Indicates which type of property it is. + + + + + The serialization backend for this property. + + + + + The type on which this property is declared. + + + + + The base type of the value which this property represents. If there is no value, this will be null. + + + + + Whether this property is editable or not. + + + + + All member infos of the property. There will only be more than one member if it is an . + + + + + The order value of this property. Properties are (by convention) ordered by ascending order, IE, lower order values are shown first in the inspector. The final actual ordering of properties is decided upon by the property resolver. + + + + + The attributes associated with this property. + + + + + Whether this property only exists as a Unity , and has no associated managed member to represent it. + This case requires some special one-off custom behaviour in a few places. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets the first attribute of a given type on this property. + + + + + Gets the first attribute of a given type on this property, which is not contained in a given hashset. + + The attributes to exclude. + + + + Gets all attributes of a given type on the property. + + + + + The s of all the individual properties in this group. + + + + + Gets the property's method delegate, if there is one. Note that this is null if a method property is backed by an actual method member. + + + + + Represents a property in the inspector, and provides the hub for all functionality related to that property. + + + + + Gets the property which is the ultimate root of this property's serialization. + + + + + The name of the property. + + + + + The nice name of the property, usually as converted by . + + + + + The cached label of the property, usually containing . + + + + + The full Odin path of the property. To get the Unity property path, see . + + + + + The child index of this property. + + + + + Gets the resolver for this property's children. + + + + + The current recursive draw depth, incremented for each time that the property has caused itself to be drawn recursively. + Note that this is the current recursion level, not the total amount of recursions so far this frame. + + + + + The amount of times that the property has been drawn so far this frame. + + + + + How deep in the drawer chain the property currently is, in the current drawing session as determined by . + + + + + Whether this property supports having prefab modifications applied or not. + + + + + Gets an immutable list of the components attached to the property. + + + + + Gets an immutable list of processed attributes for the property. + + + + + Gets an array of the state updaters of the property. Don't change the contents of this array! + + + + + The value entry that represents the base value of this property. + + + + + The value entry that represents the strongly typed value of the property; this is possibly an alias entry in case of polymorphism. + + + + + The parent of the property. If null, this property is a root-level property in the . + + + + + The of this property. + + + + + The that this property exists in. + + + + + The children of this property. + + + + + The context container of this property. + + + + + The last rect that this property was drawn within. + + + + + The type on which this property is declared. This is the same as . + + + + + The parent values of this property, by selection index; this represents the values that 'own' this property, on which it is declared. + + + + + The full Unity property path of this property; note that this is merely a converted version of , and not necessarily a path to an actual Unity property. + In the case of Odin-serialized data, for example, no Unity properties will exist at this path. + + + + + The full path of this property as used by deep reflection, containing all the necessary information to find this property through reflection only. This is used as the path for prefab modifications. + + + + + The full path of this property as used by prefab modifications and the deep reflection system, containing all the necessary information to find this property through reflection only. + + + + + The PropertyState of the property at the current draw count index. + + + + + Gets the component of a given type on the property, or null if the property does not have a component of the given type. + + + + + Records the property's serialization root for undo to prepare for undoable changes, with a custom string that includes the property path and Unity object name. If a message is specified, it is included in the custom undo string. + + + + + Gets the first attribute of a given type on this property. + + + + + Gets the first attribute of a given type on this property, which is not contained in a given hashset. + + The attributes to exclude. + + + + Gets all attributes of a given type on the property. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Draws this property in the inspector. + + + + + Draws this property in the inspector with a given default label. This default label may be overridden by attributes on the drawn property. + + + + + Push a draw session. This is used by and . + + + + + Increments the current drawer chain index. This is used by . + + + + + Pop a draw session. This is used by and . + + + + + Gets the next property in the , or null if none is found. + + Whether to include children or not. + Whether to only include visible properties. + + + + Finds the first parent property that matches a given predicate. + + + + + Finds the first child recursively, that matches a given predicate. + + + + + Updates the property. This method resets the temporary context, and updates the value entry and the property children. + + If true, the property will update regardless of whether it has already updated for the current . + + + + Populates a generic menu with items from all drawers for this property that implement . + + + + + Determines whether this property is the child of another property in the hierarchy. + + The property to check whether this property is the child of. + other is null + + + + Determines whether this property is a parent of another property in the hierarchy. + + The property to check whether this property is the parent of. + other is null + + + + Represents a set of values of the same type as a tree of properties that can be drawn in the inspector, and provides an array of utilities for querying the tree of properties. + + + + + Delegate for on property value changed callback. + + + + + The component providers that create components for each property in the tree. If you change this list after the tree has been used, you should call tree.RootProperty.RefreshSetup() to make the changes update properly throughout the tree. + + + + + The that this tree represents, if the tree was created for a . + + + + + The current update ID of the tree. This is incremented once, each update, and is used by to avoid updating multiple times in the same update round. + + + + + The type of the values that the property tree represents. + + + + + The actual values that the property tree represents. + + + + + The number of root properties in the tree. + + + + + The prefab modification handler of the tree. + + + + + Whether this property tree also represents members that are specially serialized by Odin. + + + + + Gets a value indicating whether or not to draw the mono script object field at the top of the property tree. + + + + + Gets a value indicating whether or not the PropertyTree is inspecting a static type. + + + + + Gets or sets the for the PropertyTree. + + + + + Gets or sets the for the PropertyTree. + + + + + Gets or sets the for the PropertyTree. + + + + + Gets or sets the for the PropertyTree. + + + + + An event that is invoked whenever an undo or a redo is performed in the inspector. + The advantage of using this event on a property tree instance instead of + is that this event will be desubscribed from + when the selection changes and the property + tree is no longer being used, allowing the GC to collect the property tree. + + + + + This event is invoked whenever the value of any property in the entire property tree is changed through the property system. + + + + + Creates a new for all target values of a . + + + + + Gets the root property of the tree. + + + + + Gets the secret root property of the tree, which hosts the property resolver used to resolve the "actual" root properties of the tree. + + + + + Registers that a given property is dirty and needs its changes to be applied at the end of the current frame. + + + + + Schedules a delegate to be invoked at the end of the current GUI frame. + + The action delegate to be delayed. + + + + Schedules a delegate to be invoked at the end of the next Repaint GUI frame. + + The action to be delayed. + + + + Enumerates over the properties of the tree. + + Whether to include children of the root properties or not. If set to true, every property in the entire tree will be enumerated. + Whether to only include visible properties. Properties whose parents are invisible are considered invisible. + + + + Gets the property at the given path. Note that this is the path found in , not the Unity path. + + The path of the property to get. + + + + Gets the property at the given path. Note that this is the path found in , not the Unity path. + + The path of the property to get. + + + + + Gets the property at the given Unity path. + + The Unity path of the property to get. + + + + Gets the property at the given Unity path. + + The Unity path of the property to get. + + + + + Gets the property at the given deep reflection path. + + The deep reflection path of the property to get. + + + + Gets the property at the given Odin prefab modification path. + + The prefab modification path of the property to get. + + + + Gets the property at the given Odin prefab modification path. + + The prefab modification path of the property to get. + + + + + Draw the property tree, and handles management of undo, as well as marking scenes and drawn assets dirty. + + This is a shorthand for calling + , + and . + . + + + + + + Draws a search bar for the property tree, and draws the search results if the search bar is used. + If this method returns true, the property tree should generally not be drawn normally afterwards. + Note that this method will throw exceptions if the property tree is not set up to be searchable; for that, see . + + True if the property tree is being searched and is currently drawing its search results, otherwise false. + + + + Gets a Unity property for the given Odin or Unity path. If there is no for this property tree, or no such property is found in the , a property will be emitted using . + + The Odin or Unity path to the property to get. + + + + Gets a Unity property for the given Odin or Unity path. If there is no for this property tree, or no such property is found in the , a property will be emitted using . + + The Odin or Unity path to the property to get. + The backing field of the Unity property. + + + + Checks whether a given object instance is referenced anywhere in the tree, and if it is, gives the path of the first time the object reference was encountered as an out parameter. + + The reference value to check. + The first found path of the object. + + + + Gets the number of references to a given object instance in this tree. + + + + + Updates all properties in the entire tree, and validates the prefab state of the tree, if applicable. + + + + + Replaces all occurrences of a value with another value, in the entire tree. + + The value to find all instances of. + The value to replace the found values with. + + + + Gets the root tree property at a given index. + + The index of the property to get. + + + + Invokes the actions that have been delayed using and . + + + + + Applies all changes made with properties to the inspected target tree values, and marks all changed Unity objects dirty. + + true if any values were changed, otherwise false + + + + Invokes the OnValidate method on the property tree's targets if they are derived from and have the method defined. + + + + + Registers an object reference to a given path; this is used to ensure that objects are always registered after having been encountered once. + + The referenced object. + The property that contains the reference. + + + + Creates a PropertyTree to inspect the static values of the given type. + + The type to inspect. + A PropertyTree instance for inspecting the type. + + + + Creates a new for a given target value. + + The target to create a tree for. + target is null + + + + Creates a new for a set of given target values. + Note that the targets all need to be of the same type. + + The targets to create a tree for. + targets is null + + + + Creates a new for all target values of a . + + The serialized object to create a tree for. + serializedObject is null + + + + Creates a new for a set of given target values. + Note that the targets all need to be of the same type. + + The targets to create a tree for. + + + + Creates a new for a set of given target values, represented by a given . + Note that the targets all need to be of the same type. + + The targets to create a tree for. + The serialized object to create a tree for. Note that the target values of the given must be the same values given in the targets parameter. + + + + Sets whether the property tree should be searchable or not, and allows the passing in of a custom SearchableAttribute instance to configure the search. + + Whether the tree should be set to be searchable or not. + If the tree is set to be searchable, then if this parameter is not null, it will be used to configure the property tree search. If the parameter is null, the SearchableAttribute on the tree's will be used. If that property has no such attribute, then default search settings will be applied. + + + + Represents a set of strongly typed values as a tree of properties that can be drawn in the inspector, and provides an array of utilities for querying the tree of properties. + This class also handles management of prefab modifications. + + + + + Gets the root property of the tree. + + + + + Gets the secret root property of the PropertyTree. + + + + + Gets the for the PropertyTree. + + + + + The current update ID of the tree. This is incremented once, each update, and is used by to avoid updating multiple times in the same update round. + + + + + The that this tree represents, if the tree was created for a . + + + + + The type of the values that the property tree represents. + + + + + The strongly types actual values that the property tree represents. + + + + + The weakly types actual values that the property tree represents. + + + + + The number of root properties in the tree. + + + + + Whether this property tree also represents members that are specially serialized by Odin. + + + + + Initializes a new instance of the class, inspecting only the target () type's static members. + + + + + Initializes a new instance of the class. + + The serialized object to represent. + + + + Initializes a new instance of the class. + + The targets to represent. + + + + Initializes a new instance of the class. + + The targets to represent. + The serialized object to represent. Note that the target values of the given must be the same values given in the targets parameter. + targets is null + + There must be at least one target. + or + A given target is a null value. + + + + + Applies all changes made with properties to the inspected target tree values. + + + true if any values were changed, otherwise false + + + + + Registers that a given property is dirty and needs its changes to be applied at the end of the current frame. + + + + + + + Updates all properties in the entire tree, and validates the prefab state of the tree, if applicable. + + + + + Checks whether a given object instance is referenced anywhere in the tree, and if it is, gives the path of the first time the object reference was encountered as an out parameter. + + The reference value to check. + The first found path of the object. + + + + Gets the number of references to a given object instance in this tree. + + + + + + Gets the property at the given path. Note that this is the path found in , not the Unity path. + + The path of the property to get. + + + + Gets the property at the given path. Note that this is the path found in , not the Unity path. + + The path of the property to get. + + + + + Finds the property at the specified unity path. + + The unity path for the property. + The property found at the path. + + + + Finds the property at the specified unity path. + + The unity path for the property. + + The property found at the path. + + + + Finds the property at the specified modification path. + + The prefab modification path for the property. + The property found at the path. + + + + Finds the property at the specified modification path. + + The prefab modification path for the property. + + The property found at the path. + + + + Gets a Unity property for the given Odin or Unity path. If there is no for this property tree, or no such property is found in the , a property will be emitted using . + + The Odin or Unity path to the property to get. + The backing field of the Unity property. + + + + Enumerates over the properties of the tree. WARNING: For tree that have large targets with lots of data, this may involve massive amounts of work as the full tree structure is resolved. USE THIS METHOD SPARINGLY AND ONLY WHEN ABSOLUTELY NECESSARY! + + Whether to include children of the root properties or not. If set to true, every property in the entire tree will be enumerated. + /// Whether to only include visible properties. Properties whose parents are invisible are considered invisible. + + + + Replaces all occurrences of a value with another value, in the entire tree. + + The value to find all instances of. + The value to replace the found values with. + + The value to replace with must either be null or be the same type as the value to replace (" + from.GetType().Name + "). + + + + Gets the root tree property at a given index. + + The index of the property to get. + + + + Schedules a delegate to be invoked at the end of the current GUI frame. + + The action delegate to be delayed. + action + + + + Schedules a delegate to be invoked at the end of the next Repaint GUI frame. + + The action to be delayed. + action + + + + Invokes the actions that have been delayed using and . + + + + + Enumeration describing the different types of properties that exist. + + + + + Property represents a value. + + + + + Property represents a method. + + + + + Property represents a named group of properties. + + + + + Enumeration for designating whether a has a special state,. + + + + + The value entry has no special state. + + + + + The property is a reference to another property. Get the path of the referenced property from . + + + + + The value entry is a null value. + + + + + The value entry has a primitive value conflict across selected indices. + A primitive value conflict is when primitive values, such a strings or floats, differ. + + + + + The value entry has a reference value conflict across selected indices. + A reference value conflict is when the types of reference type values differ, or when some values are null while others are not. + + + + + The value entry has a reference path conflict across selected indices. + A reference path conflict is when the property consists of references to many conflicting paths. Use to get paths to all referenced objects. + + + + + The value entry has a collection length conflict across selected indices. + A collection length conflict is when the property represents multiple parallel collections, and their lengths differ. + + + + + Class that describes the different possible serialization backends that a property can have, + and specifies the capabilities of each backend. + + + + + The property is serialized by Unity's polymorphic serialization backend via the [SerializeReference] attribute. Polymorphism, null values and cyclical references are supported. + + + + + The property is serialized by Unity's classic serialization backend. Polymorphism, null values and types such as are not supported. + + + + + The property is serialized by Odin. Polymorphism, null values and types such as are supported. + + + + + The property is not serialized by anything - possibly because it is a method, possibly because it is a field or property shown in the inspector without being serialized. + In the case of fields or properties, polymorphism, null values and types such as are supported, but will not be saved. + + + + + The property is not serialized by anything - possibly because it is a method, possibly because it is a field or property shown in the inspector without being serialized. + In the case of fields or properties, polymorphism, null values and types such as are supported, but will not be saved. + + + + + The property is serialized by Unity's classic serialization backend. Polymorphism, null values and types such as are not supported. + + + + + The property is serialized by Unity's polymorphic serialization backend via the [SerializeReference] attribute. Polymorphism, null values and cyclical references are supported. + + + + + The property is serialized by Odin. Polymorphism, null values and types such as are supported. + + + + + An internally used interface that is used by value entries during , that lets value entries force each other to set values directly to their target objects. + This interface should not be used by people who do not know what they are doing. + + + + + Sets the actual value of a value entry, for a given selection index. + + + + + An internally used interface that is used by value entries during , that lets value entries force each other to set values directly to their target objects. + This interface should not be used by people who do not know what they are doing. + + + + + Sets the actual value of a value entry, for a given selection index. + + + + + Represents the values of an , and contains utilities for querying the values' type and getting and setting them. + + + + + + Delegate type used for the events and . + + + + + The nearest parent property that has a value. + That is, the property from which this value + entry will fetch its parentvalues from in order + to extract its own values. + + If is null, this is a root property. + + + + + Whether this value entry represents a boxed value type. + + + + + The number of parallel values this entry represents. This will always be exactly equal to the count of . + + + + + Whether this value entry is editable or not. + + + + + If this value entry has the override type , this is the path of the property it references. + + + + + The actual serialization backend for this value entry, possibly inherited from the serialization backend of the root property this entry is a child of. + Note that this is *not* always equal to . + + + + + The property whose values this value entry represents. + + + + + Provides access to the weakly typed values of this value entry. + + + + + Whether this value entry has been changed from its prefab counterpart. + + + + + Whether this value entry has had its list length changed from its prefab counterpart. + + + + + Whether this value entry has had its dictionary values changes from its prefab counterpart. + + + + + A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. + + + + + The most precise known contained type of the value entry. If polymorphism is in effect, this will be some type derived from . + + + + + The base type of the value entry. If this is value entry represents a member value, this is the type of the member. If the value entry represents a collection element, this is the element type of the collection. + + + + + The special state of the value entry. + + + + + Whether this value entry is an alias, or not. Value entry aliases are used to provide strongly typed value entries in the case of polymorphism. + + + + + The context container of this property. + + + + + Whether this type is marked as an atomic type using a . + + + + + An event that is invoked during , when any values have changed. + + + + + An event that is invoked during , when any child values have changed. + + + + + Updates the values contained in this value entry to the actual values in the target objects, and updates its state (override, type of value, etc.) accordingly. + + + + + Checks whether the values in this value entry are equal to the values in another value entry. + Note, both value entries must have the same value type, and must represent values that are .NET value types. + + + + + + + Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. + + + True if any changes were made, otherwise, false. + + + + + Determines the value state of this value entry. + + + + + Determines what the most precise contained type is on this value entry. + + + + + Updates all values in this value entry from the target tree values. + + + + + Initializes this value entry. + + + + + Creates an alias value entry of a given type, for a given value entry. This is used to implement polymorphism in Odin. + + + + + Creates a value entry for a given property, of a given value type. Note that the created value entry is returned un-updated, and needs to have called on it before it can be used. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Represents the values of an , and contains utilities for querying the values' type and getting and setting them. + + The type of the value. + + + + + An equality comparer for comparing values of type . This is gotten using . + + + + + Whether .is a primitive type; that is, the type is primitive, a string, or an enum. + + + + + Whether is a value type. + + + + + Whether is derived from . + + + + + Whether the type of the value is marked atomic. + + + + + If the type of the value is marked atomic, this an instance of an atom handler for the value type. + + + + + Initializes a new instance of the class. + + + + + Provides access to the weakly typed values of this value entry. + + + + + Provides access to the strongly typed values of this value entry. + + + + + Whether this type is marked as an atomic type using a . + + + + + A weakly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + A strongly typed smart value that represents the first element of the value entry's value collection, but has "smart logic" for setting the value that detects relevant changes and applies them in parallel. + This lets you often just use the smart value instead of having to deal with the tedium of multiple parallel values. + + + + + An array containing the original values as they were at the beginning of frame. + + + + + An array containing the current modified set of values. + + + + + An array containing the current modified set of atomic values. + + + + + An array containing the original set of atomic values. + + + + + Initializes this value entry. + + + + + Sets the actual target tree value. + + + + + Checks whether the values in this value entry are equal to the values in another value entry. + Note, both value entries must have the same value type, and must represent values that are .NET value types. + + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Determines whether the value at the given selection index is different from the given prefab value, as is relevant for prefab modification checks. + If the value is a reference type, null and type difference is checked. If value is a value type, a comparer from is used. + This method is best ignored unless you know what you are doing. + + The value to check differences against. + The selection index to compare against. + + + + Represents the values of an , and contains utilities for querying the values' type and getting and setting them. + + The type of the parent. + The type of the value. + + + + + The type from which this value entry comes. If this value entry represents a member value, this is the declaring type of the member. If the value entry represents a collection element, this is the type of the collection. + + + + + Determines what the most precise contained type is on this value entry. + + + + + Initializes this value entry. + + + + + Updates all values in this value entry from the target tree values. + + + + + Determines the value state of this value entry. + + + + + Applies the changes made to this value entry to the target objects, and registers prefab modifications as necessary. + + + True if any changes were made, otherwise, false. + + + + + Gets the parent value at the given index. + + + + + Adds menu items to the Unity Editor, draws the About window, and the preference window found under Edit > Preferences > Odin Inspector. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Sirenix preferences window. + + + + + Open preferences page for configuration object. + + + + + Opens the Odin inspector preferences window. + + + + + Opens the Odin inspector preferences window. + + + + + This class has been made fully obsolete, and has been replaced by . + It was a helper class to handle strings for labels and other similar purposes. + + + + + If any error occurred while looking for members, it will be stored here. + + + + + Obsolete. Use other constructor. + + + + + Obsolete. Use other constructor. + + + + + Creates a StringMemberHelper to get a display string. + + Inspector property to get string from. + The input string. If the first character is a '$', then StringMemberHelper will look for a member string field, property or method, and will try to parse it as an expression if it starts with '@'. + + + + Creates a StringMemberHelper to get a display string. + + Inspector property to get string from. + The input string. If the first character is a '$', then StringMemberHelper will look for a member string field, property or method, and will try to parse it as an expression if it starts with '@'./// The input string. If the first character is a '$', then StringMemberHelper will look for a member string field, property or method. + + + + Gets a value indicating whether or not the string is retrived from a from a member. + + + + + Gets the type of the object. + + + + + Gets the string from the StringMemberHelper. + Only updates the string buffer in Layout events. + + The property entry, to get the instance reference from. + The current display string. + + + + Gets the string from the StringMemberHelper. + Only updates the string buffer in Layout events. + + The property, to get the instance reference from. + The current string. + + + + Gets the string from the StringMemberHelper. + Only updates the string buffer in Layout events. + + The instance, for evt. member references. + The current string. + + + + Gets the string from the StringMemberHelper. + + The property entry, to get the instance reference from. + The current string. + + + + Gets the string from the StringMemberHelper. + + The property, to get the instance reference from. + The current string. + + + + Gets the string from the StringMemberHelper. + + The instance, for evt. member references. + The current string. + + + + Gets a unique key for any given property within a drawer. + + + + + public class MyCustomTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomBaseType + { + protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label) + { + var isToggled = entry.Context(this, "toggled", false); + isToggled.Value = SirenixEditorGUI.Label(isToggled.Value, label); + if (SirenixEditorGUI.BeginFadeGroup(UniqueDrawerKey.Create(entry, this), isToggled.Value)) + { + EditorGUI.indentLevel++; + this.CallNextDrawer(entry.Property, null); + EditorGUI.indentLevel--; + } + SirenixEditorGUI.EndFadeGroup(); + } + } + + + + + + Gets a unique key for any given property within a drawer. + + The property entry. + The drawer. + + + + + Gets a unique key for any given property within a drawer. + + The property. + The drawer. + + + + + Checks if two keys are identical. + + The other key. + + + + Checks if two keys are identical. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Unity property drawer. + + + + + Initializes the property drawer. + + + + + Draws the property. + + + + + Provides utilities for emitting ScriptableObject and MonoBehaviour-derived types with specific property names and types, and providing instances of with those names and types. + + + + + A handle for a set of emitted Unity objects. When disposed (or collected by the GC) this handle will queue the emitted object instances for destruction. + + + + + The unity property to represent. + + + + + The Unity objects to represent. + + + + + Initializes a new instance of the class. + + The unity property to represent. + The objects to represent. + + + + Finalizes an instance of the class. + + + + + Creates an emitted MonoBehaviour-based . + + Name of the field to emit. + Type of the value to create a property for. + The target count of the tree to create a property for. + The game object that the MonoBehaviour of the property is located on. + + fieldName is null + or + valueType is null + + Target count must be equal to or higher than 1. + + + + Creates an emitted ScriptableObject-based . + + Name of the field to emit. + Type of the value to create a property for. + The target count of the tree to create a property for. + + fieldName is null + or + valueType is null + + Target count must be equal to or higher than 1. + + + + Context that persists across reloading and restarting Unity. + + + + + Time stamp for when the persistent context value was last used. + Used for purging unused context. + + + + + Instatiates a persistent context. + + + + + Updates the time stamp to now. + + + + + Context that persists across reloading and restarting Unity. + + The type of the context value. + + + + The value of the context. + + + + + Creates a new persistent context object. + + + + + Formats a string with the time stamp, and the value. + + + + + Helper class that provides a local copy of a . + When the local value is changed, it also changed the global value, but the global value does not change the local value. + + The type of the context value. + + + + The value of the context. + Changing this value, also changes the global context value, but the global value does not change the local value. + + + + + Creates a local context object for the provided global context. + + The global context object. + + + + Updates the local value to the current global value. + + + + + OdinDrawer extensions. + + + + + Gets a persistent value that will survive past multiple Unity Editor Application sessions. + The value is stored in the PersistentContextCache, which has a customizable max cache size. + + + + + Provides context objects that still persist when Unity reloads or is restarted. + + + + + Gets a GlobalPersistentContext object for the specified key. + + The type of the first key. + The type of the value stored in the context object. + The first key. + The default value, used for when the context object is first created. + + + + Gets a GlobalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the value stored in the context object. + The first key. + The second key. + The default value, used for when the context object is first created. + + + + Gets a GlobalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The default value, used for when the context object is first created. + + + + Gets a GlobalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The default value, used for when the context object is first created. + + + + Gets a GlobalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the fifth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The fifth key. + The default value, used for when the context object is first created. + + + + Gets a GlobalPersistentContext object for the specified key. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the value stored in the context object. + The first key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a GlobalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the value stored in the context object. + The first key. + The second key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a GlobalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a GlobalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a GlobalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the fifth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The fifth key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a LocalPersistentContext object for the specified key. + + The type of the first key. + The type of the value stored in the context object. + The first key. + The default value, used for when the context object is first created. + + + + Gets a LocalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the value stored in the context object. + The first key. + The second key. + The default value, used for when the context object is first created. + + + + Gets a LocalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The default value, used for when the context object is first created. + + + + Gets a LocalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The default value, used for when the context object is first created. + + + + Gets a LocalPersistentContext object for the specified keys. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the fifth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The fifth key. + The default value, used for when the context object is first created. + + + + Gets a LocalPersistentContext object for the specified key. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the value stored in the context object. + The first key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a LocalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the value stored in the context object. + The first key. + The second key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a LocalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a LocalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Gets a LocalPersistentContext object for the specified keys. + Returns true when the context is first created. Otherwise false. + + The type of the first key. + The type of the second key. + The type of the third key. + The type of the fourth key. + The type of the fifth key. + The type of the value stored in the context object. + The first key. + The second key. + The third key. + The fourth key. + The fifth key. + The persistent context object. + Returns true when the context is first created. Otherwise false. + + + + Persistent Context cache object. + + + + + Estimated cache size in bytes. + + + + + The current number of context entries in the cache. + + + + + If true then persistent context is disabled entirely. + + + + + If true the context will be saved to a file in the temp directory. + + + + + The max size of the cache in bytes. + + + + + Delete the persistent cache file. + + + + + Access the StaticInspectorWindow from Tools > Odin Inspector > Static Inspector. + + + + + Member filter for access modifiers. + + + + + include public members. + + + + + Include Non-public members. + + + + + Include both public and non-public members. + + + + + Member filter for member types. + + + + + No members included. + + + + + Include field members. + + + + + Include property members. + + + + + Include method members. + + + + + Include group members. + + + + + Include members from the base types. + + + + + Include members marked with the Obsolete attribute. + + + + + Include all members except members marked with the Obsolete attribute. + + + + + Shows the window. + + + + + Opens a new static inspector window for the given type. + + + + + Draws the Odin Editor Window. + + + + + Draws the editor for the this.CurrentDrawingTargets[index]. + + + + + Contains references to UnityEngine.Networking types. These types have been removed in Unity 2019+, and thus may be null. + + + + + Contains configuration for generating an assembly that provides increased AOT support in Odin. + + + + + + Whether to automatically scan the project and generate an AOT dll, right before builds. This will only affect platforms that are in the list. + + + **This will only work on Unity 5.6 and higher!** + + + + + + Whether to automatically delete the generated AOT dll after a build has completed. + + + + + A list of platforms to automatically scan the project and generate an AOT dll for, right before builds. This will do nothing unless is true. + + + + + The path to the AOT folder that the AOT .dll and linker file is created in, relative to the current project folder. + + + + + Scans the entire project for types to support AOT serialization for. + + + + + Generates an AOT DLL, using the current configuration of the AOTGenerationConfig instance. + + + + + The Odin Inspector Serialization Debugger Window. + + + + + + Opens the Serialization Debugger Window with the last debugged type. + + + + + Opens the Serialization Debugger Window and debugs the given type. + + The type to debug serialization of. + + + + Initializes the Serialization Debugger Window. + + + + diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml.meta new file mode 100644 index 00000000..5ffa4262 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.OdinInspector.Editor.xml.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2efd084e2a5f8914087feecedd020a5d +timeCreated: 1602076756 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll new file mode 100644 index 00000000..75651123 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.mdb b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.mdb new file mode 100644 index 00000000..cef0f0e0 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.mdb differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.mdb.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.mdb.meta new file mode 100644 index 00000000..d37ac704 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.mdb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6a232775d1a778e4599ab6174830fa8d +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.meta new file mode 100644 index 00000000..5cad4e4f --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.dll.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 74721b9f0af448f5ae2e91102a1a5edd +timeCreated: 1488812560 +licenseType: Store +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 1 + settings: + Exclude Android: 0 + Exclude Editor: 0 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude N3DS: 0 + Exclude OSXIntel: 0 + Exclude OSXIntel64: 0 + Exclude OSXUniversal: 0 + Exclude PS4: 0 + Exclude PSM: 0 + Exclude PSP2: 0 + Exclude SamsungTV: 0 + Exclude Tizen: 0 + Exclude WebGL: 0 + Exclude WiiU: 0 + Exclude Win: 0 + Exclude Win64: 0 + Exclude WindowsStoreApps: 0 + Exclude XboxOne: 0 + Exclude iOS: 0 + Exclude tvOS: 0 + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml new file mode 100644 index 00000000..dd580908 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml @@ -0,0 +1,202 @@ + + + + Sirenix.Serialization.Config + + + + + A helper class for quickly and easily defining custom loggers. + + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Specifies a data format to read and write in. + + + + + A custom packed binary format. This format is most efficient and almost allocation-free, + but its serialized data is not human-readable. + + + + + A JSON format compliant with the json specification found at "http://www.json.org/". + + This format has rather sluggish performance and allocates frightening amounts of string garbage. + + + + + A format that does not serialize to a byte stream, but to a list of data nodes in memory + which can then be serialized by Unity. + + This format is highly inefficient, and is primarily used for ensuring that Unity assets + are mergeable by individual values when saved in Unity's text format. This makes + serialized values more robust and data recovery easier in case of issues. + + This format is *not* recommended for use in builds. + + + + + Defines default loggers for serialization and deserialization. This class and all of its loggers are thread safe. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + The policy for handling errors during serialization and deserialization. + + + + + Attempts will be made to recover from errors and continue serialization. Data may become invalid. + + + + + Exceptions will be thrown when errors are logged. + + + + + Exceptions will be thrown when warnings or errors are logged. + + + + + Not yet documented. + + + + + Text for the cautionary serialization warning shown in the inspector. + + + + + Text for the hide button for the cautionary serialization warning shown in the inspector. + + + + + Text for the hide button for the cautionary prefab warning shown in the inspector. + + + + + Whether the user has chosen to hide the cautionary serialization warning. + + + + + Whether the user has chosen to hide the warning messages related to the OdinSerialize attribute. + + + + + Whether the user has chosen to hide the warning messages related to the SerializeField and ShowInInspector attributes on non-serialized members. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Implements methods for logging warnings, errors and exceptions during serialization and deserialization. + + + + + Logs a warning. + + The warning to log. + + + + Logs an error. + + The error to log. + + + + Logs an exception. + + The exception to log. + + + + The policy for which level of logging to do during serialization and deserialization. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml.meta new file mode 100644 index 00000000..c9bf4cb4 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.Config.xml.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 481ffd67ac2fe794eaa3c097f6c1f891 +timeCreated: 1602076756 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll new file mode 100644 index 00000000..9ca69385 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.mdb b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.mdb new file mode 100644 index 00000000..decc65c2 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.mdb differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.mdb.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.mdb.meta new file mode 100644 index 00000000..139d62d5 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.mdb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 00e4758ead4c64347a6f972b154d48d2 +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.meta new file mode 100644 index 00000000..5b6100df --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Serialization.dll.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 5f3147f7af4c49739579b966c458f5e4 +timeCreated: 1488828285 +licenseType: Store +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude N3DS: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude PS4: 1 + Exclude PSM: 1 + Exclude PSP2: 1 + Exclude SamsungTV: 1 + Exclude Tizen: 1 + Exclude WebGL: 1 + Exclude WiiU: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 1 + Exclude XboxOne: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + Editor: + enabled: 1 + settings: + DefaultValueInitialized: true + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll new file mode 100644 index 00000000..828c9096 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.mdb b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.mdb new file mode 100644 index 00000000..ac573f8f Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.mdb differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.mdb.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.mdb.meta new file mode 100644 index 00000000..28e17efe --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.mdb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6e2df192b16071445824cae9393a8337 +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.meta new file mode 100644 index 00000000..9a780880 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.dll.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 5c65184932ff4fd48a343e2360256baf +timeCreated: 1488828285 +licenseType: Store +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude N3DS: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude PS4: 1 + Exclude PSM: 1 + Exclude PSP2: 1 + Exclude SamsungTV: 1 + Exclude Tizen: 1 + Exclude WebGL: 1 + Exclude WiiU: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 1 + Exclude XboxOne: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + Editor: + enabled: 1 + settings: + DefaultValueInitialized: true + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml new file mode 100644 index 00000000..b2ea0ad0 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml @@ -0,0 +1,7771 @@ + + + + Sirenix.Utilities.Editor + + + + + Icon for using in editor GUI. + + + + + Gets the raw input icon texture. + + + + + Gets the icon's highlighted texture. + + + + + Gets the icon's active texture. + + + + + Gets the icon's inactive texture. + + + + + Gets a GUIContent object with the active texture. + + + + + Gets a GUIContent object with the inactive texture. + + + + + Gets a GUIContent object with the highlighted texture. + + + + + Draws the icon in a square rect, with a custom shader that makes the icon look better when down-scaled. + This also handles mouseover effects, and linier color spacing. + + + + + Draws the icon in a square rect, with a custom shader that makes the icon look better when down-scaled. + This also handles mouseover effects, and linier color spacing. + + + + + Draws the icon in a square rect, with a custom shader that makes the icon look better when down-scaled. + This also handles mouseover effects, and linier color spacing. + + + + + Collection of EditorIcons for use in GUI drawing. + + + + + Gets an icon of an airplane symbol. + + + + + Gets an icon of an alert circle symbol. + + + + + Gets an icon of an alert triangle symbol. + + + + + Gets an icon of an arrow down symbol. + + + + + Gets an icon of an arrow left symbol. + + + + + Gets an icon of an arrow right symbol. + + + + + Gets an icon of an arrow up symbol. + + + + + Gets an icon of a bell symbol. + + + + + Gets an icon of a car symbol. + + + + + Gets an icon of a char1 symbol. + + + + + Gets an icon of a char2 symbol. + + + + + Gets an icon of a char3 symbol. + + + + + Gets an icon of a char graph symbol. + + + + + Gets an icon of a checkmark symbol. + + + + + Gets an icon of a clock symbol. + + + + + Gets an icon of a clouds symbol. + + + + + Gets an icon of a clouds rainy symbol. + + + + + Gets an icon of a clouds rainy sunny symbol. + + + + + Gets an icon of a clouds rainy thunder symbol. + + + + + Gets an icon of a clouds thunder symbol. + + + + + Gets an icon of a crosshair symbol. + + + + + Gets an icon of a cut symbol. + + + + + Gets an icon of a day calendar symbol. + + + + + Gets an icon of a download symbol. + + + + + Gets an icon of an eject symbol. + + + + + Gets an icon of an eye dropper symbol. + + + + + Gets an icon of a female symbol. + + + + + Gets an icon of a file symbol. + + + + + Gets an icon of a file cabinet symbol. + + + + + Gets an icon of a finnish banner symbol. + + + + + Gets an icon of a flag symbol. + + + + + Gets an icon of a flag finnish symbol. + + + + + Gets an icon of a folder symbol. + + + + + Gets an icon of a folder back symbol. + + + + + Gets an icon of a gKey symbol. + + + + + Gets an icon of a globe symbol. + + + + + Gets an icon of a grid blocks symbol. + + + + + Gets an icon of a grid image text symbol. + + + + + Gets an icon of a grid image text list symbol. + + + + + Gets an icon of a grid layout symbol. + + + + + Gets an icon of a hamburger menu symbol. + + + + + Gets an icon of a house symbol. + + + + + Gets an icon of an image symbol. + + + + + Gets an icon of an image collection symbol. + + + + + Gets an icon of an info symbol. + + + + + Gets an icon of a letter symbol. + + + + + Gets an icon of a light bulb symbol. + + + + + Gets an icon of a link symbol. + + + + + Gets an icon of a list symbol. + + + + + Gets an icon of a loading bar symbol. + + + + + Gets an icon of a lock locked symbol. + + + + + Gets an icon of a lock unlocked symbol. + + + + + Gets an icon of a lock unloacked symbol. + + + + + Gets an icon of a magnifying glass symbol. + + + + + Gets an icon of a male symbol. + + + + + Gets an icon of a marker symbol. + + + + + Gets an icon of a maximize symbol. + + + + + Gets an icon of a microphone symbol. + + + + + Gets an icon of a minimize symbol. + + + + + Gets an icon of a minus symbol. + + + + + Gets an icon of a mobile phone symbol. + + + + + Gets an icon of a money symbol. + + + + + Gets an icon of a move symbol. + + + + + Gets an icon of a multi user symbol. + + + + + Gets an icon of a next symbol. + + + + + Gets an icon of a pacman ghost symbol. + + + + + Gets an icon of a paperclip symbol. + + + + + Gets an icon of a pause symbol. + + + + + Gets an icon of a pen symbol. + + + + + Gets an icon of a pen add symbol. + + + + + Gets an icon of a pen minus symbol. + + + + + Gets an icon of a play symbol. + + + + + Gets an icon of a plus symbol. + + + + + Gets an icon of a podium symbol. + + + + + Gets an icon of a previous symbol. + + + + + Gets an icon of a reception signal symbol. + + + + + Gets an icon of a redo symbol. + + + + + Gets an icon of a refresh symbol. + + + + + Gets an icon of a rotate symbol. + + + + + Gets an icon of a ruler symbol. + + + + + Gets an icon of a ruler rect symbol. + + + + + Gets an icon of a settings cog symbol. + + + + + Gets an icon of a shopping basket symbol. + + + + + Gets an icon of a shopping cart symbol. + + + + + Gets an icon of a single user symbol. + + + + + Gets an icon of a smart phone symbol. + + + + + Gets an icon of a sound symbol. + + + + + Gets an icon of a speech bubble round symbol. + + + + + Gets an icon of a speech bubble square symbol. + + + + + Gets an icon of a speech bubbles round symbol. + + + + + Gets an icon of a speech bubbles square symbol. + + + + + Gets an icon of a star pointer symbol. + + + + + Gets an icon of a stop symbol. + + + + + Gets an icon of a stretch symbol. + + + + + Gets an icon of a table symbol. + + + + + Gets an icon of a tag symbol. + + + + + Gets an icon of a test tube symbol. + + + + + Gets an icon of a timer symbol. + + + + + Gets an icon of a traffic stop light symbol. + + + + + Gets an icon of a transparent symbol. + + + + + Gets an icon of a tree symbol. + + + + + Gets an icon of a triangle down symbol. + + + + + Gets an icon of a triangle left symbol. + + + + + Gets an icon of a triangle right symbol. + + + + + Gets an icon of a triangle up symbol. + + + + + Gets an icon of an undo symbol. + + + + + Gets an icon of an upload symbol. + + + + + Gets an icon of a wifi signal symbol. + + + + + Gets an icon of an x symbol. + + + + + Gets a texture of a test inconclusive symbol. + + + + + Gets a texture of a test failed symbol. + + + + + Gets a texture of a test normal symbol. + + + + + Gets a texture of a test passed symbol. + + + + + Gets a texture of a console info icon symbol. + + + + + Gets a texture of a console warnicon symbol. + + + + + Gets a texture of a console error icon symbol. + + + + + Gets a texture of an odin inspector logo symbol. + + + + + Gets a texture of a scene asset icon symbol. + + + + + Gets an icon representing a GameObject. + + + + + Gets an icon of a unity info icon. + + + + + Gets an icon of a unity warning icon. + + + + + Gets an icon of a unity error icon. + + + + + Gets an icon of a unity folder. + + + + + Lazy loading Editor Icon. + + + + + Loads an EditorIcon from the spritesheet. + + + + + Gets the icon's highlight texture. + + + + + Gets the icon's active texture. + + + + + Gets the icon's inactive texture. + + + + + Not yet documented. + + + + + Utility for parsing and emitting expression delegates. + + + + Parses an expression and tries to emit a delegate method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted delegate if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and tries to emit a delegate method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + The parameters of the expression delegate. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted delegate if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and tries to emit a delegate method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + The parameters of the expression delegate. + The names of the expression's parameters, for use with the named parameter syntax. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted delegate if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and tries to emit a delegate method. + The expression to parse. + The emit context. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted delegate if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and tries to emit a delegate of the specified type. + The expression to parse. + The emit context. + The type of the delegate to emit. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted delegate if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionFunc method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionFunc if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + Parses an expression and emits an ExpressionAction method. + The expression to parse. + Indicates if the expression should be static instead of instanced. + The context type for the execution of the expression. + Output for any errors that may occur. + If true then error message will be formatted with color tags. Otherwise, the error message will be formatted with text only. + Returns the emitted ExpressionAction if the expression is compiled successfully. Otherwise, null. + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Drag and drop utilities for both Unity and non-unity objects. + + + + + Gets the position from where the last drag started from in screen space. + + + + + Gets the delta position between the currrent mouse position and where the last drag originated from. + + + + + Gets the hovering accepted drop zone ID. + + + + + Gets a value indicating whether an instance is currently being dragged. + + + + + Gets the currently dragging identifier. + + + + + Gets the current hovering drop zone identifier. + + + + + Gets a more percistent id for drag and drop. + + + + + Draws a objectpicker button in the given rect. This one is designed to look good on top of DrawDropZone(). + + + + + Draws a objectpicker butter, in the given rect. This one is designed to look good on top of DrawDropZone(). + + + + + Draws the graphics for a DropZone. + + + + + A draggable zone for both Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + A drop zone area for bot Unity and non-unity objects. + + + + + Disalloweds the drop area for next drag zone. Follow this function call by a DragZone. + + + + + A draggable zone for both Unity and non-unity objects. + + + + + A draggable zone for both Unity and non-unity objects. + + + + + A draggable zone for both Unity and non-unity objects. + + + + + A draggable zone for both Unity and non-unity objects. + + + + + Collection of extension methods for . + + + + + Returns true when the user presses the specified mouse button. + + The . + The mouse button the user has to press. + If true then the method will call on the event. + true on mouse down events with the specified button. Otherwise false. + + + + Returns true when the user clicks a rect with the mouse. + + The event. + The rect the user can click on. + The button the user has to press. + If true then the method will call on the event. + true on mouse down events with the specified button. Otherwise false. + + + + Returns true when the user releases the specified mouse button. + + The . + The mouse button the user has to release. + If true then the method will call on the event. + true on mouse up events, with the specified button. Otherwise false. + + + + Returns true when the user releases the specified mouse button over the specified rect. + + The . + The rect the user has to release the mouse button over. + The mouse button the user has to release. + If true then the method will call on the event. + true on mouse up events, with the specified button and over the specified rect. Otherwise false. + + + + Returns true when the user left clicks a rect. + + The . + The rect the user can click. + If true then the method will call on the event. + true on left click events, on the specified rect. Otherwise false. + + + + Returns true when the user right clicks a rect. + + The . + The rect the user can right click. + If true then the method will call on the event. + true on context click events, on the specified rect. Otherwise false. + + + + Returns true when the user presses the specified key. + + The . + The key the user has to press. + If true then the method will call on the event. + true on key down events with the specified key code. Otherwise false. + + + + Returns true when the user releases the specified key. + + The . + The key the user has to release. + If true then the method will call on the event. + true on key up events with the specified key code. Otherwise false. + + + + Returns true whene the user moves or drags the mouse. + + The . + If true then the method will call on the event. + true on mouse move or mouse drag events. Otherwise false. + + + + Returns true when the user hovers the mouse over the specified rect. + + The . + The rect the user can hover. + true on any event where the mouse is hovering the specified rect. Otherwise false. + + + + Returns true on repaint events. + + The . + true on repaint events. Otherwise false. + + + + Returns true on layout events. + + The . + true on layout events. Otherwise false. + + + + Returns true on the specified event. + + The . + The required event type. + true on the specified event. Otherwise false. + + + + Collection of extension methods for . + + + + + Removes all menu items with a given name from the GenericMenu. + + The GenericMenu to remove items from. + The name of the items to remove. + True if any items were removed, otherwise false. + + + + Replaces the first found menu item with a given name with a new menu item, or if no such element is found, adds a new one. + + The GenericMenu to replace items in. + The name of the items to remove. + The func to replace or add. + The on value to set the new menu item with. + True if an item was replaced, otherwise false. + + + + Replaces the first found menu item with a given name with a new menu item, or if no such element is found, adds a new one. + + The GenericMenu to replace items in. + The name of the items to remove. + The on value to set the new menu item with. + The func to replace or add. + The user data. + + True if an item was replaced, otherwise false. + + + + + This class is due to undergo refactoring. + + + + + The value. + + + + + Performs an implicit conversion from to . + + + + + How the square object field should be aligned. + + + + + + Left aligned. + + + + + Centered. + + + + + Right aligned. + + + + + This class is due to undergo refactoring. Use the new DragAndDropUtilities instead. + + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + This class is due to undergo refactoring. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + This class is due to undergo refactoring. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + This class is due to undergo refactoring. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + This class is due to undergo refactoring. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + This class is due to undergo refactoring. + + + + + Emitted wrapper for the internal "UnityEngine.GUIClip" class. + + + + + Not yet documented. + + + + + Gets the top most clipped rect. + + + + + Gets the visible rect. + + + + + Gets the top rect. + + + + + Unclips the specified position. + + The position. + + + + + Unclips the specified rect. + + The rect. + + + + + A helper class to control paging of n number of elements in various situations. + + + + + Disables the paging, and show all elements. + + + + + Initializes a new instance of the class. + + + + + Updates all values based on and . + + + Call update right before using and in your for loop. + + The total number of elements to apply paging for. + + + + Gets or sets a value indicating whether this instance is enabled. + + + true if this instance is enabled; otherwise, false. + + + + + Gets a value indicating whether this instance is on the frist page. + + + true if this instance is on frist page; otherwise, false. + + + + + Gets a value indicating whether this instance is on the last page. + + + true if this instance is on last page; otherwise, false. + + + + + Gets or sets the number of items per page. + + + The number of items pr page. + + + + + Gets or sets the current page. + + + The current page. + + + + + Gets the start index. + + + The start index. + + + + + Gets the end index. + + + The end index. + + + + + Gets or sets the page count. + + + The page count. + + + + + Gets the total number of elements. + Use to change the value. + + + + + Draws right-aligned toolbar paging buttons. + + + + + A Utility class for creating tables in Unity's editor GUI. + A table can either be created from scratch using new GUITable(xCount,yCount), or created using one of the static GUITable.Create overloads. + See the online documentation, for examples and more information. + + + Creating a matrix table for a two-dimentional array. + + private GUITable table; + + private void Init() + { + bool[,] boolArr = new bool[20,20]; + + this.table = GUITable.Create( + twoDimArray: boolArr, + drawElement: (rect, x, y) => boolArr[x, y] = EditorGUI.Toggle(rect, boolArr[x, y]), + horizontalLabel: "Optional Horizontal Label", // horizontalLabel is optional and can be null. + columnLabels: (rect, x) => GUI.Label(rect, x.ToString()), // columnLabels is optional and can be null. + verticalLabel: "Optional Vertical Label", // verticalLabel is optional and can be null. + rowLabels: (rect, x) => GUI.Label(rect, x.ToString()) // rowLabels is optional and can be null. + ); + } + + private void OnGUI() + { + this.table.DrawTable(); + } + + + + Creating a table for a list. + + private GUITable table; + + private void Init() + { + Listt<SomeClasst> someList = new List<SomeClass>() { new SomeClass(), new SomeClass(), new SomeClass() }; + + this.table = GUITable.Create(someList, "Optional Title", + new GUITableColumn() + { + ColumnTitle = "A", + OnGUI = (rect, i) => someList[i].A = EditorGUI.TextField(rect, someList[i].A), + Width = 200, + MinWidth = 100, + }, + new GUITableColumn() + { + ColumnTitle = "B", + OnGUI = (rect, i) => someList[i].B = EditorGUI.IntField(rect, someList[i].B), + Resizable = false, + }, + new GUITableColumn() + { + ColumnTitle = "C", + OnGUI = (rect, i) => someList[i].C = EditorGUI.IntField(rect, someList[i].C), + SpanColumnTitle = true, + } + ); + } + + private void OnGUI() + { + this.table.DrawTable(); + } + + private class SomeClass + { + public string A; + public int B; + public int C; + public int D; + } + + + + Styling a cell. + Each has two events, OnGUI and OnGUIStyle. OnGUIStyle is called right before OnGUI, but only in repaint events. + + guiTable[x,y].GUIStyle += rect => EditorGUI.DrawRect(rect, Color.red); + + + + Row and column span. + A cell will span and cover all neighbour cells that are null. + + // Span horizontally: + guiTable[x - 2,y] = null; + guiTable[x - 1,y] = null; + guiTable[x,y].SpanX = true; + guiTable[x + 1,y] = null; + + // Span vertically: + guiTable[x,y - 2] = null; + guiTable[x,y - 1] = null; + guiTable[x,y].SpanY = true; + guiTable[x,y + 1] = null; + + + + + + + + The row count. + + + + + The column count. + + + + + The Table Rect. + + + + + Whether to respect the current GUI indent level. + + + + + Gets or sets a from the . + + + + + Initializes a new instance of the class. + + + + + Draws the table. + + + + + Recaluclates cell and column sizes in the next frame. + + + + + Recalculates the layout for the entire table. + This method gets called whenever the table is initialized, resized or adjusted. If you are manipulating + the width or height of individual table cells, remember to call this method when you're done. + + + + + Creates a table. + + + + + Creates a table. + + + + + Creates a table. + + + + + Creates a table. + + + + + A cell of a + + + + + The minimum width. + + + + + The width of the cell. Default is width is 0. + The width the column is determained by the widest cell in the column. + Width = 0 = auto. + + + + + The height of the cell. Default is height is 22. + The height the column is determained by the tallest cell in the row. + + + + + If true, the cell will expand vertically, covering all neighbour null cells. + + + + + If true, the cell will expand horizontally, covering all neighbour null cells. + + + + + The table column index. + + + + + The table row index. + + + + + The GUI style + + + + + Gets the rect. + + + + + GUITableColumns used creating a table list using GUITable.Create(). + + + + + + + Draws a cell at the given row index for this column. + + + + + The column title text. If there are is columns with a title, there we not be rendered an additional table row for column titles. + + + + + The minimum with of the column. + + + + + The width of the Column. + 0 = auto, and is also the default. + + + + + If true, the column becomes resiziable. + Default is true. + + + + + If true, the column title cell, will span horizontally to neighbour columns, which column titles are null. + Default is false. + + + + + The GUITabGroup is a utility class to draw animated tab groups. + + + + var tabGroup = SirenixEditorGUI.CreateAnimatedTabGroup(someKey); + // Register your tabs before starting BeginGroup. + var tab1 = tabGroup.RegisterTab("tab 1"); + var tab2 = tabGroup.RegisterTab("tab 2"); + + tabGroup.BeginGroup(drawToolbar: true); + { + if (tab1.BeginPage()) + { + // Draw GUI for the first tab page; + } + tab1.EndPage(); + + if (tab2.BeginPage()) + { + // Draw GUI for the second tab page; + } + tab2.EndPage(); + } + tabGroup.EndGroup(); + + // Control the animation speed. + tabGroup.AnimationSpeed = 0.2f; + + // If true, the tab group will have the height equal to the biggest page. Otherwise the tab group will animate in height as well when changing page. + tabGroup.FixedHeight = true; + + // You can change page by calling: + tabGroup.GoToNextPage(); + tabGroup.GoToPreviousPage(); + + + + + + + The animation speed (1 / s) + + + + + The animation speed + + + + + Gets the outer rect of the entire tab group. + + + + + The inner rect of the current tab page. + + + + + If true, the tab group will have the height equal to the biggest page. Otherwise the tab group will animate in height as well when changing page. + + + Sets the current page. + + The page to switch to. + + + + Gets the current page. + + + + + Gets the t. + + + + + The height of the tab buttons. + + + + + Registers the tab. + + + + + Begins the group. + + if set to true a tool-bar for changing pages is drawn. + The style. + + + + Ends the group. + + + + + Goes to page. + + + + + Goes to next page. + + + + + Goes to previous page. + + + + + Various helper function for GUI. + + + + + Gets the bold default font. + + + + + An alternative to GUI.FocusControl(null), which does not take focus away from the current GUI.Window. + + + + + Whether the inspector is currently in the progress of drawing a dictionary key. + + + + + Hides the following draw calls. Remember to call when done. + + + + + Unhides the following draw calls after having called . + + + + + Determines whether the specified EditorWindow is docked. + + The editor window. + true if the editor window is docked. Otherwise false. + + + + Not yet documented. + + + + + Opens a new inspector window for the specified object. + + The unity object. + unityObj + + + + Gets or sets a value indicating whether labels are currently bold. + + + true if this instance is bold label; otherwise, false. + + + + + Gets the size of the current window border. + + + The size of the current window border. + + + + + Gets the editor screen point offset. + + + The editor screen point offset. + + + + + Gets the current editor gui context width. Only set these if you know what it does. + Setting this has been removed. Use PushContextWidth and PopContextWidth instead. + + + + + Unity EditorGUIUtility.labelWidth only works reliablly in Repaint events. + BetterLabelWidth does a better job at giving you the correct LabelWidth in non-repaint events. + + + + + Odin will set this for you whenever an Odin property tree is drawn. + But if you're using BetterLabelWidth and BetterContextWidth without Odin, then + you need to set BetterContextWidth in the beginning of each GUIEvent. + + + + + Gets the current indent amount. + + + The current indent amount. + + + + + Gets the mouse screen position. + + + The mouse screen position. + + + + + Gets the current editor window. + + + The current editor window. + + + + + Gets a value indicating whether the current editor window is focused. + + + true if the current window has focus. Otherwise, false. + + + + + Gets the ID of the current editor window. + + + The ID of the current editor window. + + + + + Gets a value indicating whether a repaint has been requested. + + + true if repaint has been requested. Otherwise false. + + + + + Gets or sets the actual EditorGUIUtility.LabelWidth, regardless of the current hierarchy mode or context width. + + + + + Requests a repaint. + + + + + Requests a repaint. + + + + + Begins the layout measuring. Remember to end with . + + + + + Ends the layout measuring started by + + The measured rect. + + + + Gets the current layout rect. + + The current layout rect. + + + + Gets the current layout rect. + + The current layout rect. + + + + Gets the playmode color tint. + + The playmode color tint. + + + + Pushes a context width to the context width stack. + Remember to pop the value again with . + + The width to push. + + + + Pops a value pushed by . + + + + + Pushes a color to the GUI color stack. Remember to pop the color with . + + The color to push the GUI color.. + if set to true blend with alpha. + + + + Takes a screenshot of the GUI within the specified rect. + + The rect. + The screenshot as a render texture. + + + + Pops the GUI color pushed by . + + + + + Pushes a state to the GUI enabled stack. Remember to pop the state with . + + If set to true GUI will be enabled. Otherwise GUI will be disabled. + + + + Pops the GUI enabled pushed by + + + + + Pushes a state to the IsDrawingDictionaryKey stack. Remember to pop the state with . + + + + + Pops the state pushed by + + + + + Pushes the hierarchy mode to the stack. Remember to pop the state with . + + The hierachy mode state to push. + Changing hierachy mode also changes how label-widths are calcualted. By default, we try to keep the current label width. + + + + Pops the hierarchy mode pushed by . + + + + + Pushes bold label state to the stack. Remember to pop with . + + Value indicating if labels should be bold or not. + + + + Pops the bold label state pushed by . + + + + + Pushes the indent level to the stack. Remember to pop with . + + The indent level to push. + + + + Pops the indent level pushed by . + + + + + Pushes the content color to the stack. Remember to pop with . + + The content color to push.. + If set to true blend with alpha. + + + + Pops the content color pushed by . + + + + + Pushes the label color to the stack. Remember to pop with . + + The label color to push. + + + + Pops the label color pushed by . + + + + + Pushes the GUI position offset to the stack. Remember to pop with . + + The GUI offset. + + + + Pops the GUI position offset pushed by . + + + + + Pushes a GUI matrix to the stack. Remember to pop with . + + The GUI matrix to push. + + + + Pops the GUI matrix pushed by . + + + + + Ignores input on following GUI calls. Remember to end with . + + + + + Ends the ignore input started by . + + + + + Pushes the event type to the stack. Remember to pop with . + + The type of event to push. + + + + Pops the event type pushed by . + + + + + Pushes the width to the editor GUI label width to the stack. Remmeber to Pop with . + + The editor GUI label width to push. + + + + Pops editor gui label widths pushed by . + + + + + Pushes the value to the responsive vector component fields stack. Remeber to pop with . + + + + + Pops responsive vector component fields value pushed by . + + + + + Pushes the value to the fade group duration stack. Remeber to pop with . + + + + + Pops fade group duration value pushed by . + + + + + Pushes the value to the tab page slide animation duration stack. Remember to pop with . + + + + + + Pops tab page slide animation duration value pushed by . + + + + + Clears the repaint request. + + + + + Gets a temporary value context. + + The type of the config value. + The key for the config. + The name of the config. + GUIConfig for the specified key and name. + + + + Gets a temporary value context. + + The type of the value. + The key for the config. + The ID for the config. + GUIConfig for the specified key and ID. + + + + Gets a temporary value context. + + The type of the value. + The primary key. + The secondary key. + GUIConfig for the specified primary and secondary key. + + + + Gets a temporary value context. + + The type of the value. + The key for the context. + GUIConfig for the specified key. + + + + Gets a temporary nullable value context. + + Key for context. + Name for the context. + + + + Gets a temporary nullable value context. + + Key for context. + Id of the context. + + + + Gets a temporary nullable value context. + + Primary key for the context. + Secondary key for the context. + + + + Gets a temporary nullable value context. + + Key for the context. + + + + Gets a temporary context. + + Key for the context. + Name for the context. + Default value of the context. + + + + Gets a temporary context. + + Key for the context. + Id for the context. + Default value of the context. + + + + Gets a temporary context. + + Primary key for the context. + Secondary key for the context. + Default value of the context. + + + + Gets a temporary context. + + Key for the context. + Default value of the context. + + + + Gets a temporary GUIContent with the specified text. + + The text for the GUIContent. + Temporary GUIContent instance. + + + + Gets a temporary GUIContent with the specified text and tooltip. + + The text for the GUIContent. + The tooltip for the GUIContent. + Temporary GUIContent instance. + + + + Gets a temporary GUIContent with the specified image and tooltip. + + The image for the GUIContent. + The tooltip for the GUIContent. + Temporary GUIContent instance. + + + + Gets a temporary GUIContent with the specified text, image and tooltip. + + The text for the GUIContent. + The image for the GUIContent. + The tooltip for the GUIContent. + Temporary GUIContent instance. + + + + Indents the rect by the current indent amount. + + The rect to indent. + Indented rect. + + + + Indents the rect by the current indent amount. + + The rect to indent. + + + + Repaints the EditorWindow if a repaint has been requested. + + The window to repaint. + + + + Repaints the editor if a repaint has been requested. If the currently rendering window is not an InspectorWindow, Repaint() will be called on the current window as well. + + The editor to repaint. + + + + Gets the best thumbnail icon given the provided arguments provided. + + + + + + + + + Configuration for progress bar fields. + + + + + The height of the progress bar field. Default 12 pixel. + + + + + The foreground color of the progress bar field. + + + + + The background color of the progress bar field. + + + + + If true the progress bar field will draw a label ontop to show the current value. + + + + + Alignment of the progress bar field overlay. + + + + + Default configuration. + + + + + Creates a copy of the configuration. + + The configuration to copy. + + + + Creates a progress bar configuration. + + The height of the progress bar. + The foreground color of the progress bar. + The background color of the progress bar. + If true there will be drawn a overlay on top of the field. + The alignment of the text overlay. + + + + Draw mode of quaternion fields. + + + + + + + Draw the quaterion as euler angles. + + + + + Draw the quaterion in as an angle and an axis. + + + + + Draw the quaternion as raw x, y, z and w values. + + + + + Field drawing functions for various types. + + + + + The width of the X, Y and Z labels in structs. + + + + + When true the component labels, for vector fields, will be hidden when the field is too narrow. + + + + + Draws a regular Unity ObjectField, but supports labels being nulls, and also adds a small button that will open the object in a new inspector window. + + Position and size of the field. + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + + + + Draws a regular Unity ObjectField, but supports labels being nulls, and also adds a small button that will open the object in a new inspector window. + + Position and size of the field. + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + + + + Draws a regular Unity ObjectField, but supports labels being nulls, and also adds a small button that will open the object in a new inspector window. + + Position and size of the field. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + + + + Draws a regular Unity ObjectField, but supports labels being nulls, and also adds a small button that will open the object in a new inspector window. + + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + Layout options. + + + + Draws a regular Unity ObjectField, but supports labels being nulls, and also adds a small button that will open the object in a new inspector window. + + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + Layout options. + + + + Draws a regular Unity ObjectField, but supports labels being nulls, and also adds a small button that will open the object in a new inspector window. + + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + Layout options. + + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + Position and size of the field. + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + How the square object field should be aligned. + + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + Position and size of the field. + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + How the square object field should be aligned. + + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + Position and size of the field. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + How the square object field should be aligned. + + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + The height or size of the square object field. + How the square object field should be aligned. + + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + The label to use, or null if no label should be used. + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + The height or size of the square object field. + How the square object field should be aligned. + + + + Draws a square ObjectField which renders a preview for UnityEngine.Object types. + This object field also adds support for drag and drop, dragging an object to another square object field, swaps the values. + If you hold down control while letting go it will replace the value, And you can control + click the object field to quickly delete the value it holds. + + The Unity object. + The Unity object type. This supports inheritance. + Wheather or not to allow scene objects. + The height or size of the square object field. + How the square object field should be aligned. + + + + Draws a polymorphic ObjectField. + + The label to use, or null if no label should be used. + The value. + The object type. This supports inheritance. + Wheather or not to allow scene objects. + Layout options. + + + + Draws a polymorphic ObjectField. + + + + + Draws a polymorphic ObjectField. + + + + + Draws a polymorphic ObjectField. + + The label to use, or null if no label should be used. + The value. + The object type. This supports inheritance. + Wheather or not to allow scene objects. + Layout options. + + + + Draws a polymorphic ObjectField. + + The value. + The object type. This supports inheritance. + Wheather or not to allow scene objects. + Layout options. + + + + Draws a field for a layer mask. + + Position and size of the field. + The label to use, or null if no label should be used. + The layer mask to draw. + + + + Draws a field for a layer mask. + + Position and size of the field. + The label to use, or null if no label should be used. + The layer mask to draw. + + + + Draws a field for a layer mask. + + Position and size of the field. + The layer mask to draw. + + + + Draws a field for a layer mask. + + The label to use, or null if no label should be used. + The layer mask to draw. + Layout options. + + + + Draws a field for a layer mask. + + The label to use, or null if no label should be used. + The layer mask to draw. + Layout options. + + + + Draws a field for a layer mask. + + The layer mask to draw. + Layout options. + + + + Draws a Guid field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Guid field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a Guid field. + + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Guid field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Guid field. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a Guid field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws an int field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws an int field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an int field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an int field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws an int field. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws an int field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an int field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an int field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed int field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a delayed int field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed int field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed int field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a delayed int field. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a delayed int field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed int field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed int field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a range field for ints. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a range field for ints. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Draws a range field for ints. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Draws a range field for ints. + + Position and size of the field. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Drwas a range field for ints. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a range field for ints. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a range field for ints. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a range field for ints. + + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a colored progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Optional text for label to be drawn ontop of the progress bar. This value is only used if the DrawValueLabel option is enabled in the ProgressBarConfig. + + + + Draws a colored progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored progress bar field. + + Position and size of the field. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored progress bar field. + + Position and size of the field. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored progress bar field. + + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws a colored progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws a colored progress bar field. + + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Optional text for label to be drawn ontop of the progress bar. This value is only used if the DrawValueLabel option is enabled in the ProgressBarConfig. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored segmented progress bar field. + + Position and size of the field. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + + + + Draws a colored segmented progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored segmented progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored segmented progress bar field. + + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + The configuration for the progress bar field. + Layout options. + + + + Draws a colored segmented progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws a colored segmented progress bar field. + + The label to use, or null if no label should be used. + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws a colored segmented progress bar field. + + The current value of the progress bar. + The left hand side value of the progress bar. + The right hand side value of the progress bar. + Layout options. + + + + Draws an overlay on top of a progress bar field. + + The rect used to draw the progress bar field with. (Minus the Rect for the prefix label, if any.) + The label to draw ontop of the progress bar field. + The relative value of the progress bar, from 0 to 1. + The configuration used to draw the progress bar field. + + + + Draws an overlay on top of a progress bar field. + + The rect used to draw the progress bar field with. (Minus the Rect for the prefix label, if any.) + The label to draw ontop of the progress bar field. + The relative value of the progress bar, from 0 to 1. + The configuration used to draw the progress bar field. + + + + Draws an long field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws an long field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an long field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an long field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws an long field. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws an long field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an long field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an long field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed long field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a delayed long field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed long field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed long field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a delayed long field. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a delayed long field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed long field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed long field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a float field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a float field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a float field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a float field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a float field. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a float field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a float field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a float field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed float field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a delayed float field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed float field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed float field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a delayed float field. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a delayed float field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed float field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed float field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a range field for floats. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a range field for floats. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Draws a range field for floats. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Draws a range field for floats. + + Position and size of the field. + Current value. + Minimum value. + Maximum value. + Value assigned to the field. + + + + Draws a range field for floats. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a range field for floats. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a range field for floats. + + Label of field. Set to null for no label. + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a range field for floats. + + Current value. + Minimum value. + Maximum value. + Layout options. + Value assigned to the field. + + + + Draws a double field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a double field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a double field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a double field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a double field. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a double field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a double field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a double field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed double field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a delayed double field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed double field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed double field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a delayed double field. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a delayed double field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed double field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed double field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a decimal field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a decimal field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a decimal field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a decimal field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a decimal field. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a decimal field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a decimal field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a decimal field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a text field for strings. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a text field for strings. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a text field for strings. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a text field for strings. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a text field for strings. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a text field for strings. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a text field for strings. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a text field for strings. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed text field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a delayed text field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed text field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a delayed text field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a delayed text field. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a delayed text field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed text field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a delayed text field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a field that lets the user select a path to a file. + + Position and size of the field. + Label of field. Set to null for no label. + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + Comma separated list of allowed file extensions. Use null to allow any file extension. + If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. + If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + A path to a file. + + + + Draws a field that lets the user select a path to a file. + + Position and size of the field. + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + Comma separated list of allowed file extensions. Use null to allow any file extension. + If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. + If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + A path to a file. + + + + Draws a field that lets the user select a path to a file. + + Label of field. Set to null for no label. + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + Comma separated list of allowed file extensions. Use null to allow any file extension. + If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. + If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + Layout options. + A path to a file. + + + + Draws a field that lets the user select a path to a file. + + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + Comma separated list of allowed file extensions. Use null to allow any file extension. + If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. + If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + Layout options. + A path to a file. + + + + Draws a field that lets the user select a path to a folder. + + Position and size of the field. + Label of field. Set to null for no label. + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. + If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + A path to a folder. + + + + Draws a field that lets the user select a path to a folder. + + Position and size of the field. + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. + If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + A path to a folder. + + + + Draws a field that lets the user select a path to a folder. + + Label of field. Set to null for no label. + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. + If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + Layout options. + A path to a folder. + + + + Draws a field that lets the user select a path to a folder. + + The current value. + A parent path the path needs to be relative to. Use null for Unity project directory. + If true the path will be absolute. Otherwise the path will be relative to parentPath or to the Unity project directory. + If true the path will be enforced to use backslashes. Otherwise the path will be enforced to use forward slashes. + Layout options. + A path to a folder. + + + + Draws a prefix label for a vector field, that implements label dragging. + + + + + Draws a prefix label for a vector field, that implements label dragging. + + The position and total size of the field. + The label content. If null this function does nothing. + The value for the vector field. + The vector scaled by label dragging. + + + + Draws a prefix label for a vector field, that implements label dragging. + + The position and total size of the field. + The label content. If null this function does nothing. + The value for the vector field. + The vector scaled by label dragging. + + + + Draws a prefix label for a vector field, that implements label dragging. + + The label content. If null this function does nothing. + The value for the vector field. + The vector scaled by label dragging. + + + + Draws a prefix label for a vector field, that implements label dragging. + + The label content. If null this function does nothing. + The value for the vector field. + The vector scaled by label dragging. + + + + Draws a Vector2 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector2 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector2 field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a Vector2 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector2 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector2 field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector3 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector3 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector3 field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a Vector3 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector3 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector3 field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector4 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector4 field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a Vector4 field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a Vector4 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector4 field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Vector4 field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a Color field. + + Position and size of the field. + Label of field. Set to null for no label. + + Value assigned to the field. + + + + Draws a Color field. + + Position and size of the field. + Label of field. Set to null for no label. + + Value assigned to the field. + + + + Draws a Color field. + + Position and size of the field. + + Value assigned to the field. + + + + Draws a Color field. + + Label of field. Set to null for no label. + + Layout options. + Value assigned to the field. + + + + Draws a Color field. + + Label of field. Set to null for no label. + + Layout options. + Value assigned to the field. + + + + Draws a Color field. + + + Layout options. + Value assigned to the field. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + The min and max limit for the value. + Show fields for min and max value. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + The min and max limit for the value. + Show fields for min and max value. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Current value. + The min and max limit for the value. + Show fields for min and max value. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Label of field. Set to null for no label. + Current value. + The min and max limit for the value. + Show fields for min and max value. + Layout options. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Label of field. Set to null for no label. + Current value. + The min and max limit for the value. + Show fields for min and max value. + Layout options. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Current value. + The min and max limit for the value. + Show fields for min and max value. + Layout options. + A Vector2 with X set as min value, and Y to set as max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Label of field. Set to null for no label. + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Label of field. Set to null for no label. + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Position and size of the field. + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + + + + Draws a slider for setting two values between a min and a max limit. + + Label of field. Set to null for no label. + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + Layout options. + + + + Draws a slider for setting two values between a min and a max limit. + + Label of field. Set to null for no label. + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + Layout options. + + + + Draws a slider for setting two values between a min and a max limit. + + Current min value. + Current max value. + The min limit for the value. + The max limit for the value. + Show fields for min and max value. + Layout options. + + + + Draws a rotation field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Draw mode for rotation field. + Value assigned to the field. + + + + Draws a rotation field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Draw mode for rotation field. + Value assigned to the field. + + + + Draws a rotation field for a quaternion. + + Position and size of the field. + Current value. + Draw mode for rotation field. + Value assigned to the field. + + + + Draws a rotation field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Draw mode for rotation field. + Layout options. + Value assigned to the field. + + + + Draws a rotation field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Draw mode for rotation field. + Layout options. + Value assigned to the field. + + + + Draws a rotation field for a quaternion. + + Current value. + Draw mode for rotation field. + Layout options. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an euler field for a quaternion. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws an angle axis field for a quaternion. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a quaternion field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a quaternion field. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a quaternion field. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a quaternion field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a quaternion field. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a quaternion field. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a dropdown. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Names of selectable items. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a dropdown. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Names of selectable items. + Value assigned to the field. + + + + Draws a dropdown. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Names of selectable items. + Value assigned to the field. + + + + Draws a dropdown. + + Position and size of the field. + Current value. + Names of selectable items. + Value assigned to the field. + + + + Draws a dropdown. + + Label of field. Set to null for no label. + Current value. + Names of selectable items. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a dropdown. + + Label of field. Set to null for no label. + Current value. + Names of selectable items. + Layout options. + Value assigned to the field. + + + + Draws a dropdown. + + Label of field. Set to null for no label. + Current value. + Names of selectable items. + Layout options. + Value assigned to the field. + + + + Draws a dropdown. + + Current value. + Names of selectable items. + Layout options. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Selectable items. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Label of field. Set to null for no label. + Current value. + Selectable items. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Selectable items. + Names of selectable items. If null ToString() will be used instead. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + + Names of selectable items. If null ToString() will be used instead. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + + Names of selectable items. If null ToString() will be used instead. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Position and size of the field. + Current value. + + Names of selectable items. If null ToString() will be used instead. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Label of field. Set to null for no label. + Current value. + + Names of selectable items. If null ToString() will be used instead. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Label of field. Set to null for no label. + Current value. + + Names of selectable items. If null ToString() will be used instead. + Layout options. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Label of field. Set to null for no label. + Current value. + + Names of selectable items. If null ToString() will be used instead. + Layout options. + Value assigned to the field. + + + + Draws a generic dropdown. + + + Current value. + + Names of selectable items. If null ToString() will be used instead. + Layout options. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Position and size of the field. + Label of field. Set to null for no label. + Current value. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Position and size of the field. + Current value. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Label of field. Set to null for no label. + Current value. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Label of field. Set to null for no label. + Current value. + Layout options. + Value assigned to the field. + + + + Draws a dropdown for an enum or an enum mask. + + Current value. + Layout options. + Value assigned to the field. + + + + Draws a dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + true when the user has changed the selection. Otherwise false. + + + + Draws a dropdown. + + + Position and size of the field. + Label of field. Set to null for no label. + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + true when the user has changed the selection. Otherwise false. + + + + Draws a dropdown. + + + Position and size of the field. + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + true when the user has changed the selection. Otherwise false. + + + + Draws a dropdown. + + + Label of field. Set to null for no label. + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + Layout options. + true when the user has changed the selection. Otherwise false. + + + + Draws a dropdown. + + + Label of field. Set to null for no label. + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + Layout options. + true when the user has changed the selection. Otherwise false. + + + + Draws a dropdown. + + + Current selection. + Avaible items in the dropdown. + If true then the user can select multiple items. Otherwise the user can only select one item. + Layout options. + true when the user has changed the selection. Otherwise false. + + + + Draws a dropdown field for enum masks. + + Position and size of the field. + Label of field. Set to null for no label. + Current selection. + GUIStyle for drawing the field. Set to null for default. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Position and size of the field. + Label of field. Set to null for no label. + Current selection. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Position and size of the field. + Label of field. Set to null for no label. + Current selection. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Position and size of the field. + Current selection. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Label of field. Set to null for no label. + Current selection. + GUIStyle for drawing the field. Set to null for default. + Layout options. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Label of field. Set to null for no label. + Current selection. + Layout options. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Label of field. Set to null for no label. + Current selection. + Layout options. + Value assigned to the field. + + + + Draws a dropdown field for enum masks. + + Current selection. + Layout options. + Value assigned to the field. + + + + Collection of various editor GUI functions. + + + + + The mixed value dash character, to show when something has mixed values; + + + + + Default fade group animation duration. + + + + + Tab page slide animation duration. + + + + + Shaking animation duration. + + + + + Expand foldouts by default. + + + + + Show buttons results by default. + + + + + Draws a GUI field for objects. + + The rect to draw the field in. + The label of the field. + The value of the field. + The object type for the field. + If set to true then allow scene objects to be assigned to the field. + If set to true the field is readonly. + The object assigned to the field. + + + + Draws an GUI field for objects. + + The label for the field. + The value of the field. + The object type for the field. + If set to true then allow scene objects to be assigned to the field. + If set to true the field is readonly. + The object assigned to the field. + + + + Draws a GUI field for objects. + + The key for the field. + The type. + The label for the field. + The current value for the field. + If set to true then allow scene objects to be assigned to the field. + + The object assigned to the field. + + + + + Draws a nicely formatted title with an optinal sub-title and horizontal ruler. + + + + + Draws a GUI color field. + + The rect to draw the field in. + The color of the field. + If set to true then use alpha in the preview. + If set to true then show alpha bar in the preview. + The color assigned to the field. + + + + Draws a warning message box. + + + Also triggers a warning during validation checks done by + + The message. + If set to true the message box will be wide. + + + + Draws a thick horizontal seperator. + + + + + Draws a thick horizontal seperator. + + + + + Draws a thick horizontal seperator. + + + + + Draws a thick horizontal seperator. + + + + + Draws a horizontal line seperator. + + + + + Draws a vertical line seperator. + + + + + Draws an error message box. + + + Also triggers an error during validation checks done by + + The message. + If set to true the message box will be wide. + + + + Draws a info message box. + + The message. + If set to true the message box will be wide. + + + + Draws a message box. + + The message. + If set to true the message box will be wide. + + + + Draws a message box. + + The message. + Type of the message. + If set to true the message box will be wide. + + + + Draws a message box. + + The message. + Type of the message. + The style of the message box. + If set to true the message box will be wide. + + + + Draws a message box that can be expanded to show more details. + + The message of the message box. + The detailed message of the message box. + Type of the message box. + If set to true the detailed message is hidden. + If set to true the message box will be wide. + State of isFolded. + + + + Draws a horizontal line separator. + + Width of the line. + + + + Draws a horizontal line separator. + + The color of the line. + The size of the line. + + + + Draws a vertical line separator. + + Width of the line. + + + + Draws a vertical line separator. + + The color of the line. + Width of the line. + + + + Draws a GUI button with an icon. + + The editor icon for the button. + The width of the button. + The height of the button. + The tooltip of the button. + true if the button was pressed. Otherwise false. + + + + Draws a GUI button with an icon. + + The editor icon for the button. + The GUI style for the button. + The width of the button. + The height of the button. + The tooltip of the button. + true if the button was pressed. Otherwise false. + + + + Draws a GUI button with an icon. + + The rect to draw the button in. + The editor icon for the button. + true if the button was pressed. Otherwise false. + + + + Draws a GUI button with an icon. + + The rect to draw the button in. + The editor icon for the button. + The tooltip of the button. + true if the button was pressed. Otherwise false. + + + + Draws a GUI button with an icon. + + The rect to draw the button in. + The editor icon for the button. + The GUI style for the button. + The tooltip of the button. + true if the button was pressed. Otherwise false. + + + + Draws a GUI button with an icon. + + The rect to draw the button in. + The icon texture. + The tooltip for the button. + true when the button is pressed. + + + + Draws a GUI button with an icon. + + The rect to draw the button in. + The icon texture. + Style for the button. + The tooltip for the button. + true when the button is pressed. + + + + Draws a GUI button with an icon. + + The icon texture. + Width of the button in pixels. + Height of the button in pixels. + The tooltip for the button. + true when the button is pressed. + + + + Draws a GUI button with an icon. + + The icon texture. + Style for the button. + Width of the button in pixels. + Height of the button in pixels. + The tooltip for the button. + true when the button is pressed. + + + + Draws a repeating icon button. + + The icon for the button. + true while the button is active. Otherwise false. + + + + Draws a repeating icon button. + + The icon for the button. + The size. + true while the button is active. Otherwise false. + + + + Draws a repeating icon button. + + The icon for the button. + The width of the button. + The height of the button. + true while the button is active. Otherwise false. + + + + Draws a toolbar icon button. + + The icon for the button. + If true, the button clickable while GUI.enabled == false. + + true if the button was pressed. Otherwise false. + + + + + Draws a toolbar icon button. + + The GUI content for the button. + Whether the button state is selected or not + true if the button was pressed. Otherwise false. + + + + Draws a toolbar icon button. + + The label for the button. + Whether the button state is selected or not + true if the button was pressed. Otherwise false. + + + + Draws a toolbar toggle. + + Current state of the toggle. + The icon for the toggle. + The state of the toggle. + + + + Draws a toolbar toggle. + + Current state of the toggle. + The GUI content for the button. + The state of the toggle. + + + + Draws a toolbar toggle. + + Current state of the toggle. + The text for the toggle. + The state of the toggle. + + + + Draws a toolbar tab. + + If true the tab will be the active tab. + Name for the tab. + State of isActive. + + + + Draws a toolbar tab. + + If true the tab will be the active tab. + Label for the tab. + State of isActive. + + + + Draws a solid color rectangle. + + The rect. + The color. + If true applies the user's playmdoe tint to the rect in playmode. + + + + Draws a solid color rectangle. + + The width. + The height. + The color. + If true applies the user's playmdoe tint to the rect in playmode. + The rect created. + + + + Draws borders around a rect. + + The rect. + The width of the border on all sides. + If true applies the user's playmdoe tint to the rect in playmode. + + + + Draws borders around a rect. + + The rect. + The width of the border on all sides. + The color of the border. + If true applies the user's playmdoe tint to the rect in playmode. + + + + Draws borders around a rect. + + The rect. + The left size. + The right size. + The top size. + The bottom size. + If true applies the user's playmdoe tint to the rect in playmode. + + + + Draws borders around a rect. + + The rect. + The left size. + The right size. + The top size. + The bottom size. + The color of the borders. + If true applies the user's playmdoe tint to the rect in playmode. + + + + Draws a toolbar search field. + + The current search text. + If set to true the force focus on the field. + The left and right margin. + The current search text. + + + + Draws a search field. + + + + + Begins a horizontal toolbar. Remember to end with . + + The height of the toolbar. + Padding for the top of the toolbar. + The rect of the horizontal toolbar. + + + + Begins a horizontal toolbar. Remember to end with . + + The style for the toolbar. + The height of the toolbar. + The top padding. + + The rect of the horizontal toolbar. + + + + + Ends a horizontal toolbar started by . + + + + + Begins a horizontal indentation. Remember to end with . + + The GUI layout options. + + + + Begins a horizontal indentation. Remember to end with . + + The style of the indentation. + The GUI layout options. + + + + Ends a identation horizontal layout group started by . + + + + + Begins a vertical indentation. Remember to end with . + + The GUI layout options. + + + + Begins a vertical indentation. Remember to end with . + + The style of the indentation. + The GUI layout options. + + + + Ends a identation vertical layout group started by . + + + + + Indents by the current indent value, . + + + + + Draws a menu button. + + The indent of the button. + The text of the button. + The current state of the button. + The texture icon for the button. + The current state of the button. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + Current state of the fade group. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + Current state of the fade group. + A value between 0 and 1 indicating how expanded the fade group is. + + + + Begins a fade group. Remember to end with . + + The primary key for the fade group. + The secondly key for the fade group. + Current state of the fade group. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + The name of the fade group. + Current state of the fade group. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + Current state of the fade group. + The duration of fade in and out. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + Current state of the fade group. + A value between 0 and 1 indicating how expanded the fade group is. + The duration of fade in and out. + + + + Begins a fade group. Remember to end with . + + The primary key for the fade group. + The secondly key for the fade group. + Current state of the fade group. + The duration of fade in and out. + + + + Begins a fade group. Remember to end with . + + The key for the fade group. + The name of the fade group. + Current state of the fade group. + The duration of fade in and out. + + + + Begins a fade group. Remember to end with . + + The current fading value between 0 and 1. + + + + Ends a fade group started by any BeginFadeGroup. + + + + + Draws a foldout field where clicking on the label toggles to the foldout too. + + The current state of the foldout. + The label of the foldout. + The GUI style. + + The current state of the foldout. + + + + + Draws a foldout field where clicking on the label toggles to the foldout too. + + The current state of the foldout. + The label of the foldout. + The GUI style. + + + + Draws a foldout field where clicking on the label toggles to the foldout too. + + The current state of the foldout. + The label of the foldout. + The value rect. + The GUI style. + + + + Draws a foldout field where clicking on the label toggles to the foldout too. + + The rect to draw the foldout field in. + The current state of the foldout. + The label of the foldout. + The style. + + + + Begins drawing a box. Remember to end with . + + The label of the box. + If set to true then center label. + The GUI layout options. + + + + Begins drawing a box. Remember to end with . + + The label of the box. + If set to true then center label. + The GUI layout options. + The rect of the box. + + + + Begins drawing a box. Remember to end with . + + The GUI layout options. + + + + Ends drawing a box started by any BeginBox. + + + + + Begins drawing a box header. Remember to end with . + + + + + Ends drawing a box header started by , + + + + + Begins drawing a box with toolbar style header. Remember to end with . + + Label for box header. + If true the label will be drawn in the center of the box header. + GUILayout options. + The rect of the box. + + + + Begins drawing a box with toolbar style header. Remember to end with . + + Label for box header. + If true the label will be drawn in the center of the box header. + GUILayout options. + The rect of the box. + + + + Begins drawing a box with toolbar style header. Remember to end with . + + GUILayout options. + The rect of the box. + + + + Ends the drawing a box with a toolbar style header started by . + + + + + Begins drawing a toolbar style box header. Remember to end with . + + The rect of the box. + + + + Ends the drawing of a toolbar style box header started by . + + + + + Begins drawing a legend style box. Remember to end with . + + The label for the legend style box. + If true the label will be drawn in the center of the box. + GUILayout options. + The rect of the box. + + + + Begins drawing a legend style box. Remember to end with . + + The label for the legend style box. + If true the label will be drawn in the center of the box. + GUILayout options. + The rect of the box. + + + + Begins drawing a legend style box. Remember to end with . + + GUILayout options. + The rect of the box. + + + + Ends the drawing of a legend style box started by + + + + + Begins drawing an inline box. Remember to end with . + + The GUI layout options. + The rect of the box. + + + + Ends drawing an inline box started by any BeginInlineBox. + + + + + Starts the shaking animation of a shaking group. + + + + + Starts the shaking animation of a shaking group. + + + + + Begins a shakeable group. + + + + + Ends the shakeable group. + + + + + Begins drawing a vertical menu list. + + The key for the menu list. + The rect created. + + + + Begins drawing a menu list item. Remember to end with + + Value indicating whether the item is selected. + Value indicating if the mouse is pressed on the item. + If set to true the item is set as selected.. + The rect used for the item. + + + + Ends drawing a menu list item started by + + + + + Ends drawing a vertical menu list started by + + + + + Begins drawing a vertical list. + + If set to true borders will be drawn around the vertical list. + If set to true a dark background will be drawn. + The GUI layout options. + The rect used for the list. + + + + Ends drawing a vertical list started by . + + + + + Begins drawing a list item. + + If set to true the item can be hovered with the mouse. + The style for the vertical list item. + The GUI layout options. + The rect used for the item. + + + + Begins drawing a list item. + + If set to true the item can be hovered with the mouse. + The style for the vertical list item. + Value indicating if the mouse is hovering in the item. + The GUI layout options. + The rect used for the item. + + + + Ends drawing a list item started by . + + + + + Creates a animated tab group. + + The key for the tab group.. + An animated tab group. + + + + Begins drawing a toggle group. Remember to end with . + + The key of the group. + Value indicating if the group is enabled. + Value indicating if the group is visible. + The title of the group. + Value indicating if the group is toggled. + + + + Begins drawing a toggle group. Remember to end with . + + The key of the group. + Value indicating if the group is enabled. + Value indicating if the group is visible. + The title of the group. + Duration of the animation. + Value indicating if the group is toggled. + + + + Ends drawing a toggle group started by . + + + + + Begins drawing a horizontal auto scroll box. Remember to end with . + + The for the field. + The GUILayout options. + The rect used for the field. + + + + Ends drawing a horizontal auto scroll box started by . + + + + + Creates a rect that can be grabbed and pulled to change a value up or down. + + The grabbable rect. + The control ID for the sliding. + The current value. + + The current value. + + + + + Creates a rect that can be grabbed and pulled to change a value up or down. + + The grabbable rect. + The control ID for the sliding. + The current value. + + The current value. + + + + + Creates a rect that can be grabbed and pulled to change a value up or down. + + The grabbable rect. + The control ID for the sliding. + The current value. + + The current value. + + + + + Creates a rect that can be grabbed and pulled to change a value up or down. + + The grabbable rect. + The control ID for the sliding. + The current value. + + The current value. + + + + + Creates a rect that can be grabbed and pulled + + The grabbable rect. + The cursor. + + The the mouse delta position. + + + + + Creates a rect that can be grabbed and pulled + + The position. + The grabbable rect. + + The the mouse delta position. + + + + + Draws a field for a value of type T - dynamically choosing an appropriate drawer for the type. + Currently supported are: char, string, sbyte, byte, short, ushort, int, uint, long, ulong, float, double, decimal, Guid and all enums. + + The type of the value to draw. + The label of the fields. + The value to draw. + The layout options. + The possibly changed value. + + + + Checks whether a given type can be drawn as a dynamic field by + + The type to check. + True if the type can be drawn, otherwise false. + + + + Gets the feature rich control rect. + + + + + Gets the feature rich control rect. + + + + + Creates a control ID that handles keyboard control, focused editor window, indentation and prefix label correctly. + + The rect to make a feature rich control for. + The label for the control. Leave null for no label. + The created control ID. + A value indicating whether or not the control has keyboard focus. + + + + Creates a control ID that handles keyboard control, focused editor window, indentation and prefix label correctly. + + The rect to make a feature rich control for. + The created control ID. + A value indicating whether or not the control has keyboard focus. + + + + Collection of GUIStyles used by Sirenix. + + + + + Border color. + + + + + Box background color. + + + + + Dark editor background color. + + + + + Editor window background color. + + + + + Menu background color. + + + + + Header box background color. + + + + + Highlighted Button Color. + + + + + Highlight text color. + + + + + Highlight property color. + + + + + List item color for every other item. + + + + + List item hover color for every other item. + + + + + List item hover color for every other item. + + + + + List item color for every other item. + + + + + List item drag background color. + + + + + List item drag background color. + + + + + Column title background colors. + + + + + List item background color for every other item. + + + + + List item background color for every other item. + + + + + Menu button active background color. + + + + + Menu button border color. + + + + + Menu button color. + + + + + Menu button hover color. + + + + + A light border color. + + + + + Bold label style. + + + + + Tag Button style. + + + + + Bold label style. + + + + + Centered bold label style. + + + + + Box container style. + + + + + Popup style. + + + + + Box header style. + + + + + Left button style. + + + + + Left button selected style. + + + + + Left button style. + + + + + Left button selected style. + + + + + Mid button style. + + + + + Mid button selected style. + + + + + Right button style. + + + + + Right button selected style. + + + + + Pane Options Button + + + + + Left button style. + + + + + Left button selected style. + + + + + Left button style. + + + + + Left button selected style. + + + + + Mid button style. + + + + + Mid button selected style. + + + + + Right button style. + + + + + Right button selected style. + + + + + Color field background style. + + + + + Foldout style. + + + + + Icon button style. + + + + + Label style. + + + + + White label style. + + + + + Black label style. + + + + + Centered label style. + + + + + Left Aligned Centered Label + + + + + Left aligned grey mini label style. + + + + + Centered grey mini label + + + + + Left right aligned white mini label style. + + + + + Centered white mini label style. + + + + + Centered black mini label style. + + + + + List item style. + + + + + Menu button background style. + + + + + No style. + + + + + Odin Editor Wrapper. + + + + + Padding less box style. + + + + + Content Padding + + + + + Property padding. + + + + + Property margin. + + + + + Rich text label style. + + + + + Right aligned grey mini label style. + + + + + Right aligned white mini label style. + + + + + Section header style. + + + + + Section header style. + + + + + Toggle group background style. + + + + + Toggle group checkbox style. + + + + + Toggle group padding style. + + + + + Toggle group title background style. + + + + + Toolbar background style. + + + + + Toolbar button style. + + + + + Toolbar button selected style. + + + + + Toolbar search cancel button style. + + + + + Toolbar search field style. + + + + + Toolbar tab style. + + + + + Title style. + + + + + Bold title style. + + + + + Centered bold title style. + + + + + Right aligned bold title style. + + + + + Centered title style. + + + + + Right aligned title style. + + + + + Subtitle style. + + + + + Centered sub-title style. + + + + + Right aligned sub-title style. + + + + + Message box style. + + + + + Detailed Message box style. + + + + + Multiline Label + + + + + Centered Multiline Label + + + + + Centered Text Field + + + + + Gets the bottom box padding. + + + + + Unitys PaneOptions GUIStyle. + + + + + Unitys ProjectBrowserTextureIconDropShadow GUIStyle. + + + + + Unitys TL SelectionButton PreDropGlow GUIStyle. + + + + + Unitys ShurikenModuleTitle GUIStyle. + + + + + Draw this one manually with: new Color(1, 1, 1, EditorGUIUtility.isProSkin ? 0.25f : 0.45f) + + + + + A tab page created by . + + + + + + Gets the title of the tab. + + + + + Gets the title of the tab. + + + + + Gets the rect of the page. + + + + + Begins the page. + + + + + Ends the page. + + + + + Whether to draw a draw scroll view. + + + + + The number of pixels before a scroll view appears. + + + + + The maximum scroll view height. + + + + + The scroll position + + + + + The cell style + + + + + Gets the rect containing all rows. + + + + + Gets the first visible row index. + + + + + Gets the last visible row index. + + + + + Gets the outer rect. The height of this <= .height. + + + + + Gets the row rect. + + + + + Begins the table. + + + + + Begins the column. + + + + + Begins the cell. + + + + + Ends the cell. + + + + + Ends the column. + + + + + Ends the table. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Utility functions for Unity assets. + + + + + Gets all assets of the specified type. + + + + + Gets all assets of the specified type. + + The type of assets to find. + The asset folder path. + + + + Gets all assets of the specified type. + + The type of assets to find. + The asset folder path. + + + + Asset search helper. + + + + + The asset object. + + + + + Current index. + + + + + Search result count. + + + + + Tests if an asset can be created from a type. + + The type to test. + true if an asset can be created. Otherwise false. + + + + Tests if an asset can be created from a type. + + The type to test. + The base asset type. + true if an asset can be created. Otherwise false. + + + + Gets project path to the specified asset. + + The asset object. + The path to the asset. + + + + Creates a new asset of the specified type. + + The type of the asset. + Project path to the new asset. + The name of the asset. + + + + Functions for accessing the clipboard. + + + + + Gets the current copy mode. + + + + + Copies the specified object. + + + The object. + The copy mode. + + + + Copies the specified object. + + + + + Clears this instance. + + + + + Determines whether this instance can paste the specified type. + + + + + Determines whether this instance can paste the specified type. + + + + + Determines whether or not the Clipboard contains any instance. + + + + + Tries the paste. + + + + + Copies or gets the current object in the clipboard. + + + + + Copies or gets the current object in the clipboard. + + + + + The various modes of copying an object to the clipboard. + + + + + Deep copy. + + + + + Shallow Copy. + + + + + Reference Copy. + + + + + A utility class for getting delta time for the GUI editor. + + + + + Gets an EditorTimeHelper instance for the current drawing window. + + + + + Initializes a new instance of the class. + + + + + Gets the delta time. + + + + + Updates the delta time. + + + + + Compare strings and produce a distance score between them. + + + + + Determines whether if the source is within the search. + + The source string. + The target string. + Should the algorithm ignore letter case?. + Should the algorithm attempt to search on an abbreviation of the source?. + Threshold for what is considered to be within the search. 0 will return everything and 1 will only return exact matches. + True if the source is within the search. Otherwise false. + + + + Compares the target to the source and returns a distance score. + + The source string. + The target string. + + + Distance score. 0 is no match, and 1 is exact match. + + + + A utility class for properly counting frames and helps determine when a frame has started in an editor window. + + + + + Gets the frame count. + + + + + Gets a value indicating whether this instance is new frame. + + + + + Updates the frame counter and returns itself. + + + + + Hides the ObjectMembers in Visual Studio IntelliSense + + + + + Determines whether the specified , is equal to this instance. + + + + + Returns a hash code for this instance. + + + + + Gets the type. + + + + + Returns a that represents this instance. + + + + + Collection of texture functions. + + + + + Loads an image from bytes with the specified width and height. Use this instead of someTexture.LoadImage() if you're compiling to an assembly. Unity has moved the method in 2017, + and Unity's assembly updater is not able to fix it for you. This searches for a proper LoadImage method in multiple locations, and also handles type name conflicts. + + + + + Crops a Texture2D into a new Texture2D. + + + + + Converts a Sprite to a Texture2D. + + + + + + + AssemblyTypeFlags is a bitmask used to filter types and assemblies related to Unity. + + + + + + Excludes all types. + + + + + UserTypes includes all custom user scripts that are not located in an editor or plugin folder. + + + + + PluginTypes includes all types located in the plugins folder and are not located in an editor folder. + + + + + UnityTypes includes all types depended on UnityEngine and from UnityEngine, except editor, plugin and user types. + + + + + UserEditorTypes includes all custom user scripts that are located in an editor folder but not in a plugins folder. + + + + + PluginEditorTypes includes all editor types located in the plugins folder. + + + + + UnityEditorTypes includes all editor types that are not user editor types nor plugin editor types. + + + + + OtherTypes includes all other types that are not depended on UnityEngine or UnityEditor. + + + + + CustomTypes includes includes all types manually added to the Unity project. + This includes UserTypes, UserEditorTypes, PluginTypes and PluginEditorTypes. + + + + + GameTypes includes all assemblies that are likely to be included in builds. + This includes UserTypes, PluginTypes, UnityTypes and OtherTypes. + + + + + EditorTypes includes UserEditorTypes, PluginEditorTypes and UnityEditorTypes. + + + + + All includes UserTypes, PluginTypes, UnityTypes, UserEditorTypes, PluginEditorTypes, UnityEditorTypes and OtherTypes. + + + + + A utility class for finding types in various asssembly. + + + + + Initializes the class. + + + + + Re-scans the entire AppDomain. + + + + + Gets an of all assemblies in the current . + + An of all assemblies in the current . + + + + Gets the for a given assembly. + + The assembly. + The for a given assembly. + is null. + + + + Gets the type. + + The full name of the type without any assembly information. + + + + Gets the type. + + + + + Determines whether an assembly is depended on another assembly. + + The assembly. + The other assembly. + + true if has a reference in or is the same as . + + is null. + is null. + + + + Determines whether the assembly module is a of type . + + The assembly. + + true if the specified assembly of type ; otherwise, false. + + assembly + + + + Gets the full file path to a given assembly. + + The assembly. + The full file path to a given assembly, or Null if no file path was found. + is Null. + + + + Gets the full directory path to a given assembly. + + The assembly. + The full directory path in which a given assembly is located, or Null if no file path was found. + + + + Get types from the current AppDomain with a specified filter. + + The filters. + Types from the current AppDomain with the specified filters. + + + + Find members of the given type, while providing good error messages based on the following search filters provided. + See for more information. + + + + + MemberFinder is obsolete, and has been replacted by and . + Use cases that do not fit those utlities should use manual reflection that is hand-optimized for the best performance in the given case. + + MemberFinder was a utility class often used by Odin drawers to find fields, methods, and + properties while providing good user-friendly error messages based on the search criteria. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Find members of the given type, while providing good error messages based on the following search filters provided. + + + + + Find members of the given type, while providing good error messages based on the following search filters provided. + + + + + Can be true for both fields, properties and methods. + + + + + + Exclude members found in base-types. + + + + + Only include methods with the following parameter. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Only include methods with the following parameters. + Calling this will also exclude fields and properties. + Parameter type inheritance is supported. + + + + + Determines whether [has return type] [the specified return type]. + + + + + Can be true for both fields, properties and methods. + + + + + Calls IsField() and IsProperty(). + + + + + Only include static members. By default, both static and non-static members are included. + + + + + Only include non-static members. By default, both static and non-static members are included. + + + + + Specify the name of the member. + + + + + Excludes fields and methods if nether IsField() or IsMethod() is called. Otherwise includes properties. + By default, all member types are included. + + + + + Excludes fields and properties if nether IsField() or IsProperty() is called. Otherwise includes methods. + By default, all member types are included. + + + + + Excludes properties and methods if nether IsProperty() or IsMethod() is called. Otherwise includes fields. + By default, all member types are included. + + + + + Excludes non-public members if IsNonPublic() has not yet been called. Otherwise includes public members. + By default, both public and non-public members are included. + + + + + Excludes public members if IsPublic() has not yet been called. Otherwise includes non-public members. + By default, both public and non-public members are included. + + + + + Excludes fields and properties, and only includes methods with a return type of void. + + + + + Gets the member based on the search filters provided + Returns null if no member was found. + + + + + Gets the member based on the search filters provided, and provides a proper error message if no members was found. + + + + + Gets the member based on the search filters provided, and provides a proper error message if no members was found. + + + + + Try gets the member based on the search filters provided, and provides a proper error message if no members was found. + + + + + Try gets the member based on the search filters provided, and provides a proper error message if no members was found. + + + + + Try gets all members based on the search filters provided, and provides a proper error message if no members was found. + + + + + Gets or sets the width of the col. + + + + + Gets or sets the minimum width. + + + + + Gets a value indicating whether the width should be preserved when the table itself gets resiszed. + + + + + Gets a value indicating whether this is resizable. + + + + + Sometimes, an idiot overrides a delay action subscription to , + which can be done because the people at Unity didn't know what events were once upon a time. + This method subscribes to a lot of different callbacks, in the hopes of catching at least one. + + + + + Sometimes, an idiot overrides a delay action subscription to , + which can be done because the people at Unity didn't know what events were once upon a time. + This method subscribes to a lot of different callbacks, in the hopes of catching at least one. + + As opposed to , this method is safe to call from any thread, and will + delay the actual subscription to a safe time. + + + + + Sometimes, an idiot overrides a delay action subscription to , + which can be done because the people at Unity didn't know what events were once upon a time. + This method subscribes to a lot of different callbacks, in the hopes of catching at least one. + + + + + In 2020.1, Unity changed EditorApplication.delayCall from a field to an event, meaning + we now have to use reflection to access it consistently across all versions of Unity. + + + + diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml.meta new file mode 100644 index 00000000..1f1ac28e --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.Editor.xml.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be95a6ddcf52ad440b470fdd3aff3a97 +timeCreated: 1602076756 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll new file mode 100644 index 00000000..6dbb8819 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.mdb b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.mdb new file mode 100644 index 00000000..2a06be46 Binary files /dev/null and b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.mdb differ diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.mdb.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.mdb.meta new file mode 100644 index 00000000..ba02070e --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.mdb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 35e0a96a6e93b5f409e91af2f1729911 +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.meta new file mode 100644 index 00000000..6fcdb301 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 4873f2a8bdae42baa0406e8a61366ca1 +timeCreated: 1488828285 +licenseType: Store +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude N3DS: 1 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude PS4: 1 + Exclude PSM: 1 + Exclude PSP2: 1 + Exclude SamsungTV: 1 + Exclude Tizen: 1 + Exclude WebGL: 1 + Exclude WiiU: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 1 + Exclude XboxOne: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + Editor: + enabled: 1 + settings: + DefaultValueInitialized: true + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml new file mode 100644 index 00000000..f7569055 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml @@ -0,0 +1,3734 @@ + + + + Sirenix.Utilities + + + + + Extension methods for the UnityEngine.Color type. + + + + + Lerps between multiple colors. + + The colors. + The t. + + + + + Moves the towards implementation for Color. + + From color. + To color. + The maximum delta. + + + + Tries to parse a string to a Color. The following formats are supported: + "new Color(0.4, 0, 0, 1)", "#FFEEBBFF", "#FFEECC", "FFEEBBFF", "FFEECC" + + The color string. + The color. + Returns true if the parse was a success. + + + + Converts a color to a string formatted to c# + + The color. + new Color(r, g, b, a) + + + + Pows the color with the specified factor. + + The color. + The factor. + + + + Normalizes the RGB values of the color ignoring the alpha value. + + The color. + + + + Delegate method extensions. + + + + + Memoizes the specified func - returns the memoized version + + + + + Memoizes the specified func - returns the memoized version + + + + + FieldInfo method extensions. + + + + + Determines whether the specified field is an alias. + + The field to check. + + true if the specified field is an alias; otherwise, false. + + + + + Returns the original, backing field of an alias field if the field is an alias. + + The field to check. + /// if set to true an exception will be thrown if the field is not aliased. + + The field was not aliased; this only occurs if throwOnNotAliased is true. + + + + Garbage free enumerator methods. + + + + + Garbage free enumerator for lists. + + + + + Garbage free enumerator for dictionaries. + + + + + Garbage free enumator for dictionary values. + + + + + Garbage free enumerator for hashsets. + + + + + List iterator. + + + + + Creates a list iterator. + + + + + Gets the enumerator. + + + + + Gets the current value. + + + + + Moves to the next value. + + + + + Disposes the iterator. + + + + + Hashset iterator. + + + + + Creates a hashset iterator. + + + + + Gets the enumerator. + + + + + Gets the current value. + + + + + Moves to the next value. + + + + + Disposes the iterator. + + + + + Dictionary iterator. + + + + + Creates a dictionary iterator. + + + + + Gets the enumerator. + + + + + Gets the current value. + + + + + Moves to the next value. + + + + + Disposes the iterator. + + + + + Dictionary value iterator. + + + + + Creates a dictionary value iterator. + + + + + Gets the enumerator. + + + + + Gets the current value. + + + + + Moves to the next value. + + + + + Disposes the iterator. + + + + + Various LinQ extensions. + + + + + Calls an action on each item before yielding them. + + The collection. + The action to call for each item. + + + + Perform an action on each item. + + The source. + The action to perform. + + + + Perform an action on each item. + + The source. + The action to perform. + + + + Convert each item in the collection. + + The collection. + Func to convert the items. + + + + Convert a colletion to a HashSet. + + + + + Convert a colletion to a HashSet. + + + + + Convert a collection to an immutable list. + + The collection. + + + + Add an item to the beginning of a collection. + + The collection. + Func to create the item to prepend. + + + + Add an item to the beginning of a collection. + + The collection. + The item to prepend. + + + + Add a collection to the beginning of another collection. + + The collection. + The collection to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + Func to create the item to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The item to prepend. + + + + Add a collection to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The collection to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + Func to create the item to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The item to prepend. + + + + Add a collection to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The collection to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + Func to create the item to prepend. + + + + Add an item to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The item to prepend. + + + + Add a collection to the beginning of another collection, if a condition is met. + + The collection. + The condition. + The collection to prepend. + + + + Add an item to the end of a collection. + + The collection. + Func to create the item to append. + + + + Add an item to the end of a collection. + + The collection. + The item to append. + + + + Add a collection to the end of another collection. + + The collection. + The collection to append. + + + + Add an item to the end of a collection if a condition is met. + + The collection. + The condition. + Func to create the item to append. + + + + Add an item to the end of a collection if a condition is met. + + The collection. + The condition. + The item to append. + + + + Add a collection to the end of another collection if a condition is met. + + The collection. + The condition. + The collection to append. + + + + Add an item to the end of a collection if a condition is met. + + The collection. + The condition. + Func to create the item to append. + + + + Add an item to the end of a collection if a condition is met. + + The collection. + The condition. + The item to append. + + + + Add a collection to the end of another collection if a condition is met. + + The collection. + The condition. + The collection to append. + + + + Returns and casts only the items of type . + + The collection. + + + + Adds a collection to a hashset. + + The hashset. + The collection. + + + + Returns true if the list is either null or empty. Otherwise false. + + The list. + + + + Sets all items in the list to the given value. + + The list. + The value. + + + + Adds the elements of the specified collection to the end of the IList<T>. + + + + + Sorts an IList + + + + + Sorts an IList + + + + + MemberInfo method extensions. + + + + + Returns true if the attribute whose type is specified by the generic argument is defined on this member + + + + + Returns true if the attribute whose type is specified by the generic argument is defined on this member + + + + + Returns the first found custom attribute of type T on this member + Returns null if none was found + + + + + Returns the first found non-inherited custom attribute of type T on this member + Returns null if none was found + + + + + Gets all attributes of the specified generic type. + + The member. + + + + Gets all attributes of the specified generic type. + + The member. + If true, specifies to also search the ancestors of element for custom attributes. + + + + Gets all attribute instances defined on a MemeberInfo. + + The member. + + + + Gets all attribute instances on a MemberInfo. + + The member. + If true, specifies to also search the ancestors of element for custom attributes. + + + + If this member is a method, returns the full method name (name + params) otherwise the member name paskal splitted + + + + + Determines whether a FieldInfo, PropertyInfo or MethodInfo is static. + + The member. + + true if the specified member is static; otherwise, false. + + + + + + Determines whether the specified member is an alias. + + The member to check. + + true if the specified member is an alias; otherwise, false. + + + + + Returns the original, backing member of an alias member if the member is an alias. + + The member to check. + /// if set to true an exception will be thrown if the member is not aliased. + + The member was not aliased; this only occurs if throwOnNotAliased is true. + + + + Various extensions for MethodInfo. + + + + + Returns the specified method's full name "methodName(argType1 arg1, argType2 arg2, etc)" + Uses the specified gauntlet to replaces type names, ex: "int" instead of "Int32" + + + + + Returns a string representing the passed method parameters names. Ex "int num, float damage, Transform target" + + + + + Returns the specified method's full name. + + + + + Tests if a method is an extension method. + + + + + Determines whether the specified method is an alias. + + The method to check. + + true if the specified method is an alias; otherwise, false. + + + + + Returns the original, backing method of an alias method if the method is an alias. + + The method to check. + /// if set to true an exception will be thrown if the method is not aliased. + + The method was not aliased; this only occurs if throwOnNotAliased is true. + + + + Determines the type of operator. + + + + + + The == operator. + + + + + The != operator. + + + + + The + operator. + + + + + The - operator. + + + + + The * operator. + + + + + The / operator. + + + + + The < operator. + + + + + The > operator. + + + + + The <= operator. + + + + + The >= operator. + + + + + The % operator. + + + + + The >> operator. + + + + + The << operator. + + + + + The & operator. + + + + + The | operator. + + + + + The ^ operator. + + + + + The ~ operator. + + + + + The && operator. + + + + + The || operator. + + + + + The ! operator. + + + + + DirectoryInfo method extensions. + + + + + Gets the name of the directory. Always returns forward slash seperators as opposed to Path.GetDirectoryName(). + + + + + Determines whether the directory has a given directory in its hierarchy of children. + + The parent directory. + The sub directory. + + + + Finds a parent directory with a given name, or null if no such parent directory exists. + + + + + Returns a value indicating whether or not a path can be made relative to another. + + The parent path. + The path to make relative to the parent path. + A value indicating if the path can be made relative to the parent path. + + + + Returns a path string to path that is relative to the parent path. + + The parent path. + The path to make relative to the parent path. + A relative path from parent path to path. + + + + Tries to make a path that is relative from parent path to path. + + The parent path. + The path to make relative to the parent path. + A relative path from parent path to path. null if no relative path could be made. + A value indicating if the method succeeded in making a relative path. + + + + Combines two paths, and replaces all backslases with forward slash. + + + + + PropertyInfo method extensions. + + + + + Determines whether a property is an auto property. + + + + + Determines whether the specified property is an alias. + + The property to check. + + true if the specified property is an alias; otherwise, false. + + + + + Returns the original, backing property of an alias property if the property is an alias. + + The property to check. + /// if set to true an exception will be thrown if the property is not aliased. + + The property was not aliased; this only occurs if throwOnNotAliased is true. + + + + Defines a collection of handy Rect transformation methods, that can chained together for complex behaviour. + Note that no method defined here changes the original Rect, but instead returns a new transformed Rect. + + + + + Returns a Rect with the specified width. + + The original Rect. + The desired width of the new Rect. + + + + Returns a Rect with the specified height. + + The original Rect. + The desired height of the new Rect. + + + + Returns a Rect with the specified size. + + The original Rect. + The desired width of the new Rect. + The desired height of the new Rect. + + + + Returns a Rect with the specified size. + + The original Rect. + The desired size of the new Rect. + + + + Returns a Rect that has been inserted by the specified amount on the X-axis. + + The original Rect. + The desired padding. + + + + Returns a Rect that has been inserted by the specified amount on the X-axis. + + The original Rect. + Desired padding on the left side. + Desired padding on the right side. + + + + Returns a Rect that has been inserted by the specified amount on the Y-axis. + + The original Rect. + The desired padding. + + + + Returns a Rect that has been inserted by the specified amount on the Y-axis. + + The original Rect. + The desired padding on the top. + The desired padding on the bottom. + + + + Returns a Rect that has been inserted by the specified amount. + + The original Rect. + The desired padding. + + + + Returns a Rect that has been inserted by the specified amount. + + The original Rect. + The desired horizontal padding. + The desired vertical padding. + + + + Returns a Rect that has been inserted by the specified amount. + + The original Rect. + The desired padding on the left. + The desired padding on the right. + The desired padding on the top. + The desired padding on the bottom. + + + + Returns a Rect, with the specified width, that has been aligned to the left of the original Rect. + + The original Rect. + The desired width of the new Rect. + + + + Returns a Rect, with the specified width, that has been aligned to horizontal center of the original Rect. + + The original Rect. + The desired width of the new Rect. + + + + Returns a Rect, with the specified width and height in the center of the provided rect. + + The original Rect. + The desired width of the new Rect. + The desired height of the new Rect. + + + + Returns a Rect, with the specified width, that has been aligned to the right of the original Rect. + + The original Rect. + The desired width of the new Rect. + + + + Returns a Rect, with the specified width, that has been aligned to the right of the original Rect. + + + + + Returns a Rect, with the specified height, that has been aligned to the top of the original Rect. + + The original Rect. + The desired height of the new Rect. + + + + Returns a Rect, with the specified height, that has been aligned to the vertical middle of the original Rect. + + The original Rect. + The desired height of the new Rect. + + + + Returns a Rect, with the specified height, that has been aligned to the bottom of the original Rect. + + The original Rect. + The desired height of the new Rect. + + + + Returns a Rect, with the specified width, that has been aligned horizontally to the center of the original rect. + + The original Rect. + The desired width of the new Rect. + + + + Returns a Rect, with the specified height, that has been aligned vertically to the center of the original rect. + + The original Rect. + The desired height of the new Rect. + + + + Returns a Rect, with the specified width and height, that has been aligned horizontally and vertically to the center of the original rect. + + The original Rect. + The desired width and height of the new Rect. + + + + Returns a Rect, with the specified width and height, that has been aligned horizontally and vertically to the center of the original rect. + + The original Rect. + The desired width of the new Rect. + The desired height of the new Rect. + + + + Returns a Rect that has been expanded by the specified amount. + + The original Rect. + The desired expansion. + + + + Returns a Rect that has been expanded by the specified amount. + + The original Rect. + The desired expansion on the X-axis. + The desired expansion on the Y-axis. + + + + Returns a Rect that has been expanded by the specified amount. + + The original Rect. + The desired expansion on the left. + The desired expansion on the right. + The desired expansion on the top. + The desired expansion on the bottom. + + + + Splits a Rect horizontally into the specified number of sub-rects, and returns a sub-rect for the specified index. + + The original Rect. + The index for the subrect. Includes 0, and excludes count. + The amount of subrects the Rect should be split into. + + + + Splits a Rect vertically into the specified number of sub-rects, and returns a sub-rect for the specified index. + + The original Rect. + The index for the subrect. Includes 0, and excludes count. + The amount of subrects the Rect should be split into. + + + + Splits a Rect into a grid from left to right and then down. + + The original rect. + The width of a grid cell. + The height of a grid cell. + The index of the grid cell. + + + + + Splits a Rect into a grid from left to right and then down. + + + + + Moves a Rect to the specified center X position. + + The original Rect. + The desired center x position. + + + + Moves a Rect to the specified center Y position. + + The desired original Rect. + The desired desired center y position. + + + + Moves a Rect to the specified center position. + + The original Rect. + The desired center X position. + The desired center Y position. + + + + Moves a Rect to the specified center position. + + The original Rect. + The desired center position. + + + + Moves a Rect to the specified position. + + The orignal Rect. + The desired position. + + + + Resets a Rect's position to zero. + + The original Rect. + + + + Moves a Rect's position by the specified amount. + + The original Rect. + The change in position. + + + + Moves a Rect's position by the specified amount. + + The original Rect. + The x. + The y. + + + + Sets a Rect's X position. + + The original Rect. + The desired X position. + + + + Adds to a Rect's X position. + + The original Rect. + The value to add. + + + + Subtracts from a Rect's X position. + + The original Rect. + The value to subtract. + + + + Sets a Rect's Y position. + + The original Rect. + The desired Y position. + + + + Adds to a Rect's Y position. + + The original Rect. + The value to add. + + + + Subtracts a Rect's Y position. + + The original Rect. + The value to subtract. + + + + Sets the min position of a Rect. + + The original Rect. + The desired min position. + + + + Adds to a Rect's min position. + + The original rect. + The value to add. + + + + Subtracts a Rect's min position. + + The original Rect. + The vlaue to subtract. + + + + Sets a Rect's max position. + + The original Rect. + The desired max position. + + + + Adds to a Rect's max position. + + The original Rect. + The value to add. + + + + Subtracts a Rect's max position. + + The original Rect. + The value to add. + + + + Sets a Rect's X min position. + + The original Rect. + The desired min X position. + + + + Adds to a Rect's X min position. + + The original Rect. + The value to add. + + + + Subtracts from a Rect's X min position. + + The original Rect. + The value to subtract. + + + + Sets a Rect's X max position. + + The original Rect. + The desired X max position. + + + + Adds to a Rect's X max position. + + The original Rect. + The value to add. + + + + Subtracts a Rect's X max position. + + The original Rect. + The value to subtract. + + + + Sets a Rect's Y min position. + + The original Rect. + The desired Y min. + + + + Adds to a Rect's Y min position. + + The original Rect. + The value to add. + + + + Subtracts a Rect's Y min position. + + The original Rect. + The value to subtract. + + + + + Sets a Rect's Y max position. + + The original Rect. + The desired Y max position. + + + + Adds to a Rect's Y max position. + + The original Rect. + The value to add. + + + + Subtracts from a Rect's Y max position. + + The original Rect. + The value to subtract. + + + + Sets a Rect's width, if it is less than the specified value. + + The original Rect. + The desired min width. + + + + Sets a Rect's width, if it is greater than the specified value. + + The original Rect. + The desired max width. + + + + Sets a Rect's height, if it is less than the specified value. + + The original Rect. + The desired min height. + + + + Sets a Rect's height, if it is greater than the specified value. + + The original Rect. + The desired max height. + + + + Expands a rect to contain a given position. + + The original Rect. + The position to expand the rect towards. + + + + String method extensions. + + + + + Eg MY_INT_VALUE => MyIntValue + + + + + Returns whether or not the specified string is contained with this string + + + + + Ex: "thisIsCamelCase" -> "This Is Camel Case" + + + + + Returns true if this string is null, empty, or contains only whitespace. + + The string to check. + true if this string is null, empty, or contains only whitespace; otherwise, false. + + + + Type method extensions. + + + + + Type name alias lookup. + TypeNameAlternatives["Single"] will give you "float", "UInt16" will give you "ushort", "Boolean[]" will give you "bool[]" etc.. + + + + + Checks whether a given string is a valid CSharp identifier name. This also checks full type names including namespaces. + + The identifier to check. + + + + Determines whether a type can be casted to another type. + + From. + To. + if set to true an implicit or explicit operator must be defined on the given type. + + + + If a type can be casted to another type, this provides a function to manually convert the type. + + From. + To. + if set to true an implicit or explicit operator must be defined on the given type. + + + + If a type can be casted to another type, this provides a function to manually convert the type. + + if set to true an implicit or explicit operator must be defined on the given type. + + + + If a type can be casted to another type, this provides the method info of the method in charge of converting the type. + + From. + To. + if set to true an implicit or explicit operator must be defined on the given type. + + + + Gets an equality comparer delegate used to compare the equality of values of a given type. In order, this will be: + + 1. The == operator, if one is defined on the type. + 2. A delegate that uses , if the type implements that interface. + 3. .NET's own + + + Note that in the special case of the type , a special equality comparer is returned that only checks whether all the Quaternion components are equal. + This is because, by default, Quaternion's equality operator is broken when operating on invalid quaternions; "default(Quaternion) == default(Quaternion)" evaluates to false, and this causes a multitude of problems. + Special delegates are also returned for float and double, that consider float.NaN to be equal to float.NaN, and double.NaN to be equal to double.NaN. + + + + + Gets the first attribute of type T. Returns null in the no attribute of type T was found. + + The type. + If true, specifies to also search the ancestors of element for custom attributes. + + + + Determines whether a type implements or inherits from another type. + + The type. + To. + + + + Determines whether a type implements an open generic interface or class such as IList<> or List<>. + + Type of the candidate. + Type of the open generic type. + + + + + Determines whether a type implements an open generic interface such as IList<>. + + Type of the candidate. + Type of the open generic interface. + + Type " + openGenericInterfaceType.Name + " is not a generic type definition and an interface. + + + + Determines whether a type implements an open generic class such as List<>. + + Type of the candidate. + Type of the open generic interface. + + + + Gets the generic arguments of an inherited open generic class or interface. + + Type of the candidate. + The open generic type to get the arguments of. + + + + Gets the generic arguments of an inherited open generic class. + + Type of the candidate. + Type of the open generic class. + + + + Gets the generic arguments of an inherited open generic interface. + + Type of the candidate. + Type of the open generic interface. + + + + Gets the MethodInfo of a specific operator kind, with the given left and right operands. This overload is *far* faster than any of the other GetOperatorMethod implementations, and should be used whenever possible. + + + + + Gets the MethodInfo of a specific operator type. + + + + + Gets the MethodInfo of a specific operator type. + + + + + Gets all members from a given type, including members from all base types if the flag isn't set. + + + + + Gets all members from a given type, including members from all base types. + + + + + Gets all members of a specific type from a type, including members from all base types, if the flag isn't set. + + + + + Gets the generic type definition of an open generic base type. + + + + + Gets the generic type definition of an open generic base type. + + + + + Returns a lazy enumerable of all the base types of this type including interfaces and classes + + + + + Returns a lazy enumerable of all the base classes of this type + + + + + Used to filter out unwanted type names. Ex "int" instead of "Int32" + + + + + Returns a nicely formatted name of a type. + + + + + Returns a nicely formatted full name of a type. + + + + + Gets the name of the compilable nice. + + The type. + + + + Gets the full name of the compilable nice. + + The type. + + + + Returns the first found custom attribute of type T on this type + Returns null if none was found + + + + + Returns the first found non-inherited custom attribute of type T on this type + Returns null if none was found + + + + + Gets all attributes of type T. + + The type. + + + + Gets all attributes of type T. + + The type + If true, specifies to also search the ancestors of element for custom attributes. + + + + Returns true if the attribute whose type is specified by the generic argument is defined on this type + + + + + Returns true if the attribute whose type is specified by the generic argument is defined on this type + + + + + Determines whether a type inherits or implements another type. Also include support for open generic base types such as List<>. + + + + + + Determines whether a type inherits or implements another type. Also include support for open generic base types such as List<>. + + + + + + + Gets the number of base types between given type and baseType. + + + + + Determines whether a method has the specified parameter types. + + + + + FieldInfo will return the fieldType, propertyInfo the PropertyType, MethodInfo the return type and EventInfo will return the EventHandlerType. + + The MemberInfo. + + + + Gets the value contained in a given . Currently only and is supported. + + The to get the value of. + The instance to get the value from. + The value contained in the given . + Can't get the value of the given type. + + + + Sets the value of a given MemberInfo. Currently only and is supported. + + The to set the value of. + The object to set the value on. + The value to set. + + Property has no setter + or + Can't set the value of the given type. + + + + // + Tries to infer a set of valid generic parameters for a generic type definition, given a subset of known parameters. + + The generic type definition to attempt to infer parameters for. + The inferred parameters, if inferral was successful. + The known parameters to infer from. + True if the parameters could be inferred, otherwise, false. + + genericTypeDefinition is null + or + knownParameters is null + + The genericTypeDefinition parameter must be a generic type definition. + + + + Checks whether an array of types satisfy the constraints of a given generic type definition. + If this method returns true, the given parameters can be safely used with with the given generic type definition. + + The generic type definition to check. + The parameters to check validity for. + + genericType is null + or + types is null + + The genericType parameter must be a generic type definition. + + + + Checks whether an array of types satisfy the constraints of a given generic method definition. + If this method returns true, the given parameters can be safely used with with the given generic method definition. + + The generic method definition to check. + The parameters to check validity for. + + genericType is null + or + types is null + + The genericMethod parameter must be a generic method definition. + + + + Before calling this method we must ALWAYS hold a lock on the GenericConstraintsSatisfaction_LOCK object, as that is an implicit assumption it works with. + + + + + Not yet documented. + + + + + Formats a string with the specified generic parameter constraints on any given type. Example output: where T : class + + + + + Determines whether a generic type contains the specified generic argument constraints. + + The type. + The generic argument types. + + + + Determines whether a type is a fully constructed generic type. + + + + + Determines whether a type is nullable by ensuring the type is neither a PrimitiveType, ValueType or an Enum. + + + + + Gets the enum bitmask in a ulong. + + enumType + + + + Gets a value indicating if the string is a reserved C# keyword. + + The identifier to check. + true if the string is a C# keyword. Otherwise false. + + + + Extends various Unity classes. + + + + + Determines whether a Unity object is null or "fake null", + without ever calling Unity's own equality operators. + This method is useful for checking if a Unity object is + null, destroyed or missing at times when it is not allowed + to call Unity's own equality operators, for example when + not running on the main thread. + + The Unity object to check. + True if the object is null, missing or destroyed; otherwise false. + + + + Contains utilities for operating on arrays. + + + + + Creates a new array with an added element. + + The element type of the array. + The array. + The value to add. + The new array. + The given array was null. + + + + Creates a new array with an element inserted at a given index. + + The element type of the array. + The array. + The index to insert at. + The value to insert. + The given array was null. + The index to insert at was out of range. + + + + Creates a new array with an element removed. + + The element type of the array. + The array. + The index to remove an element at. + + The given array was null. + The given index to remove an element at was out of range. + + + + Utility class for asset Guid script + + + + + Tries to update the Guid of a specified asset with the Guid from a specified script type. + + + + + Provides an easy way of claiming and freeing cached values of any non-abstract reference type with a public parameterless constructor. + + Cached types which implement the interface will receive notifications when they are claimed and freed. + + Only one thread should be holding a given cache instance at a time if is implemented, since the invocation of + is not thread safe, IE, weird stuff might happen if multiple different threads are trying to free + the same cache instance at the same time. This will practically never happen unless you're doing really strange stuff, but the case is documented here. + + The type which is cached. + + + + + Gets or sets the maximum size of the cache. This value can never go beneath 1. + + + The maximum size of the cache. + + + + + The cached value. + + + + + Gets a value indicating whether this cached value is free. + + + true if this cached value is free; otherwise, false. + + + + + Claims a cached value of type . + + A cached value of type . + + + + Releases a cached value. + + The cached value to release. + The cached value to release is null. + + + + Performs an implicit conversion from to . + + The cache to convert. + + The result of the conversion. + + + + + Releases this cached value. + + + + + Releases this cached value. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Provides utilities for using the namespace. + + This class is due for refactoring. Use at your own peril. + + + + + Gets a value indicating whether emitting is supported on the current platform. + + + true if the current platform can emit; otherwise, false. + + + + + Creates a delegate which gets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The type of the field to get a value from. + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which gets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which sets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The type of the field to set a value to. + The instance describing the field to create a setter for. + A delegate which sets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which sets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The instance describing the field to create a setter for. + A delegate which sets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which gets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The type of the instance to get a value from. + The type of the field to get a value from. + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which gets the value of a field from a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The type of the field to get a value from. + The of the instance to get a value from. + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which gets the weakly typed value of a field from a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The of the instance to get a value from. + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which sets the value of a field. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The type of the instance to set a value on. + The type of the field to set a value to. + The instance describing the field to create a setter for. + A delegate which sets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which sets the value of a field on a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The type of the field to set a value to. + Type of the instance. + The instance describing the field to create a setter for. + + A delegate which sets the value of the given field. + + The fieldInfo parameter is null. + Field cannot be static. + + + + Creates a delegate which sets the weakly typed value of a field on a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + Type of the instance. + The instance describing the field to create a setter for. + + A delegate which sets the value of the given field. + + The fieldInfo parameter is null. + Field cannot be static. + + + + Creates a delegate which gets the weakly typed value of a field from a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The of the instance to get a value from. + The instance describing the field to create a getter for. + A delegate which gets the value of the given field. + The fieldInfo parameter is null. + + + + Creates a delegate which sets the weakly typed value of a property on a weakly typed instance of a given type. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + Type of the instance. + The instance describing the property to create a setter for. + + A delegate which sets the value of the given field. + + The fieldInfo parameter is null. + Property cannot be static. + + + + Creates a delegate which sets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The type of the property to set a value to. + The instance describing the property to create a setter for. + A delegate which sets the value of the given property. + The propertyInfo parameter is null. + + + + Creates a delegate which gets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The type of the property to get a value from. + The instance describing the property to create a getter for. + A delegate which gets the value of the given property. + The propertyInfo parameter is null. + + + + Creates a delegate which sets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to set the value. + + The type of the instance to set a value on. + The type of the property to set a value to. + The instance describing the property to create a setter for. + A delegate which sets the value of the given property. + The propertyInfo parameter is null. + + + + Creates a delegate which gets the value of a property. If emitting is not supported on the current platform, the delegate will use reflection to get the value. + + The type of the instance to get a value from. + The type of the property to get a value from. + The instance describing the property to create a getter for. + A delegate which gets the value of the given property. + The propertyInfo parameter is null. + + + + Creates a fast delegate method which calls a given parameterless instance method and returns the result. + + The type of the class which the method is on. + The type which is returned by the given method info. + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + Creates a fast delegate method which calls a given parameterless static method. + + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + Creates a fast delegate method which calls a given parameterless weakly typed instance method. + + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + Not yet documented. + + + + + Creates a fast delegate method which calls a given weakly typed instance method with one argument and returns a value. + + The type of the result. + The type of the first argument. + The method info instance which is used. + + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + methodInfo + + Given method ' + methodInfo.Name + ' is static when it has to be an instance method. + or + Given method ' + methodInfo.Name + ' must return type + typeof(TResult) + . + or + Given method ' + methodInfo.Name + ' must have exactly one parameter. + or + The first parameter of the method ' + methodInfo.Name + ' must be of type + typeof(TArg1) + . + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Creates a fast delegate method which calls a given parameterless instance method. + + The type of the class which the method is on. + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + Creates a fast delegate method which calls a given instance method with a given argument. + + The type of the class which the method is on. + The type of the argument with which to call the method. + The method info instance which is used. + A delegate which calls the method and returns the result, except it's hundreds of times faster than MethodInfo.Invoke. + + + + This class encapsulates common combinations. + + + + + Search criteria encompassing all public and non-public members, including base members. + Note that you also need to specify either the Instance or Static flag. + + + + + Search criteria encompassing all public instance members, including base members. + + + + + Search criteria encompassing all non-public instance members, including base members. + + + + + Search criteria encompassing all public and non-public instance members, including base members. + + + + + Search criteria encompassing all public static members, including base members. + + + + + Search criteria encompassing all non-public static members, including base members. + + + + + Search criteria encompassing all public and non-public static members, including base members. + + + + + Search criteria encompassing all public instance members, excluding base members. + + + + + Search criteria encompassing all non-public instance members, excluding base members. + + + + + Search criteria encompassing all public and non-public instance members, excluding base members. + + + + + Search criteria encompassing all public static members, excluding base members. + + + + + Search criteria encompassing all non-public static members, excluding base members. + + + + + Search criteria encompassing all public and non-public static members, excluding base members. + + + + + Search criteria encompassing all members, including base and static members. + + + + + Search criteria encompassing all members (public and non-public, instance and static), including base members. + + + + + + A GlobalConfig singleton, automatically created and saved as a ScriptableObject in the project at the specified path. + This only happens if the UnityEditor is present. If it's not, a non-persistent ScriptableObject is created at run-time. + + + Remember to locate the path within a resources folder if you want the config file to be loaded at runtime without the Unity editor being present. + + + The asset path is specified by defining a . If no attribute is defined it will be saved in the root assets folder. + + + + + [GlobalConfig("Assets/Resources/MyConfigFiles/")] + public class MyGlobalConfig : GlobalConfig<MyGlobalConfig> + { + public int MyGlobalVariable; + } + + void SomeMethod() + { + int value = MyGlobalConfig.Instance.MyGlobalVariable; + } + + + + + + Gets a value indicating whether this instance has instance loaded. + + + + + Gets the singleton instance. + + + + + Tries to load the singleton instance. + + + + + Opens the config in a editor window. This is currently only used internally by the Sirenix.OdinInspector.Editor assembly. + + + + + This attribute is used by classes deriving from GlobalConfig and specifies the asset path for the generated config file. + + + + + + + Gets the full asset path including Application.dataPath. Only relevant if IsInResourcesFolder is false. + + + + + Gets the relative asset path. Only relevant if IsInResourcesFolder is false. + + + + + Gets the resources path. Only relevant if IsInResourcesFolder is true. + + + + + Whether the config should be associated with an asset in the project. If false, no config asset will be generated or loaded, and a new "temporary" config instance will be created for every reload. This is true by default. + + + + + Gets a value indicating whether this asset is located within a resource folder. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The relative asset. Remember to locate the path within a resources folder if you want the config file to be loaded at runtime without the Unity Editor. + + + + + GUILayoutOptions is a handy utility that provides cached GUILayoutOpion arrays based on the wanted parameters. + + + + + Most GUILayout and EditorGUILayout methods takes an optional "params GUILayoutOption[]" parameter. + Each time you call this, an array is allocated generating garbage. + + + // Generates garbage: + GUILayout.Label(label, GUILayout.Label(label, GUILayout.Width(20), GUILayout.ExpandHeight(), GUILayout.MaxWidth(300))); + + // Does not generate garbage: + GUILayout.Label(label, GUILayout.Label(label, GUILayoutOptions.Width(20).ExpandHeight().MaxWidth(300))); + + + + + + An EmptyGUIOption[] array with a length of 0. + + + + + A GUILayoutOptions instance with an implicit operator to be converted to a GUILayoutOption[] array. + + + + + + Gets or creates the cached GUILayoutOption array based on the layout options specified. + + + + + Option passed to a control to give it an absolute width. + + + + + Option passed to a control to give it an absolute height. + + + + + Option passed to a control to specify a maximum height. + + + + + Option passed to a control to specify a maximum width. + + + + + Option passed to a control to specify a minimum height. + + + + + Option passed to a control to specify a minimum width. + + + + + Option passed to a control to allow or disallow vertical expansion. + + + + + Option passed to a control to allow or disallow horizontal expansion. + + + + + Determines whether the instance is equals another instance. + + + + + Returns a hash code for this instance. + + + + + Option passed to a control to give it an absolute width. + + + + + Option passed to a control to give it an absolute height. + + + + + Option passed to a control to specify a maximum height. + + + + + Option passed to a control to specify a maximum width. + + + + + Option passed to a control to specify a minimum width. + + + + + Option passed to a control to specify a minimum height. + + + + + Option passed to a control to allow or disallow vertical expansion. + + + + + Option passed to a control to allow or disallow horizontal expansion. + + + + + Provides notification callbacks for values that are cached using the class. + + + + + Called when the cached value is freed. + + + + + Called when the cached value is claimed. + + + + + Immutable hashset wraps another hashset, and allows for reading the inner hashset, without the ability to change it. + + + + + Creates an immutable hashset around another hashset. + + + + + Returns true if the item is contained in the list. + + The item's value. + + + + Gets the enumerator. + + + + + Gets the enumerator. + + + + + Interface for immutable list. + + + + + Interface for generic immutable list. + + + + + Index accessor. + + + + + Immutable list wraps another list, and allows for reading the inner list, without the ability to change it. + + + + + Creates an immutable list around another list. + + + + + Number of items in the list. + + + + + Immutable list cannot be changed directly, so it's size is always fixed. + + + + + Immutable list are always readonly. + + + + + Returns true if the inner list is synchronized. + + + + + Gets the sync root object. + + + + + Index accessor. + + Index. + + + + Returns true if the item is contained in the list. + + The item's value. + + + + Copy the list to an array, + + Target array. + Index. + + + + Copy the list to an array, + + Target array. + Index. + + + + Gets an enumerator. + + + + + Get the index of a value. + + The item's value. + + + + Immutable list cannot be edited. + + Index. + + + + Immutable list cannot be edited. + + Index. + Item. + + + + Immutable list cannot be edited. + + Item. + + + + Immutable list cannot be edited. + + + + + Immutable list cannot be edited. + + Item. + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Immutable list wraps another list, and allows for reading the inner list, without the ability to change it. + + + + + Creates an immutable list around another list. + + + + + Number of items in the list. + + + + + Immutable list are always readonly. + + + + + Index accessor. + + Index. + + + + Returns true if the item is contained in the list. + + + + + Copies the list to an array. + + + + + Gets an enumerator. + + + + + Gets the index of an item. + + + + + Various list extension methods. + + + + + Increases or decrease the number of items in the list to the specified count. + + The list. + The new length. + + + + Increases or decrease the number of items in the list to the specified count. + + The list. + The new length. + Value of new elements. + + + + Increases or decrease the number of items in the list to the specified count. + + The list. + The new length. + + + + Increases or decrease the number of items in the list to the specified count. + + The list. + The new length. + Value of new elements. + + + + Collection of math function. + + + + + Distance from a point to a line. + + + + + Returns a smooth value between start and end based on t. + + First point. + Second point. + Position between 0 and 1. + + + + Returns a smooth value between start and end based on t. + + First point. + Second point. + Position between 0 and 1. + Number of interpolations to make. + + + + Returns the fractional of the value. + + The value to get the fractional of. + + + + Returns the fractional of the value. + + The value to get the fractional of. + + + + Returns the fractional of the value. + + The value to get the fractional of. + + + + Returns a value based on t, that bounces faster and faster. + + The value to bounce. + + + + Returns a smooth value between 0 and 1 based on t. + + Position between 0 and 1. + + + + Returns a smooth value between 0 and 1 based on t. + + Position between 0 and 1. + Number of interpolations to make. + + + + Returns an unclamped linear interpolation of two vectors. + + The first vector. + The second vector. + The interpolation factor. + + + + Returns an unclamped linear interpolation of two vectors. + + The first vector. + The second vector. + The interpolation factor. + + + + Returns a value that bounces between 0 and 1 based on value. + + The value to bounce. + + + + Returns a value that eases in elasticly. + + The value to ease in elasticly. + The amplitude. + The length. + + + + Pows each element of the vector. + + The vector. + The power. + + + + Returns a Vector2 with each element set to their respective sign. + + The vector to sign. + + + + Returns a Vector3 with each element set to their respective sign. + + The vector to sign. + + + + Returns a value that eases out elasticly. + + The value to ease out elasticly. + The amplitude. + The length. + + + + Returns a smooth value betweeen that peaks at t=0.5 and then comes back down again. + + A value between 0 and 1. + + + + Clamps the value of a Vector3. + + The vector to clamp. + The min value. + The max value. + + + + Clamps the value of a Vector2. + + The vector to clamp. + The min value. + The max value. + + + + Computes a hash for a byte array. + + The byte array. + + + + Gives a smooth path between a collection of points. + + The collection of point. + The current position in the path. 0 is at the start of the path, 1 is at the end of the path. + + + + Checks if two given lines intersect with one another and returns the intersection point (if + any) in an out parameter. + Source: http://stackoverflow.com/questions/3746274/line-intersection-with-aabb-rectangle. + Edited to implement Cohen-Sutherland type pruning for efficiency. + + Starting point of line a. + Ending point of line a. + Starting point of line b. + Ending point of line b. + + The out parameter which contains the intersection point if there was any. + + True if the two lines intersect, otherwise false. + + + + Returns the collision point between two infinite lines. + + + + + Distance from line to plane. + + Position of the plane. + Surface normal of the plane. + Origin of the line. + Line direction normal. + + + + Distance from ray to plane. + + The ray. + The plane. + + + + Rotates a Vector2 by an angle. + + The point to rotate. + The angle to rotate. + + + + Rotates a Vector2 around a point by an angle.. + + The point to rotate. + The point to rotate around. + The angle to rotate. + + + + Interpolates t between a and b to a value between 0 and 1 using a Hermite polynomial. + + The first value. + The second value. + The position value. + A smoothed value between 0 and 1. + + + + Interpolates t between a and b to a value between 0 and 1. + + The first value. + The second value. + The position value. + Linear value between 0 and 1. + + + + Wraps a value between min and max. + + The value to wrap. + The minimum value. + The maximum value. + + + + Wraps a value between min and max. + + The value to wrap. + The minimum value. + The maximum value. + + + + Wraps a value between min and max. + + The value to wrap. + The minimum value. + The maximum value. + + + + Rounds a number based on a mininum difference. + + The value to round. + The min difference. + The rounded value. + + + + Discards the least significant demicals. + + The value of insignificant decimals. + Value with significant decimals. + + + + Clamps and wraps an angle between two values. + + + + + Contains utilities for operating on arrays multi-dimentional arrays. + + + + + Inserts one column left of the specified column index. + + The type of the element. + Index of the column. + The array. + + + + Inserts one column right of the specified column index. + + The type of the element. + Index of the column. + The arr. + + + + Inserts one row above the specified row index. + + The type of the element. + The array. + The row index. + + + + Inserts one row below the specified row index. + + The type of the element. + The array. + Index of the row. + + + + Duplicates the column. + + The type of the element. + Index of the column. + The array. + + + + Duplicates the row. + + The type of the element. + The array. + Index of the row. + + + + Moves a column. + + The type of the element. + The array. + From column. + To column. + + + + Moves a row. + + The type of the element. + The array. + From row. + To row. + + + + Deletes a column. + + The type of the element. + The array. + Index of the column. + + + + Deletes the row. + + The type of the element. + The array. + Index of the row. + + + + Indicates a persistent assembly. + + + + + Provides a methods of representing imaginary fields which are unique to serialization. + + We aggregate the FieldInfo associated with this member and return a mangled form of the name. + + + + + + The default fake name separator string. + + + + + Initializes a new instance of the class. + + The field to alias. + The name prefix to use. + + + + Initializes a new instance of the class. + + The field to alias. + The name prefix to use. + The separator string to use. + + + + Gets the aliased field. + + + The aliased field. + + + + + Gets the module in which the type that declares the member represented by the current is defined. + + + + + Gets a value that identifies a metadata element. + + + + + Gets the name of the current member. + + + + + Gets the class that declares this member. + + + + + Gets the class object that was used to obtain this instance of MemberInfo. + + + + + Gets the type of the field. + + + The type of the field. + + + + + Gets a RuntimeFieldHandle, which is a handle to the internal metadata representation of a field. + + + + + Gets the attributes. + + + The attributes. + + + + + When overridden in a derived class, returns an array of all custom attributes applied to this member. + + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. + + + + + When overridden in a derived class, returns an array of custom attributes applied to this member and identified by . + + The type of attribute to search for. Only attributes that are assignable to this type are returned. + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to have been applied. + + + + + When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. + + The type of custom attribute to search for. The search includes derived types. + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + True if one or more instances of or any of its derived types is applied to this member; otherwise, false. + + + + + Gets the value of the field. + + The object instance to get the value from. + The value of the field. + + + + When overridden in a derived class, sets the value of the field supported by the given object. + + The object whose field value will be set. + The value to assign to the field. + A field of Binder that specifies the type of binding that is desired (for example, Binder.CreateInstance or Binder.ExactBinding). + A set of properties that enables the binding, coercion of argument types, and invocation of members through reflection. If is null, then Binder.DefaultBinding is used. + The software preferences of a particular culture. + + + + Provides a methods of representing aliased methods. + + In this case, what we're representing is a method on a parent class with the same name. + + We aggregate the MethodInfo associated with this member and return a mangled form of the name. + The name that we return is "parentname+methodName". + + + + + + The default fake name separator string. + + + + + Initializes a new instance of the class. + + The method to alias. + The name prefix to use. + + + + Initializes a new instance of the class. + + The method to alias. + The name prefix to use. + The separator string to use. + + + + Gets the aliased method. + + + The aliased method. + + + + + Gets the custom attributes for the return type. + + + + + Gets a handle to the internal metadata representation of a method. + + + + + Gets the attributes associated with this method. + + + + + Gets the class that declares this member. + + + + + Gets the name of the current member. + + + + + Gets the class object that was used to obtain this instance of MemberInfo. + + + + + When overridden in a derived class, returns the MethodInfo object for the method on the direct or indirect base class in which the method represented by this instance was first declared. + + + A MethodInfo object for the first implementation of this method. + + + + + When overridden in a derived class, returns an array of all custom attributes applied to this member. + + true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. + + + + + When overridden in a derived class, returns an array of custom attributes applied to this member and identified by . + + The type of attribute to search for. Only attributes that are assignable to this type are returned. + true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to have been applied. + + + + + When overridden in a derived class, returns the flags. + + + The MethodImplAttributes flags. + + + + + When overridden in a derived class, gets the parameters of the specified method or constructor. + + + An array of type ParameterInfo containing information that matches the signature of the method (or constructor) reflected by this MethodBase instance. + + + + + When overridden in a derived class, invokes the reflected method or constructor with the given parameters. + + The object on which to invoke the method or constructor. If a method is static, this argument is ignored. If a constructor is static, this argument must be null or an instance of the class that defines the constructor. + A bitmask that is a combination of 0 or more bit flags from . If is null, this parameter is assigned the value ; thus, whatever you pass in is ignored. + An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If is null, the default binder is used. + An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, this should be null.If the method or constructor represented by this instance takes a ByRef parameter, there is no special attribute required for that parameter in order to invoke the method or constructor using this function. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type. + An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. (This is necessary to convert a String that represents 1000 to a Double value, for example, since 1000 is represented differently by different cultures.) + + An Object containing the return value of the invoked method, or null in the case of a constructor, or null if the method's return type is void. Before calling the method or constructor, Invoke checks to see if the user has access permission and verifies that the parameters are valid.CautionElements of the array that represent parameters declared with the ref or out keyword may also be modified. + + + + + When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. + + The type of custom attribute to search for. The search includes derived types. + true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + true if one or more instances of or any of its derived types is applied to this member; otherwise, false. + + + + + Provides a methods of representing imaginary properties which are unique to serialization. + + We aggregate the PropertyInfo associated with this member and return a mangled form of the name. + + + + + + The default fake name separator string. + + + + + Initializes a new instance of the class. + + The property to alias. + The name prefix to use. + + + + Initializes a new instance of the class. + + The property to alias. + The name prefix to use. + The separator string to use. + + + + Not yet documented. + + + + + Gets the module in which the type that declares the member represented by the current is defined. + + + + + Gets a value that identifies a metadata element. + + + + + Gets the name of the current member. + + + + + Gets the class that declares this member. + + + + + Gets the class object that was used to obtain this instance of MemberInfo. + + + + + Gets the type of the property. + + + The type of the property. + + + + + Gets the attributes. + + + The attributes. + + + + + Gets a value indicating whether this instance can read. + + + true if this instance can read; otherwise, false. + + + + + Gets a value indicating whether this instance can write. + + + true if this instance can write; otherwise, false. + + + + + When overridden in a derived class, returns an array of all custom attributes applied to this member. + + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. + + + + + When overridden in a derived class, returns an array of custom attributes applied to this member and identified by . + + The type of attribute to search for. Only attributes that are assignable to this type are returned. + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to have been applied. + + + + + When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. + + The type of custom attribute to search for. The search includes derived types. + True to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks. + + True if one or more instances of or any of its derived types is applied to this member; otherwise, false. + + + + + Returns an array whose elements reflect the public and, if specified, non-public get, set, and other accessors of the property reflected by the current instance. + + Indicates whether non-public methods should be returned in the MethodInfo array. true if non-public methods are to be included; otherwise, false. + + An array of objects whose elements reflect the get, set, and other accessors of the property reflected by the current instance. If is true, this array contains public and non-public get, set, and other accessors. If is false, this array contains only public get, set, and other accessors. If no accessors with the specified visibility are found, this method returns an array with zero (0) elements. + + + + + When overridden in a derived class, returns the public or non-public get accessor for this property. + + Indicates whether a non-public get accessor should be returned. true if a non-public accessor is to be returned; otherwise, false. + + A MethodInfo object representing the get accessor for this property, if is true. Returns null if is false and the get accessor is non-public, or if is true but no get accessors exist. + + + + + Gets the index parameters of the property. + + The index parameters of the property. + + + + When overridden in a derived class, returns the set accessor for this property. + + Indicates whether the accessor should be returned if it is non-public. true if a non-public accessor is to be returned; otherwise, false. + + Value Condition A object representing the Set method for this property. The set accessor is public.-or- is true and the set accessor is non-public. null is true, but the property is read-only.-or- is false and the set accessor is non-public.-or- There is no set accessor. + + + + + Gets the value of the property on the given instance. + + The object to invoke the getter on. + The to invoke with. + The binder to use. + The indices to use. + The culture to use. + The value of the property on the given instance. + + + + Sets the value of the property on the given instance. + + The object to set the value on. + The value to set. + The to invoke with. + The binder to use. + The indices to use. + The culture to use. + + + + Paths to Sirenix assets. + + + + + Path to Odin Inspector folder. + + + + + Path to Sirenix assets folder. + + + + + Path to Sirenix folder. + + + + + Path to Sirenix assemblies. + + + + + Path to Odin Inspector resources folder. + + + + + Path to Odin Inspector configuration folder. + + + + + Path to Odin Inspector resources configuration folder. + + + + + Path to Odin Inspector temporary folder. + + + + + This attribute is used by classes deriving from GlobalConfig and specifies the menu item path for the preference window and the asset path for the generated config file. + The scriptable object created will be located at the OdinEditorConfigs path unless other is specified. + Classes implementing this attribute will be part of the Odin Preferences window. + + + + + + Initializes a new instance of the class. + + + + + This attribute is used by classes deriving from GlobalConfig and specifies the menu item path for the preference window and the asset path for the generated config file. + The scriptable object created will be located at the OdinResourcesConigs path unless other is specified. + Classes implementing this attribute will be part of the Odin Preferences window. + + + + + + Initializes a new instance of the class. + + + + + Not yet documented. + + + + + Not yet documented. + + Not yet documented. + Not yet documented. + Not yet documented. + + + + Utility class indicating current Unity version. + + + + + Tests current Unity version is equal or greater. + + Minimum major version. + Minimum minor version. + true if the current Unity version is greater. Otherwise false. + + + + The current Unity version major. + + + + + The current Unity version minor. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Not yet documented. + + + + + Compares objects by reference only, ignoring equality operators completely. This is used by the property tree reference dictionaries to keep track of references. + + + + + A default, cached instance of this generic variant of the reference equality comparer. + + + + + Returns true if the object references are equal. + + + + + Returns the result of the object's own GetHashCode method. + + + + diff --git a/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml.meta b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml.meta new file mode 100644 index 00000000..18706fff --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.xml.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bb7d18e523d476c45b721e67289734c3 +timeCreated: 1602076756 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Assemblies/link.xml b/Assets/Plugins/Sirenix/Assemblies/link.xml new file mode 100644 index 00000000..06177f92 --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/link.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Assemblies/link.xml.meta b/Assets/Plugins/Sirenix/Assemblies/link.xml.meta new file mode 100644 index 00000000..5878387a --- /dev/null +++ b/Assets/Plugins/Sirenix/Assemblies/link.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4c8463be289381f4b8d730cc983a131b +timeCreated: 1571835978 +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Demos.meta b/Assets/Plugins/Sirenix/Demos.meta new file mode 100644 index 00000000..ba5cc039 --- /dev/null +++ b/Assets/Plugins/Sirenix/Demos.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 30565587d2ea3b84b9f31b6f9213a807 +folderAsset: yes +timeCreated: 1602083738 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage b/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage new file mode 100644 index 00000000..a8d21c6b Binary files /dev/null and b/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage differ diff --git a/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta b/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta new file mode 100644 index 00000000..27457c09 --- /dev/null +++ b/Assets/Plugins/Sirenix/Demos/Custom Attribute Processors.unitypackage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ccd2ae876282227488a6c1e335904f22 +timeCreated: 1602076792 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage b/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage new file mode 100644 index 00000000..25f25175 Binary files /dev/null and b/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage differ diff --git a/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta b/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta new file mode 100644 index 00000000..9291bca1 --- /dev/null +++ b/Assets/Plugins/Sirenix/Demos/Custom Drawers.unitypackage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea4fae6603f2a964c8085d00543ee0b9 +timeCreated: 1602076792 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage b/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage new file mode 100644 index 00000000..d4a35522 Binary files /dev/null and b/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage differ diff --git a/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta b/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta new file mode 100644 index 00000000..0974acfc --- /dev/null +++ b/Assets/Plugins/Sirenix/Demos/Editor Windows.unitypackage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7c30d61445ad3d34eafd75cb8aec2d6f +timeCreated: 1602076793 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage b/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage new file mode 100644 index 00000000..8210d86c Binary files /dev/null and b/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage differ diff --git a/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta b/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta new file mode 100644 index 00000000..0555365a --- /dev/null +++ b/Assets/Plugins/Sirenix/Demos/Sample - RPG Editor.unitypackage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c964591b6981ab4448197de87e5aa472 +timeCreated: 1602076794 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector.meta b/Assets/Plugins/Sirenix/Odin Inspector.meta new file mode 100644 index 00000000..c2984cc5 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 95bb668fca197464e9eef82fa5dfa3f4 +folderAsset: yes +timeCreated: 1602083738 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Assets.meta b/Assets/Plugins/Sirenix/Odin Inspector/Assets.meta new file mode 100644 index 00000000..5f844bcc --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Assets.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 417783ef8cf45034fb2abd6d7bddeb49 +folderAsset: yes +timeCreated: 1602083739 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor.meta b/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor.meta new file mode 100644 index 00000000..367057da --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6a4bacb88ad38904f94fce909ff35536 +folderAsset: yes +timeCreated: 1602083739 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Odin Inspector Logo.png b/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Odin Inspector Logo.png new file mode 100644 index 00000000..4b639dfc Binary files /dev/null and b/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Odin Inspector Logo.png differ diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Odin Inspector Logo.png.meta b/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Odin Inspector Logo.png.meta new file mode 100644 index 00000000..be9083b7 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/Odin Inspector Logo.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: a78bffbeb81b48ae9ec71ad7969613e5 +timeCreated: 1493397482 +licenseType: Store +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 1 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 16 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 5 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset b/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset new file mode 100644 index 00000000..44e44883 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset @@ -0,0 +1,13 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -262940062, guid: a4865f1ab4504ed8a368670db22f409c, type: 3} + m_Name: OdinPathLookup + m_EditorClassIdentifier: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset.meta b/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset.meta new file mode 100644 index 00000000..8630ea77 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Assets/Editor/OdinPathLookup.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 08379ccefc05200459f90a1c0711a340 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config.meta new file mode 100644 index 00000000..85aa7232 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cd9c61df7366004498f560b73d4247df +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor.meta new file mode 100644 index 00000000..16648888 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 63d01f8bbf7becf49802e2a87b27e625 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset new file mode 100644 index 00000000..5119601d --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset @@ -0,0 +1,14 @@ +%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: -645759843, guid: a4865f1ab4504ed8a368670db22f409c, type: 3} + m_Name: GeneralDrawerConfig + m_EditorClassIdentifier: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset.meta new file mode 100644 index 00000000..967cfba3 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/GeneralDrawerConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 89b65d57b1ee1954e9db81a5a7fe02c9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset new file mode 100644 index 00000000..5b650431 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset @@ -0,0 +1,19 @@ +%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: 1137305049, guid: a4865f1ab4504ed8a368670db22f409c, type: 3} + m_Name: InspectorConfig + m_EditorClassIdentifier: + enableOdinInInspector: 1 + defaultEditorBehaviour: 11 + processMouseMoveInInspector: 1 + drawingConfig: + configs: [] diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset.meta new file mode 100644 index 00000000..86597125 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/InspectorConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dc7c666c84bbc6842ae20eaaa16d5ada +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset new file mode 100644 index 00000000..40135aa3 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset @@ -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: -228747253, guid: a4865f1ab4504ed8a368670db22f409c, type: 3} + m_Name: OdinModuleConfig + m_EditorClassIdentifier: + configurations: [] + ModuleTogglingSettings: 0 + ModuleUpdateSettings: 0 diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset.meta new file mode 100644 index 00000000..1d18d312 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/OdinModuleConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c18eaf18806a25941aa9bdbe3944234e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources.meta new file mode 100644 index 00000000..8ffb49af --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cf0e02580206fb347b5a93712422457a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix.meta new file mode 100644 index 00000000..ade1ab06 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 11c867ae4a5887d4d94e03b8f22656e9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset new file mode 100644 index 00000000..0e48b68b --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset @@ -0,0 +1,22 @@ +%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: 1549551891, guid: 74721b9f0af448f5ae2e91102a1a5edd, type: 3} + m_Name: GlobalSerializationConfig + m_EditorClassIdentifier: + HideSerializationCautionaryMessage: 0 + HidePrefabCautionaryMessage: 0 + HideOdinSerializeAttributeWarningMessages: 0 + HideNonSerializedShowInInspectorWarningMessages: 0 + buildSerializationFormat: 0 + editorSerializationFormat: 2 + loggingPolicy: 0 + errorHandlingPolicy: 0 diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset.meta new file mode 100644 index 00000000..0ea55685 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53ff0a085acd6424b8fe462e4118a673 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules.meta new file mode 100644 index 00000000..800ef1a0 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8978eac9d11c2824b89709f9cac45504 +folderAsset: yes +timeCreated: 1602083739 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data new file mode 100644 index 00000000..626ce70d Binary files /dev/null and b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data differ diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data.meta new file mode 100644 index 00000000..a5f9701c --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Entities.data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 728df0e3465c1a148b83053a3f31d489 +timeCreated: 1573836981 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data new file mode 100644 index 00000000..9ebcaa88 Binary files /dev/null and b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data differ diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data.meta b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data.meta new file mode 100644 index 00000000..cc09326c --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Modules/Unity.Mathematics.data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4866e740a22eb1e49b1603b051e4d92c +timeCreated: 1573836980 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts.meta new file mode 100644 index 00000000..206f0859 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 92ea4518d6ddba64e9ffc990b334ebdf +folderAsset: yes +timeCreated: 1602083739 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor.meta new file mode 100644 index 00000000..809832d1 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 51d97d64dbac6434cbb39359e4346f89 +folderAsset: yes +timeCreated: 1602083739 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/AssemblyImportSettingsAutomation.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/AssemblyImportSettingsAutomation.cs new file mode 100644 index 00000000..5722a91e --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/AssemblyImportSettingsAutomation.cs @@ -0,0 +1,134 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && UNITY_5_6_OR_NEWER + +namespace Sirenix.OdinInspector.Editor +{ + using System.IO; + using System.Collections.Generic; + using Sirenix.Serialization.Utilities.Editor; + using Sirenix.Utilities; + using UnityEditor; + using UnityEditor.Build; + +#if UNITY_2018_1_OR_NEWER + using UnityEditor.Build.Reporting; +#endif + + public class AssemblyImportSettingsAutomation : +#if UNITY_2018_1_OR_NEWER + IPreprocessBuildWithReport +#else + IPreprocessBuild +#endif + { + + public int callbackOrder { get { return -1500; } } + + private static void ConfigureImportSettings() + { + if (EditorOnlyModeConfig.Instance.IsEditorOnlyModeEnabled() || ImportSettingsConfig.Instance.AutomateBeforeBuild == false) + { + return; + } + + var assemblyDir = new DirectoryInfo(SirenixAssetPaths.SirenixAssembliesPath).FullName; + var projectAssetsPath = Directory.GetCurrentDirectory().TrimEnd('\\', '/'); + + var isPackage = PathUtilities.HasSubDirectory(new DirectoryInfo(projectAssetsPath), new DirectoryInfo(assemblyDir)) == false; + + var aotDirPath = assemblyDir + "NoEmitAndNoEditor/"; + var jitDirPath = assemblyDir + "NoEditor/"; + + var aotDir = new DirectoryInfo(aotDirPath); + var jitDir = new DirectoryInfo(jitDirPath); + + var aotAssemblies = new List(); + var jitAssemblies = new List(); + + foreach (var file in aotDir.GetFiles("*.dll")) + { + string path = file.FullName; + if (isPackage) + { + path = SirenixAssetPaths.SirenixAssembliesPath.TrimEnd('\\', '/') + "/" + path.Substring(assemblyDir.Length); + } + else + { + path = path.Substring(projectAssetsPath.Length + 1); + } + + aotAssemblies.Add(path); + } + + foreach (var file in jitDir.GetFiles("*.dll")) + { + string path = file.FullName; + if (isPackage) + { + path = SirenixAssetPaths.SirenixAssembliesPath.TrimEnd('\\', '/') + "/" + path.Substring(assemblyDir.Length); + } + else + { + path = path.Substring(projectAssetsPath.Length + 1); + } + + jitAssemblies.Add(path); + } + + AssetDatabase.StartAssetEditing(); + try + { + var platform = EditorUserBuildSettings.activeBuildTarget; + + if (AssemblyImportSettingsUtilities.IsJITSupported( + platform, + AssemblyImportSettingsUtilities.GetCurrentScriptingBackend(), + AssemblyImportSettingsUtilities.GetCurrentApiCompatibilityLevel())) + { + ApplyImportSettings(platform, aotAssemblies.ToArray(), OdinAssemblyImportSettings.ExcludeFromAll); + ApplyImportSettings(platform, jitAssemblies.ToArray(), OdinAssemblyImportSettings.IncludeInBuildOnly); + } + else + { + ApplyImportSettings(platform, aotAssemblies.ToArray(), OdinAssemblyImportSettings.IncludeInBuildOnly); + ApplyImportSettings(platform, jitAssemblies.ToArray(), OdinAssemblyImportSettings.ExcludeFromAll); + } + } + finally + { + AssetDatabase.StopAssetEditing(); + } + } + + private static void ApplyImportSettings(BuildTarget platform, string[] assemblyPaths, OdinAssemblyImportSettings importSettings) + { + for (int i = 0; i < assemblyPaths.Length; i++) + { + AssemblyImportSettingsUtilities.SetAssemblyImportSettings(platform, assemblyPaths[i], importSettings); + } + } + +#if UNITY_2018_1_OR_NEWER + + void IPreprocessBuildWithReport.OnPreprocessBuild(BuildReport report) + { + ConfigureImportSettings(); + } + +#else + + void IPreprocessBuild.OnPreprocessBuild(BuildTarget target, string path) + { + ConfigureImportSettings(); + } + +#endif + } +} + +#endif // UNITY_EDITOR && UNITY_5_6_OR_NEWER \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/AssemblyImportSettingsAutomation.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/AssemblyImportSettingsAutomation.cs.meta new file mode 100644 index 00000000..55dc9d8e --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/AssemblyImportSettingsAutomation.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d4d815a2bfd253342bfd6542c08315fb +timeCreated: 1533296750 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/BuildAOTAutomation.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/BuildAOTAutomation.cs new file mode 100644 index 00000000..c4ec6f45 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/BuildAOTAutomation.cs @@ -0,0 +1,79 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && UNITY_5_6_OR_NEWER + +namespace Sirenix.Serialization.Internal +{ + using Sirenix.Serialization; + using UnityEditor; + using UnityEditor.Build; + using System.IO; + using System; + +#if UNITY_2018_1_OR_NEWER + + using UnityEditor.Build.Reporting; + +#endif + +#if UNITY_2018_1_OR_NEWER + public class PreBuildAOTAutomation : IPreprocessBuildWithReport +#else + public class PreBuildAOTAutomation : IPreprocessBuild +#endif + { + public int callbackOrder { get { return -1000; } } + + public void OnPreprocessBuild(BuildTarget target, string path) + { + if (AOTGenerationConfig.Instance.ShouldAutomationGeneration(target)) + { + AOTGenerationConfig.Instance.ScanProject(); + AOTGenerationConfig.Instance.GenerateDLL(); + } + } + +#if UNITY_2018_1_OR_NEWER + + public void OnPreprocessBuild(BuildReport report) + { + this.OnPreprocessBuild(report.summary.platform, report.summary.outputPath); + } + +#endif + } + +#if UNITY_2018_1_OR_NEWER + public class PostBuildAOTAutomation : IPostprocessBuildWithReport +#else + public class PostBuildAOTAutomation : IPostprocessBuild +#endif + { + public int callbackOrder { get { return -1000; } } + + public void OnPostprocessBuild(BuildTarget target, string path) + { + if (AOTGenerationConfig.Instance.DeleteDllAfterBuilds && AOTGenerationConfig.Instance.ShouldAutomationGeneration(target)) + { + Directory.Delete(AOTGenerationConfig.Instance.AOTFolderPath, true); + File.Delete(AOTGenerationConfig.Instance.AOTFolderPath.TrimEnd('/', '\\') + ".meta"); + AssetDatabase.Refresh(); + } + } + +#if UNITY_2018_1_OR_NEWER + + public void OnPostprocessBuild(BuildReport report) + { + this.OnPostprocessBuild(report.summary.platform, report.summary.outputPath); + } + +#endif + } +} + +#endif // UNITY_EDITOR && UNITY_5_6_OR_NEWER \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/BuildAOTAutomation.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/BuildAOTAutomation.cs.meta new file mode 100644 index 00000000..b7bf4433 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/BuildAOTAutomation.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: dd3672808cdf76541aa3d383c87a5616 +timeCreated: 1514538277 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/EnsureOdinInspectorDefine.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/EnsureOdinInspectorDefine.cs new file mode 100644 index 00000000..be82f389 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/EnsureOdinInspectorDefine.cs @@ -0,0 +1,121 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR + +namespace Sirenix.Utilities +{ + using System; + using System.Linq; + using UnityEditor; + + /// + /// Defines the ODIN_INSPECTOR symbol. + /// + internal static class EnsureOdinInspectorDefine + { + private static readonly string[] DEFINES = new string[] { "ODIN_INSPECTOR", "ODIN_INSPECTOR_3" }; + + [InitializeOnLoadMethod] + private static void EnsureScriptingDefineSymbol() + { + var currentTarget = EditorUserBuildSettings.selectedBuildTargetGroup; + + if (currentTarget == BuildTargetGroup.Unknown) + { + return; + } + + var definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(currentTarget).Trim(); + var defines = definesString.Split(';'); + + bool changed = false; + + foreach (var define in DEFINES) + { + if (defines.Contains(define) == false) + { + if (definesString.EndsWith(";", StringComparison.InvariantCulture) == false) + { + definesString += ";"; + } + + definesString += define; + changed = true; + } + } + + if (changed) + { + PlayerSettings.SetScriptingDefineSymbolsForGroup(currentTarget, definesString); + } + } + } + + // + // If you have a project where only some users have Odin, and you want to utilize the ODIN_INSPECTOR + // define symbol. Then, in order to only define the symbol for those with Odin, you can delete this script, + // which prevent ODIN_INSPECTOR from being added to the Unity's player settings. + // + // And instead automatically add the ODIN_INSPECTOR define to an mcs.rsp file if Odin exists using the script below. + // You can then ignore the mcs.rsp file in source control. + // + // Remember to manually remove the ODIN_INSPECTOR define symbol in player settings after removing this script. + // + // static class AddOdinInspectorDefineIfOdinExist + // { + // private const string ODIN_MCS_DEFINE = "-define:ODIN_INSPECTOR"; + // + // [InitializeOnLoadMethod] + // private static void AddOrRemoveOdinDefine() + // { + // var addDefine = AppDomain.CurrentDomain.GetAssemblies().Any(x => x.FullName.StartsWith("Sirenix.OdinInspector.Editor")); + // + // #if ODIN_INSPECTOR + // var hasDefine = true; + // #else + // var hasDefine = false; + // #endif + // + // if (addDefine == hasDefine) + // { + // return; + // } + // + // var mcsPath = Path.Combine(Application.dataPath, "mcs.rsp"); + // var hasMcsFile = File.Exists(mcsPath); + // + // if (addDefine) + // { + // var lines = hasMcsFile ? File.ReadAllLines(mcsPath).ToList() : new List(); + // if (!lines.Any(x => x.Trim() == ODIN_MCS_DEFINE)) + // { + // lines.Add(ODIN_MCS_DEFINE); + // File.WriteAllLines(mcsPath, lines.ToArray()); + // AssetDatabase.Refresh(); + // } + // } + // else if (hasMcsFile) + // { + // var linesWithoutOdinDefine = File.ReadAllLines(mcsPath).Where(x => x.Trim() != ODIN_MCS_DEFINE).ToArray(); + // + // if (linesWithoutOdinDefine.Length == 0) + // { + // // Optional - Remove the mcs file instead if it doesn't contain any lines. + // File.Delete(mcsPath); + // } + // else + // { + // File.WriteAllLines(mcsPath, linesWithoutOdinDefine); + // } + // + // AssetDatabase.Refresh(); + // } + // } + // } +} + +#endif // UNITY_EDITOR \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/EnsureOdinInspectorDefine.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/EnsureOdinInspectorDefine.cs.meta new file mode 100644 index 00000000..1ab8a33d --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/EnsureOdinInspectorDefine.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d9763cb398cf6e146b74d6b7bac2fe50 +timeCreated: 1519909294 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/FixBrokenUnityObjectWrapperDrawer.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/FixBrokenUnityObjectWrapperDrawer.cs new file mode 100644 index 00000000..1f30e4e2 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/FixBrokenUnityObjectWrapperDrawer.cs @@ -0,0 +1,208 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && UNITY_2018_3_OR_NEWER +#pragma warning disable + +namespace Sirenix.OdinInspector.Editor.Drawers +{ + using Sirenix.OdinInspector; + using Sirenix.OdinInspector.Editor; + using Sirenix.Utilities; + using Sirenix.Utilities.Editor; + using System.Linq; + using UnityEditor; + using UnityEngine; + + [DrawerPriority(0.001, 0, 0)] + public class FixBrokenUnityObjectWrapperDrawer : OdinValueDrawer, IDefinesGenericMenuItems + where T : UnityEngine.Component + { + private const string AUTO_FIX_PREFS_KEY = "TemporarilyBrokenUnityObjectWrapperDrawer.autoFix"; + + private bool isBroken = false; + private T realWrapperInstance; + private bool allowSceneViewObjects; + private static bool autoFix; + + protected override void Initialize() + { + this.allowSceneViewObjects = this.ValueEntry.Property.GetAttribute() == null; + autoFix = EditorPrefs.HasKey(AUTO_FIX_PREFS_KEY); + } + + protected override void DrawPropertyLayout(GUIContent label) + { + if (!(this.ValueEntry.ValueState == PropertyValueState.NullReference || this.ValueEntry.ValueState == PropertyValueState.ReferenceValueConflict)) + { + this.CallNextDrawer(label); + return; + } + + if (Event.current.type == EventType.Layout) + { + this.isBroken = false; + var count = this.ValueEntry.ValueCount; + for (int i = 0; i < count; i++) + { + var component = this.ValueEntry.Values[i]; + + if (ComponentIsBroken(component, ref this.realWrapperInstance)) + { + this.isBroken = true; + break; + } + } + + if (this.isBroken && autoFix) + { + this.isBroken = false; + + for (int i = 0; i < this.ValueEntry.ValueCount; i++) + { + T fixedComponent = null; + if (ComponentIsBroken(this.ValueEntry.Values[i], ref fixedComponent) && fixedComponent) + { + (this.ValueEntry as IValueEntryActualValueSetter).SetActualValue(i, fixedComponent); + } + } + + this.ValueEntry.Update(); + } + } + + if (!this.isBroken) + { + this.CallNextDrawer(label); + return; + } + + var rect = EditorGUILayout.GetControlRect(label != null); + var btnRect = rect.AlignRight(20); + var controlRect = rect.SetXMax(btnRect.xMin - 5); + + object newInstance = null; + + EditorGUI.BeginChangeCheck(); + { + if (this.ValueEntry.BaseValueType.IsInterface) + { + newInstance = SirenixEditorFields.PolymorphicObjectField(controlRect, + label, + this.realWrapperInstance, + this.ValueEntry.BaseValueType, + this.allowSceneViewObjects); + } + else + { + newInstance = SirenixEditorFields.UnityObjectField( + controlRect, + label, + this.realWrapperInstance, + this.ValueEntry.BaseValueType, + this.allowSceneViewObjects) as Component; + } + } + if (EditorGUI.EndChangeCheck()) + { + this.ValueEntry.WeakSmartValue = newInstance; + } + + if (GUI.Button(btnRect, " ", EditorStyles.miniButton)) + { + var popup = new FixBrokenUnityObjectWrapperPopup(this.ValueEntry); + OdinEditorWindow.InspectObjectInDropDown(popup, 300); + } + + if (Event.current.type == EventType.Repaint) + { + GUI.DrawTexture(btnRect, EditorIcons.ConsoleWarnicon, ScaleMode.ScaleToFit); + } + } + + private static bool ComponentIsBroken(T component, ref T realInstance) + { + var uObj = component; + var oObj = (object)uObj; + + if (oObj != null && uObj == null) + { + var instanceId = uObj.GetInstanceID(); + if (AssetDatabase.Contains(instanceId)) + { + var path = AssetDatabase.GetAssetPath(instanceId); + var realWrapper = AssetDatabase.LoadAllAssetsAtPath(path).FirstOrDefault(n => n.GetInstanceID() == instanceId) as T; + if (realWrapper) + { + realInstance = realWrapper; + return true; + } + } + } + + return false; + } + + public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu) + { + if (EditorPrefs.HasKey(AUTO_FIX_PREFS_KEY)) + { + genericMenu.AddItem(new GUIContent("Disable auto-fix of broken prefab instance references"), false, (x) => + { + EditorPrefs.DeleteKey(AUTO_FIX_PREFS_KEY); + autoFix = false; + }, null); + } + } + + [TypeInfoBox("This asset reference is temporarily broken until the next reload, because of an error in Unity where the C# wrapper object of a prefab asset is destroyed when changes are made to that prefab asset. This error has been reported to Unity.\n\nMeanwhile, Odin can fix this for you by getting a new, valid wrapper object from the asset database and replacing the broken wrapper instance with the new one.")] + private class FixBrokenUnityObjectWrapperPopup + { + private IPropertyValueEntry valueEntry; + + public FixBrokenUnityObjectWrapperPopup(IPropertyValueEntry valueEntry) + { + this.valueEntry = valueEntry; + } + + [HorizontalGroup, Button(ButtonSizes.Large)] + public void FixItThisTime() + { + for (int i = 0; i < this.valueEntry.ValueCount; i++) + { + var localI = i; + T fixedComponent = null; + if (ComponentIsBroken(this.valueEntry.Values[i], ref fixedComponent) && fixedComponent) + { + this.valueEntry.Property.Tree.DelayActionUntilRepaint(() => + { + (this.valueEntry as IValueEntryActualValueSetter).SetActualValue(localI, fixedComponent); + }); + } + } + + if (GUIHelper.CurrentWindow) + { + EditorApplication.delayCall += GUIHelper.CurrentWindow.Close; + } + } + + [HorizontalGroup, Button(ButtonSizes.Large)] + public void FixItAlways() + { + EditorPrefs.SetBool(AUTO_FIX_PREFS_KEY, true); + autoFix = true; + + if (GUIHelper.CurrentWindow) + { + EditorApplication.delayCall += GUIHelper.CurrentWindow.Close; + } + } + } + } +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/FixBrokenUnityObjectWrapperDrawer.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/FixBrokenUnityObjectWrapperDrawer.cs.meta new file mode 100644 index 00000000..f5f98bf8 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/FixBrokenUnityObjectWrapperDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 903c11a9cf3ba6f4e8c653443c6893a0 +timeCreated: 1546967292 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Sirenix.OdinInspector.CompatibilityLayer.Editor.asmdef b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Sirenix.OdinInspector.CompatibilityLayer.Editor.asmdef new file mode 100644 index 00000000..69efdd76 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Sirenix.OdinInspector.CompatibilityLayer.Editor.asmdef @@ -0,0 +1,13 @@ +{ + "name": "Sirenix.OdinInspector.CompatibilityLayer.Editor", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": true, + "autoReferenced": true, + "overrideReferences": false, + "precompiledReferences": [], + "defineConstraints": [] +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Sirenix.OdinInspector.CompatibilityLayer.Editor.asmdef.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Sirenix.OdinInspector.CompatibilityLayer.Editor.asmdef.meta new file mode 100644 index 00000000..3c2621de --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Sirenix.OdinInspector.CompatibilityLayer.Editor.asmdef.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e35af134b1b987743b8a6b5f438e9407 +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncListDrawer.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncListDrawer.cs new file mode 100644 index 00000000..a4d00d8b --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncListDrawer.cs @@ -0,0 +1,88 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && !UNITY_2019_1_OR_NEWER +#pragma warning disable 0618 + +namespace Sirenix.OdinInspector.Editor.Drawers +{ + using Sirenix.Utilities.Editor; + using UnityEditor; + using UnityEngine; + using UnityEngine.Networking; + + /// + /// SyncList property drawer. + /// + [DrawerPriority(0, 0, 2)] + public class SyncListDrawer : OdinValueDrawer where TList : SyncList + { + private LocalPersistentContext visible; + + protected override void Initialize() + { + this.visible = this.Property.Context.GetPersistent(this, "expanded", GeneralDrawerConfig.Instance.OpenListsByDefault); + } + + /// + /// Draws the property. + /// + protected override void DrawPropertyLayout(GUIContent label) + { + var entry = this.ValueEntry; + var property = entry.Property; + int minCount = int.MaxValue; + int maxCount = 0; + + for (int i = 0; i < entry.ValueCount; i++) + { + if (entry.Values[i].Count > maxCount) + { + maxCount = entry.Values[i].Count; + } + + if (entry.Values[i].Count < minCount) + { + minCount = entry.Values[i].Count; + } + } + + SirenixEditorGUI.BeginHorizontalToolbar(); + this.visible.Value = SirenixEditorGUI.Foldout(this.visible.Value, GUIHelper.TempContent("SyncList " + label.text + " [" + typeof(TList).Name + "]")); + EditorGUILayout.LabelField(GUIHelper.TempContent(minCount == maxCount ? (minCount == 0 ? "Empty" : minCount + " items") : minCount + " (" + maxCount + ") items"), SirenixGUIStyles.RightAlignedGreyMiniLabel); + SirenixEditorGUI.EndHorizontalToolbar(); + + if (SirenixEditorGUI.BeginFadeGroup(this.visible, this.visible.Value)) + { + GUIHelper.PushGUIEnabled(false); + SirenixEditorGUI.BeginVerticalList(); + { + var elementLabel = new GUIContent(); + for (int i = 0; i < maxCount; i++) + { + SirenixEditorGUI.BeginListItem(); + elementLabel.text = "Item " + i; + + if (i < minCount) + { + property.Children[i].Draw(elementLabel); + } + else + { + EditorGUILayout.LabelField(elementLabel, SirenixEditorGUI.MixedValueDashChar); + } + SirenixEditorGUI.EndListItem(); + } + } + SirenixEditorGUI.EndVerticalList(); + GUIHelper.PopGUIEnabled(); + } + SirenixEditorGUI.EndFadeGroup(); + } + } +} + +#endif // UNITY_EDITOR && !UNITY_2019_1_OR_NEWER \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncListDrawer.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncListDrawer.cs.meta new file mode 100644 index 00000000..7db195d1 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncListDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 047c7e4af9c032a428c12b7c564a6593 +timeCreated: 1545410615 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs new file mode 100644 index 00000000..02d7d1d9 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs @@ -0,0 +1,42 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && !UNITY_2019_1_OR_NEWER +#pragma warning disable 0618 + +namespace Sirenix.OdinInspector.Editor.Drawers +{ + using Sirenix.Utilities; + using UnityEditor; + using UnityEngine; + using UnityEngine.Networking; + + /// + /// SyncVar attribute drawer. + /// + public class SyncVarAttributeDrawer : OdinAttributeDrawer + { + /// + /// Draws the property. + /// + protected override void DrawPropertyLayout(GUIContent label) + { + GUILayout.BeginHorizontal(); + { + GUILayout.BeginVertical(); + { + this.CallNextDrawer(label); + } + GUILayout.EndVertical(); + + GUILayout.Label("SyncVar", EditorStyles.miniLabel, GUILayoutOptions.Width(52f)); + } + GUILayout.EndHorizontal(); + } + } +} + +#endif // UNITY_EDITOR && !UNITY_2019_1_OR_NEWER \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs.meta new file mode 100644 index 00000000..14f30448 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/SyncVarAttributeDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bda5b631304c8cb4485d60ef8bda618b +timeCreated: 1545410615 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Vector2IntMinMaxAttributeDrawer.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Vector2IntMinMaxAttributeDrawer.cs new file mode 100644 index 00000000..f70613f9 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Vector2IntMinMaxAttributeDrawer.cs @@ -0,0 +1,73 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && UNITY_2017_2_OR_NEWER + +namespace Sirenix.OdinInspector.Editor.Drawers +{ + using Sirenix.OdinInspector; + using Sirenix.OdinInspector.Editor; + using Sirenix.OdinInspector.Editor.ValueResolvers; + using Sirenix.Utilities; + using Sirenix.Utilities.Editor; + using System.Reflection; + using UnityEditor; + using UnityEngine; + + /// + /// Draws Vector2Int properties marked with . + /// + public class Vector2IntMinMaxAttributeDrawer : OdinAttributeDrawer + { + private ValueResolver minGetter; + private ValueResolver maxGetter; + private ValueResolver vector2IntMinMaxGetter; + + /// + /// Initializes the drawer by resolving any optional references to members for min/max value. + /// + protected override void Initialize() + { + // Min member reference. + this.minGetter = ValueResolver.Get(this.Property, this.Attribute.MinValueGetter, this.Attribute.MinValue); + this.maxGetter = ValueResolver.Get(this.Property, this.Attribute.MaxValueGetter, this.Attribute.MaxValue); + + // Min max member reference. + if (this.Attribute.MinMaxValueGetter != null) + { + this.vector2IntMinMaxGetter = ValueResolver.Get(this.Property, this.Attribute.MinMaxValueGetter); + } + } + + /// + /// Draws the property. + /// + protected override void DrawPropertyLayout(GUIContent label) + { + ValueResolver.DrawErrors(this.minGetter, this.maxGetter, this.vector2IntMinMaxGetter); + + // Get the range of the slider from the attribute or from member references. + Vector2 range; + if (this.vector2IntMinMaxGetter != null && !this.vector2IntMinMaxGetter.HasError) + { + range = (Vector2)this.vector2IntMinMaxGetter.GetValue(); + } + else + { + range.x = this.minGetter.GetValue(); + range.y = this.maxGetter.GetValue(); + } + + EditorGUI.BeginChangeCheck(); + Vector2 value = SirenixEditorFields.MinMaxSlider(label, (Vector2)this.ValueEntry.SmartValue, range, this.Attribute.ShowFields); + if (EditorGUI.EndChangeCheck()) + { + this.ValueEntry.SmartValue = new Vector2Int((int)value.x, (int)value.y); + } + } + } +} +#endif // UNITY_EDITOR && UNITY_2017_2_OR_NEWER \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Vector2IntMinMaxAttributeDrawer.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Vector2IntMinMaxAttributeDrawer.cs.meta new file mode 100644 index 00000000..84869a73 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/Vector2IntMinMaxAttributeDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 30393ed590c8fb64da0612e8a2fad8a4 +timeCreated: 1532688697 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntDrawers.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntDrawers.cs new file mode 100644 index 00000000..c7300fbc --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntDrawers.cs @@ -0,0 +1,141 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && UNITY_2017_2_OR_NEWER + +namespace Sirenix.OdinInspector.Editor.Drawers +{ + using Utilities.Editor; + using UnityEditor; + using UnityEngine; + + /// + /// Vector2Int proprety drawer. + /// + public sealed class Vector2IntDrawer : OdinValueDrawer, IDefinesGenericMenuItems + { + /// + /// Draws the property. + /// + protected override void DrawPropertyLayout(GUIContent label) + { + Rect labelRect; + var contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect); + { + EditorGUI.BeginChangeCheck(); + var val = SirenixEditorFields.VectorPrefixSlideRect(labelRect, (Vector2)this.ValueEntry.SmartValue); + if (EditorGUI.EndChangeCheck()) + { + this.ValueEntry.SmartValue = new Vector2Int((int)val.x, (int)val.y); + } + + var showLabels = SirenixEditorFields.ResponsiveVectorComponentFields && contentRect.width >= 185; + GUIHelper.PushLabelWidth(SirenixEditorFields.SingleLetterStructLabelWidth); + this.ValueEntry.Property.Children[0].Draw(showLabels ? GUIHelper.TempContent("X") : null); + this.ValueEntry.Property.Children[1].Draw(showLabels ? GUIHelper.TempContent("Y") : null); + GUIHelper.PopLabelWidth(); + + } + SirenixEditorGUI.EndHorizontalPropertyLayout(); + } + + /// + /// Populates the generic menu for the property. + /// + public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu) + { + Vector2Int value = (Vector2Int)property.ValueEntry.WeakSmartValue; + + if (genericMenu.GetItemCount() > 0) + { + genericMenu.AddSeparator(""); + } + genericMenu.AddItem(new GUIContent("Zero", "Set the vector to (0, 0)"), value == Vector2Int.zero, () => SetVector(property, Vector2Int.zero)); + genericMenu.AddItem(new GUIContent("One", "Set the vector to (1, 1)"), value == Vector2Int.one, () => SetVector(property, Vector2Int.one)); + genericMenu.AddSeparator(""); + genericMenu.AddItem(new GUIContent("Right", "Set the vector to (1, 0)"), value == Vector2Int.right, () => SetVector(property, Vector2Int.right)); + genericMenu.AddItem(new GUIContent("Left", "Set the vector to (-1, 0)"), value == Vector2Int.left, () => SetVector(property, Vector2Int.left)); + genericMenu.AddItem(new GUIContent("Up", "Set the vector to (0, 1)"), value == Vector2Int.up, () => SetVector(property, Vector2Int.up)); + genericMenu.AddItem(new GUIContent("Down", "Set the vector to (0, -1)"), value == Vector2Int.down, () => SetVector(property, Vector2Int.down)); + } + + private void SetVector(InspectorProperty property, Vector2Int value) + { + property.Tree.DelayActionUntilRepaint(() => + { + for (int i = 0; i < property.ValueEntry.ValueCount; i++) + { + property.ValueEntry.WeakValues[i] = value; + } + }); + } + } + + /// + /// Vector3Int property drawer. + /// + public sealed class Vector3IntDrawer : OdinValueDrawer, IDefinesGenericMenuItems + { + /// + /// Draws the property. + /// + protected override void DrawPropertyLayout(GUIContent label) + { + Rect labelRect; + var contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect); + { + EditorGUI.BeginChangeCheck(); + var val = SirenixEditorFields.VectorPrefixSlideRect(labelRect, (Vector3)this.ValueEntry.SmartValue); + if (EditorGUI.EndChangeCheck()) + { + this.ValueEntry.SmartValue = new Vector3Int((int)val.x, (int)val.y, (int)val.z); + } + + var showLabels = SirenixEditorFields.ResponsiveVectorComponentFields && contentRect.width >= 185; + GUIHelper.PushLabelWidth(SirenixEditorFields.SingleLetterStructLabelWidth); + this.ValueEntry.Property.Children[0].Draw(showLabels ? GUIHelper.TempContent("X") : null); + this.ValueEntry.Property.Children[1].Draw(showLabels ? GUIHelper.TempContent("Y") : null); + this.ValueEntry.Property.Children[2].Draw(showLabels ? GUIHelper.TempContent("Z") : null); + GUIHelper.PopLabelWidth(); + + } + SirenixEditorGUI.EndHorizontalPropertyLayout(); + } + + /// + /// Populates the generic menu for the property. + /// + public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu) + { + Vector3Int value = (Vector3Int)property.ValueEntry.WeakSmartValue; + + if (genericMenu.GetItemCount() > 0) + { + genericMenu.AddSeparator(""); + } + + genericMenu.AddItem(new GUIContent("Zero", "Set the vector to (0, 0, 0)"), value == Vector3Int.zero, () => SetVector(property, Vector3Int.zero)); + genericMenu.AddItem(new GUIContent("One", "Set the vector to (1, 1, 1)"), value == Vector3Int.one, () => SetVector(property, Vector3Int.one)); + genericMenu.AddSeparator(""); + genericMenu.AddItem(new GUIContent("Right", "Set the vector to (1, 0, 0)"), value == Vector3Int.right, () => SetVector(property, Vector3Int.right)); + genericMenu.AddItem(new GUIContent("Left", "Set the vector to (-1, 0, 0)"), value == Vector3Int.left, () => SetVector(property, Vector3Int.left)); + genericMenu.AddItem(new GUIContent("Up", "Set the vector to (0, 1, 0)"), value == Vector3Int.up, () => SetVector(property, Vector3Int.up)); + genericMenu.AddItem(new GUIContent("Down", "Set the vector to (0, -1, 0)"), value == Vector3Int.down, () => SetVector(property, Vector3Int.down)); + genericMenu.AddItem(new GUIContent("Forward", "Set the vector property to (0, 0, 1)"), value == new Vector3Int(0, 0, 1), () => SetVector(property, new Vector3Int(0, 0, 1))); + genericMenu.AddItem(new GUIContent("Back", "Set the vector property to (0, 0, -1)"), value == new Vector3Int(0, 0, -1), () => SetVector(property, new Vector3Int(0, 0, -1))); + } + + private void SetVector(InspectorProperty property, Vector3Int value) + { + property.Tree.DelayActionUntilRepaint(() => + { + property.ValueEntry.WeakSmartValue = value; + }); + } + } +} + +#endif // UNITY_EDITOR && UNITY_2017_2_OR_NEWER \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntDrawers.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntDrawers.cs.meta new file mode 100644 index 00000000..5e47f131 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntDrawers.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2fc48d59edff00f49b8ae717c776ff45 +timeCreated: 1520596090 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntPropertyResolvers.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntPropertyResolvers.cs new file mode 100644 index 00000000..2e7df3e0 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntPropertyResolvers.cs @@ -0,0 +1,54 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- + +#if UNITY_EDITOR && UNITY_2017_2_OR_NEWER + +namespace Sirenix.OdinInspector.Editor.Drawers +{ + using UnityEngine; + + public sealed class Vector2IntResolver : BaseMemberPropertyResolver + { + protected override InspectorPropertyInfo[] GetPropertyInfos() + { + return new InspectorPropertyInfo[] + { + InspectorPropertyInfo.CreateValue("x", 0, this.Property.ValueEntry.SerializationBackend, + new GetterSetter( + getter: (ref Vector2Int vec) => vec.x, + setter: (ref Vector2Int vec, int value) => vec.x = value)), + InspectorPropertyInfo.CreateValue("y", 0, this.Property.ValueEntry.SerializationBackend, + new GetterSetter( + getter: (ref Vector2Int vec) => vec.y, + setter: (ref Vector2Int vec, int value) => vec.y = value)), + }; + } + } + + public sealed class Vector3IntResolver : BaseMemberPropertyResolver + { + protected override InspectorPropertyInfo[] GetPropertyInfos() + { + return new InspectorPropertyInfo[] + { + InspectorPropertyInfo.CreateValue("x", 0, this.Property.ValueEntry.SerializationBackend, + new GetterSetter( + getter: (ref Vector3Int vec) => vec.x, + setter: (ref Vector3Int vec, int value) => vec.x = value)), + InspectorPropertyInfo.CreateValue("y", 0, this.Property.ValueEntry.SerializationBackend, + new GetterSetter( + getter: (ref Vector3Int vec) => vec.y, + setter: (ref Vector3Int vec, int value) => vec.y = value)), + InspectorPropertyInfo.CreateValue("z", 0, this.Property.ValueEntry.SerializationBackend, + new GetterSetter( + getter: (ref Vector3Int vec) => vec.z, + setter: (ref Vector3Int vec, int value) => vec.z = value)), + }; + } + } +} + +#endif // UNITY_EDITOR && UNITY_2017_2_OR_NEWER \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntPropertyResolvers.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntPropertyResolvers.cs.meta new file mode 100644 index 00000000..07a849b8 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/VectorIntPropertyResolvers.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 435323e396d85494daeb5278528fe138 +timeCreated: 1539340561 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/SerializedNetworkBehaviour.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/SerializedNetworkBehaviour.cs new file mode 100644 index 00000000..7362d62e --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/SerializedNetworkBehaviour.cs @@ -0,0 +1,66 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- +#if !UNITY_2019_1_OR_NEWER +#pragma warning disable 0618 + +namespace Sirenix.OdinInspector +{ + using Sirenix.Serialization; + using UnityEngine; + using UnityEngine.Networking; + + /// + /// A Unity NetworkBehaviour which is serialized by the Sirenix serialization system. + /// Please note that Odin's custom serialization only works for non-synced variables - [SyncVar] and SyncLists still have the same limitations. + /// + [ShowOdinSerializedPropertiesInInspector] + public abstract class SerializedNetworkBehaviour : NetworkBehaviour, ISerializationCallbackReceiver, ISupportsPrefabSerialization + { + [SerializeField, HideInInspector] + private SerializationData serializationData; + + SerializationData ISupportsPrefabSerialization.SerializationData { get { return this.serializationData; } set { this.serializationData = value; } } + + void ISerializationCallbackReceiver.OnAfterDeserialize() + { + UnitySerializationUtility.DeserializeUnityObject(this, ref this.serializationData); + this.OnAfterDeserialize(); + } + + void ISerializationCallbackReceiver.OnBeforeSerialize() + { + UnitySerializationUtility.SerializeUnityObject(this, ref this.serializationData); + this.OnBeforeSerialize(); + } + + /// + /// Invoked after deserialization has taken place. + /// + protected virtual void OnAfterDeserialize() + { + } + + /// + /// Invoked before serialization has taken place. + /// + protected virtual void OnBeforeSerialize() + { + } + +#if UNITY_EDITOR + + [HideInTables] + [OnInspectorGUI, PropertyOrder(int.MinValue)] + private void InternalOnInspectorGUI() + { + EditorOnlyModeConfigUtility.InternalOnInspectorGUI(this); + } + +#endif + } +} + +#endif // UNITY_2019_1_OR_NEWER \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/SerializedNetworkBehaviour.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/SerializedNetworkBehaviour.cs.meta new file mode 100644 index 00000000..b935e798 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/SerializedNetworkBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5d496f720527c984b8acc75a238bbd79 +timeCreated: 1545412221 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Sirenix.OdinInspector.CompatibilityLayer.asmdef b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Sirenix.OdinInspector.CompatibilityLayer.asmdef new file mode 100644 index 00000000..0d791682 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Sirenix.OdinInspector.CompatibilityLayer.asmdef @@ -0,0 +1,11 @@ +{ + "name": "Sirenix.OdinInspector.CompatibilityLayer", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "autoReferenced": true, + "overrideReferences": false, + "precompiledReferences": [], + "defineConstraints": [] +} \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Sirenix.OdinInspector.CompatibilityLayer.asmdef.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Sirenix.OdinInspector.CompatibilityLayer.asmdef.meta new file mode 100644 index 00000000..af257961 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/Sirenix.OdinInspector.CompatibilityLayer.asmdef.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e42d975e06bb1646a960c7c31728951 +timeCreated: 1602076732 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/VectorIntFormatters.cs b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/VectorIntFormatters.cs new file mode 100644 index 00000000..ccb62ce0 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/VectorIntFormatters.cs @@ -0,0 +1,80 @@ +#if UNITY_2017_2_OR_NEWER + +//----------------------------------------------------------------------- +// +// Copyright (c) Sirenix IVS. All rights reserved. +// +//----------------------------------------------------------------------- + +[assembly: Sirenix.Serialization.RegisterFormatter(typeof(Sirenix.Serialization.Vector2IntFormatter))] +[assembly: Sirenix.Serialization.RegisterFormatter(typeof(Sirenix.Serialization.Vector3IntFormatter))] +namespace Sirenix.Serialization +{ + using UnityEngine; + + /// + /// Custom formatter for the type. + /// + /// + public class Vector2IntFormatter : MinimalBaseFormatter + { + private static readonly Serializer Serializer = Serialization.Serializer.Get(); + + /// + /// Reads into the specified value using the specified reader. + /// + /// The value to read into. + /// The reader to use. + protected override void Read(ref Vector2Int value, IDataReader reader) + { + value.x = Vector2IntFormatter.Serializer.ReadValue(reader); + value.y = Vector2IntFormatter.Serializer.ReadValue(reader); + } + + /// + /// Writes from the specified value using the specified writer. + /// + /// The value to write from. + /// The writer to use. + protected override void Write(ref Vector2Int value, IDataWriter writer) + { + Vector2IntFormatter.Serializer.WriteValue(value.x, writer); + Vector2IntFormatter.Serializer.WriteValue(value.y, writer); + } + } + + /// + /// Custom formatter for the type. + /// + /// + public class Vector3IntFormatter : MinimalBaseFormatter + { + private static readonly Serializer Serializer = Serialization.Serializer.Get(); + + /// + /// Reads into the specified value using the specified reader. + /// + /// The value to read into. + /// The reader to use. + protected override void Read(ref Vector3Int value, IDataReader reader) + { + value.x = Vector3IntFormatter.Serializer.ReadValue(reader); + value.y = Vector3IntFormatter.Serializer.ReadValue(reader); + value.z = Vector3IntFormatter.Serializer.ReadValue(reader); + } + + /// + /// Writes from the specified value using the specified writer. + /// + /// The value to write from. + /// The writer to use. + protected override void Write(ref Vector3Int value, IDataWriter writer) + { + Vector3IntFormatter.Serializer.WriteValue(value.x, writer); + Vector3IntFormatter.Serializer.WriteValue(value.y, writer); + Vector3IntFormatter.Serializer.WriteValue(value.z, writer); + } + } +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Scripts/VectorIntFormatters.cs.meta b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/VectorIntFormatters.cs.meta new file mode 100644 index 00000000..a30d06af --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Scripts/VectorIntFormatters.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a2f1c424a60dfbd4fa331449baeac351 +timeCreated: 1520596090 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Readme.txt b/Assets/Plugins/Sirenix/Readme.txt new file mode 100644 index 00000000..61a26a32 --- /dev/null +++ b/Assets/Plugins/Sirenix/Readme.txt @@ -0,0 +1,35 @@ +------------------------------------ Getting Started ------------------------------------ + +Open up the Getting Started guide from "Tools > Odin Inspector > Getting Started." + + +------------------------------------- Helpful Links ------------------------------------- + +Tutorials: https://odininspector.com/tutorials +API Documentaion: https://odininspector.com/documentation +Roadmap: https://odininspector.com/roadmap +Release Notes: https://odininspector.com/patch-notes +Issue Tracker: https://bitbucket.org/sirenix/odin-inspector + + +--------------------------------- Community and Support --------------------------------- + +If you have any issues, suggestions or want advice, then you're more than welcome +to join us on Discord, or reach out to us by any other means. + +Support: https://odininspector.com/support +Community Addons: https://odininspector.com/community-tools +Discord: https://discord.gg/AgDmStu + + +---------------------------------------Thanks you!--------------------------------------- + +We really hope you like using Odin. Be sure to leave a review on the Asset Store, +that helps us out a lot! + +Leave a review: https://assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041 + + +Odin Inspector is published and developed by Sirenix. + +Sirenix: Https://sirenix.net \ No newline at end of file diff --git a/Assets/Plugins/Sirenix/Readme.txt.meta b/Assets/Plugins/Sirenix/Readme.txt.meta new file mode 100644 index 00000000..e69643e1 --- /dev/null +++ b/Assets/Plugins/Sirenix/Readme.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e957a9e8b4f4bce4b8a34e504a8c39d7 +timeCreated: 1533815770 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Characters/Saionji.prefab b/Assets/Prefabs/Characters/Saionji.prefab index ee9f30ec..02ea1a65 100644 --- a/Assets/Prefabs/Characters/Saionji.prefab +++ b/Assets/Prefabs/Characters/Saionji.prefab @@ -472,6 +472,7 @@ MonoBehaviour: m_Title: Saionji.HurtBox m_Desc: saionji's hurtbox, didnt effected by gravity m_HintColor: {r: 1, g: 0.9094448, b: 0, a: 0.5} + m_Body: {fileID: 0} m_Center: {x: 0, y: 0, z: 0} m_Size: {x: 1, y: 1, z: 1} --- !u!1 &1116262850384336476 @@ -3826,7 +3827,6 @@ GameObject: - component: {fileID: 3741668519095819896} - component: {fileID: 3741668519095819897} - component: {fileID: 3741668519095819894} - - component: {fileID: 3741668519095819889} - component: {fileID: 6037765075253890939} - component: {fileID: 6037765075253890940} - component: {fileID: 6037765075253890941} @@ -4185,18 +4185,6 @@ MonoBehaviour: m_EditorClassIdentifier: Go_FootIK: {fileID: 0} IKWeight: 0 ---- !u!114 &3741668519095819889 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6928613106012578342} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c5984537089789644b0e8e326ae83aad, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!114 &6037765075253890939 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4229,6 +4217,7 @@ MonoBehaviour: m_Title: Saionji.Body m_Desc: "\u897F\u56ED\u5BFA\u7684\u8EAB\u4F53\uFF0C\u4F1A\u53C2\u4E0E\u7269\u7406\u8BA1\u7B97\uFF0C\u5E95\u8FB9\u6C38\u8FDC\u662F\u811A\uFF0C\u5927\u5C0F\u4E0D\u9700\u8981\u6539\u53D8" m_HintColor: {r: 0.14796188, g: 0.8962264, b: 0.183694, a: 0.5} + m_Body: {fileID: 6037765075253890941} m_Center: {x: 0, y: 0.71, z: 0} m_Size: {x: 0.49, y: 1.43, z: 1} --- !u!114 &6037765075253890941 @@ -4248,6 +4237,7 @@ MonoBehaviour: m_UseGravity: 0 m_Accelaration: {x: 0, y: 0, z: 0} m_Frication: 0 + m_Primitive: {fileID: 6037765075253890940} --- !u!1 &6992958801127855440 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Demo/SaionjiShowOff.unity b/Assets/Scenes/Demo/SaionjiShowOff.unity index bca68575..a2e8b59a 100644 --- a/Assets/Scenes/Demo/SaionjiShowOff.unity +++ b/Assets/Scenes/Demo/SaionjiShowOff.unity @@ -5205,7 +5205,7 @@ Camera: height: 1 near clip plane: 0.1 far clip plane: 100 - field of view: 51.1 + field of view: 60.92537 orthographic: 0 orthographic size: 5 m_Depth: -1 @@ -7168,7 +7168,7 @@ PrefabInstance: type: 3} propertyPath: m_Controller value: - objectReference: {fileID: 9100000, guid: 13bbef7934f37d440921ff61ceb4af2e, type: 2} + objectReference: {fileID: 9100000, guid: 8339fda9cd2fe644f899152ce7ae7879, type: 2} - target: {fileID: 5505303514460593431, guid: 83d445123a203b14298b7a7662a0a470, type: 3} propertyPath: m_LocalPosition.x @@ -7224,16 +7224,21 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 6037765075253890939, guid: 83d445123a203b14298b7a7662a0a470, + - target: {fileID: 6037765075253890940, guid: 83d445123a203b14298b7a7662a0a470, type: 3} - propertyPath: m_Primitives.Array.size + propertyPath: m_Tag value: 1 objectReference: {fileID: 0} - - target: {fileID: 6037765075253890941, guid: 83d445123a203b14298b7a7662a0a470, + - target: {fileID: 6037765075253890940, guid: 83d445123a203b14298b7a7662a0a470, type: 3} - propertyPath: m_Primitive - value: - objectReference: {fileID: 6037765075253890940} + propertyPath: m_Size.y + value: 1.1 + objectReference: {fileID: 0} + - target: {fileID: 6037765075253890940, guid: 83d445123a203b14298b7a7662a0a470, + type: 3} + propertyPath: m_Center.y + value: 0.56 + objectReference: {fileID: 0} - target: {fileID: 6928613106012578342, guid: 83d445123a203b14298b7a7662a0a470, type: 3} propertyPath: m_Name @@ -7241,18 +7246,6 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 83d445123a203b14298b7a7662a0a470, type: 3} ---- !u!114 &6037765075253890940 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 6037765075253890940, guid: 83d445123a203b14298b7a7662a0a470, - type: 3} - m_PrefabInstance: {fileID: 3741668519200845148} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 637138a0ba30abc498c5c9dcf6bb5d78, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!4 &9190676758873534539 stripped Transform: m_CorrespondingSourceObject: {fileID: 5505303514460593431, guid: 83d445123a203b14298b7a7662a0a470, diff --git a/Assets/Scripts/ApplicationMain.cs b/Assets/Scripts/ApplicationMain.cs index fa4c2357..04648edf 100644 --- a/Assets/Scripts/ApplicationMain.cs +++ b/Assets/Scripts/ApplicationMain.cs @@ -8,7 +8,7 @@ public class ApplicationMain : MonoBehaviour void Start() { InputManager.Instance.Init(); - + PhysicsWorld.Instance.Init(); } // Update is called once per frame @@ -16,4 +16,9 @@ public class ApplicationMain : MonoBehaviour { InputManager.Instance.Update(); } + + private void LateUpdate() + { + PhysicsWorld.Instance.Update(); + } } diff --git a/Assets/Scripts/Physics/PhysicsBall.cs b/Assets/Scripts/Physics/PhysicsBall.cs index 2a076718..5baceeb8 100644 --- a/Assets/Scripts/Physics/PhysicsBall.cs +++ b/Assets/Scripts/Physics/PhysicsBall.cs @@ -2,10 +2,29 @@ using System.Collections.Generic; using UnityEngine; +/// +/// 碰撞球 +/// public class PhysicsBall : PhysicsPrimitive { - public Vector3 m_Center; - public float m_Radius; + public override PrimitiveType Type + { + get + { + return PrimitiveType.Ball; + } + } + + [SerializeField] + private float m_Radius; + + public float Radius + { + get + { + return m_Radius; + } + } public void OnDrawGizmos() { diff --git a/Assets/Scripts/Physics/PhysicsBody.cs b/Assets/Scripts/Physics/PhysicsBody.cs index e78e6f68..a4ef3aa5 100644 --- a/Assets/Scripts/Physics/PhysicsBody.cs +++ b/Assets/Scripts/Physics/PhysicsBody.cs @@ -2,6 +2,19 @@ using System.Collections.Generic; using UnityEngine; +// 需要受物理系统托管的动作: +// 跳跃上升 +// 跳跃下降 +// 空中受击 +// +// +// 不会受物理系统托管的动作: +// 单个招式 +// 空中连击 +// +// +// 一般来说启用物理是被动的 + /// /// 刚体 /// diff --git a/Assets/Scripts/Physics/PhysicsBox.cs b/Assets/Scripts/Physics/PhysicsBox.cs index b273cb3d..657aea71 100644 --- a/Assets/Scripts/Physics/PhysicsBox.cs +++ b/Assets/Scripts/Physics/PhysicsBox.cs @@ -2,17 +2,28 @@ using System.Collections.Generic; using UnityEngine; +/// +/// AABB碰撞盒 +/// public class PhysicsBox : PhysicsPrimitive { - /// - /// 中心点 - /// - public Vector3 m_Center; + public override PrimitiveType Type + { + get + { + return PrimitiveType.Box; + } + } - /// - /// 长宽高 - /// - public Vector3 m_Size; + [SerializeField] + private Vector3 m_Size; + public Vector3 Size + { + get + { + return m_Size; + } + } public float Long { get { return m_Size.x; } } public float Wide { get { return m_Size.y; } } @@ -22,7 +33,7 @@ public class PhysicsBox : PhysicsPrimitive { if (!m_IsActive) return; - Vector3 pos = m_Center + transform.position; + Vector3 pos = Position; Gizmos.color = m_HintColor; Gizmos.DrawCube(pos, m_Size); } diff --git a/Assets/Scripts/Physics/PhysicsHelper.cs b/Assets/Scripts/Physics/PhysicsHelper.cs index 27d04051..94916bfc 100644 --- a/Assets/Scripts/Physics/PhysicsHelper.cs +++ b/Assets/Scripts/Physics/PhysicsHelper.cs @@ -13,42 +13,45 @@ public class PhysicsCollisionInfo public sealed class PhysicsHelper { - public static bool BallvsBall(PhysicsBall ball1, PhysicsBall ball2, out PhysicsCollisionInfo info) +#region 简略版的2D检测,忽略z轴,对于格斗游戏来说使用2D物理 + + public static bool BallvsBall2D(PhysicsBall ball1, PhysicsBall ball2, out PhysicsCollisionInfo info) { info = null; + return true; } - public static bool BoxvsBox(PhysicsBox box1, PhysicsBox box2, out PhysicsCollisionInfo info) + public static bool BoxvsBox2D(PhysicsBox box1, PhysicsBox box2, out PhysicsCollisionInfo info) { info = null; return true; } - public static bool BallvsBox(PhysicsBall ball, PhysicsBox box, out PhysicsCollisionInfo info) + public static bool BallvsBox2D(PhysicsBall ball, PhysicsBox box, out PhysicsCollisionInfo info) { info = null; return true; } - #region 简略版的2D检测,忽略z轴 +#endregion - public static bool BallvsBall2D(PhysicsBall ball1, PhysicsBall ball2, out PhysicsCollisionInfo info) + public static bool BallvsBall(PhysicsBall ball1, PhysicsBall ball2, out PhysicsCollisionInfo info) { info = null; return true; } - public static bool BoxvsBox2D(PhysicsBox box1, PhysicsBox box2, out PhysicsCollisionInfo info) + public static bool BoxvsBox(PhysicsBox box1, PhysicsBox box2, out PhysicsCollisionInfo info) { info = null; return true; } - public static bool BallvsBox2D(PhysicsBall ball, PhysicsBox box, out PhysicsCollisionInfo info) + public static bool BallvsBox(PhysicsBall ball, PhysicsBox box, out PhysicsCollisionInfo info) { info = null; return true; } - #endregion + } diff --git a/Assets/Scripts/Physics/PhysicsPrimitive.cs b/Assets/Scripts/Physics/PhysicsPrimitive.cs index 0d285fd3..99549db3 100644 --- a/Assets/Scripts/Physics/PhysicsPrimitive.cs +++ b/Assets/Scripts/Physics/PhysicsPrimitive.cs @@ -2,34 +2,53 @@ using System.Collections.Generic; using UnityEngine; +public enum PrimitiveType +{ + None, + Ball, + Box +} + /// /// 物理碰撞体基类 -/// 只需要Box和Ball两种 +/// 对于格斗游戏来说只需要Box和Ball两种 /// public abstract class PhysicsPrimitive : MonoBehaviour { - [SerializeField] + public virtual PrimitiveType Type + { + get + { + return PrimitiveType.None; + } + } + /// - /// 这个primitive是否参与物理计算,用来快速给物体取消和恢复重力影响 + /// 世界坐标,物理模拟是在世界空间,本地坐标没有意义 /// - protected bool m_IsActive; - public bool IsActive + public Vector3 Position { get { - return m_IsActive; + return transform.TransformPoint(m_Center); } } /// - /// 这个primitive所属的物体 + /// 中心点在本地空间的位置 /// - protected Transform m_Parent; - public Transform Parent + public Vector3 m_Center; + + [SerializeField] + /// + /// 这个primitive是否参与物理计算,用来快速给物体取消和恢复重力影响 + /// + protected bool m_IsActive; + public bool IsActive { get { - return m_Parent; + return m_IsActive; } } @@ -65,7 +84,6 @@ public abstract class PhysicsPrimitive : MonoBehaviour } } - [SerializeField] protected string m_Title; public string Title @@ -92,11 +110,15 @@ public abstract class PhysicsPrimitive : MonoBehaviour protected void OnInit() { m_ID = UIDManager.Acquire(); - m_Parent = transform; } protected Color Color_Green = new Color(0,1, 0, 0.5f); [SerializeField] protected Color m_HintColor = new Color(0, 0, 0, 0.5f); + + [Tooltip("Physics body, leave blank and primitive will be static.")] + [SerializeField] + protected PhysicsBody m_Body; + } \ No newline at end of file diff --git a/Assets/Scripts/Physics/PhysicsWorld.cs b/Assets/Scripts/Physics/PhysicsWorld.cs index 653bad0d..5ef747b2 100644 --- a/Assets/Scripts/Physics/PhysicsWorld.cs +++ b/Assets/Scripts/Physics/PhysicsWorld.cs @@ -3,30 +3,79 @@ using System.Collections.Generic; using UnityEngine; /// -/// 标记 +/// primitive标记 /// public enum PhysicsTag { - Player, - Oponent, + Player = 1, // 从属于玩家 + Oponent = 1 << 1, // 从属于对手 } /// -/// 分类 +/// primitive分类 /// public enum PhysicsGroup { - Character, - Environment, - Props, + Character, // 角色 + Prop, // 物体 + Ground, // 地面 + Wall, // 墙面 } public class PhysicsWorld : Singleton { - private int m_UpdateRate = 60; + private int m_UpdateRate = 30; + // 重力加速度 + private readonly Vector3 m_Gravity = new Vector3(0, -9.8f, 0); + // 当前管理的碰撞体 + private List m_Primitives; + private float m_TimeCount; + public void Init() + { + m_Primitives = new List(); + m_TimeCount = Time.time; + } + + public void AddPrimitive(PhysicsPrimitive prim) + { + if (prim == null) + return; + if(m_Primitives.Contains(prim)) + { + Debug.LogError("PhysicsWorld已经存在此碰撞体,ID=" + prim.ID + ", 类型=" + prim.Tag); + return; + } + m_Primitives.Add(prim); + } + + public void RemovePrimitive(PhysicsPrimitive prim) + { + if (prim == null) + return; + m_Primitives.Remove(prim); + } + + /// + /// 物理系统已稳定的逻辑帧率执行 + /// public void Update() { + float preTime = m_TimeCount; + m_TimeCount = Time.time; + float dt = m_TimeCount - preTime; + while (dt > 1f / m_UpdateRate) + { + Tick(); + dt -= 1f / m_UpdateRate; + } + m_TimeCount -= dt; + } + + private void Tick() + { + float deltaTime = 1f / m_UpdateRate; + //Debug.Log("Physics Tick"); } diff --git a/Assets/Scripts/Test/SaionjiScript.cs b/Assets/Scripts/Test/SaionjiScript.cs index c252645b..a3216dd5 100644 --- a/Assets/Scripts/Test/SaionjiScript.cs +++ b/Assets/Scripts/Test/SaionjiScript.cs @@ -37,4 +37,27 @@ public partial class SaionjiScript : MonoBehaviour //} } + // 更新顺序: + // internal animator update -> OnAnimatorMove() -> physics + // 角色最后的位置以物理系统为准(如果加入物理系统的话) + // 如果后续有物理处理,会重写transform + // 对于后续不受物理管理的动作,不需要修改transform + void OnAnimatorMove() + { + Animator animator = GetComponent(); + + // animator.deltaPosition和animator.deltaRotation是animator做的root motion后的结果 + // 在后面做一个硬性约束z=0,将角色限制在z=0平面上 + if (animator) + { + Vector3 position = transform.position; + position.x += animator.deltaPosition.x; + position.y += animator.deltaPosition.y; + transform.position = position; + + // animation clip导入设置旋转一般上设置为baked inpose,不需要手动限制 + transform.rotation *= animator.deltaRotation; + } + } + } diff --git a/Assets/ThirdParty/AdvancedInspector.meta b/Assets/ThirdParty/AdvancedInspector.meta deleted file mode 100644 index 76047e09..00000000 --- a/Assets/ThirdParty/AdvancedInspector.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 7e1b2f643ac88bf439624e1b32dc53b4 -folderAsset: yes -DefaultImporter: - userData: diff --git a/Assets/ThirdParty/VRM/MeshUtility.meta b/Assets/ThirdParty/VRM/MeshUtility.meta new file mode 100644 index 00000000..28298acd --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f11c20c3f50e40b4f8f6259f8e0886e0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/CHANGELOG.md b/Assets/ThirdParty/VRM/MeshUtility/CHANGELOG.md new file mode 100644 index 00000000..8e0827e1 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog +All notable changes to this package will be documented in this file. + +## [0.0.1] - 2020-07-01 +### Added +- The first release of MeshUtility +- Add MeshSeparator: the mesh with BlendShape can be separated out \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/CHANGELOG.md.meta b/Assets/ThirdParty/VRM/MeshUtility/CHANGELOG.md.meta new file mode 100644 index 00000000..fdcf1a9a --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 988849cd155716d4f9c3a8f18a856470 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation.meta new file mode 100644 index 00000000..3a651bf6 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42e2174ab737d474ebaee9d1c19b7934 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/MeshUtility.md b/Assets/ThirdParty/VRM/MeshUtility/Documentation/MeshUtility.md new file mode 100644 index 00000000..0a111e70 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/MeshUtility.md @@ -0,0 +1,7 @@ +# MeshUtility + +A mesh processing package for mesh separation, etc. + +## Documentation Link + +[MeshSeparator](https://github.com/vrm-c/UniVRM/tree/master/Assets/MeshUtility/Documentation/notes/MeshSeparator.md) \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/MeshUtility.md.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/MeshUtility.md.meta new file mode 100644 index 00000000..3e93b85f --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/MeshUtility.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 43890cb851a34c5488d15e1a32e7dadc +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images.meta new file mode 100644 index 00000000..82cf4db8 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 19a2e88b29a2db943aee731aafda8a84 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/blendshape_separator.jpg b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/blendshape_separator.jpg new file mode 100644 index 00000000..b28eb462 Binary files /dev/null and b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/blendshape_separator.jpg differ diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/blendshape_separator.jpg.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/blendshape_separator.jpg.meta new file mode 100644 index 00000000..b013c05f --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/blendshape_separator.jpg.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: a9a09bb093d309947958f67bfe21e095 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_1.jpg b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_1.jpg new file mode 100644 index 00000000..bd916403 Binary files /dev/null and b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_1.jpg differ diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_1.jpg.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_1.jpg.meta new file mode 100644 index 00000000..fcd26b64 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_1.jpg.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: b3d26d2cfebad4b43a904c4a9978fadf +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_2.jpg b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_2.jpg new file mode 100644 index 00000000..e31b7ec9 Binary files /dev/null and b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_2.jpg differ diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_2.jpg.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_2.jpg.meta new file mode 100644 index 00000000..26b42b79 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_2.jpg.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: 323176881f04b704bad2644d21ce914a +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_3.jpg b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_3.jpg new file mode 100644 index 00000000..5d0aaed2 Binary files /dev/null and b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_3.jpg differ diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_3.jpg.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_3.jpg.meta new file mode 100644 index 00000000..f3b98799 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/installation_3.jpg.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: e9dd20fb6b4bcb146b40e8f729725fa9 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_1.jpg b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_1.jpg new file mode 100644 index 00000000..eec170ec Binary files /dev/null and b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_1.jpg differ diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_1.jpg.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_1.jpg.meta new file mode 100644 index 00000000..ea056784 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_1.jpg.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: 1ddbc5d5bb1796c4ab3ccdd5d0c29aa7 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_2.jpg b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_2.jpg new file mode 100644 index 00000000..98adf2b9 Binary files /dev/null and b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_2.jpg differ diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_2.jpg.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_2.jpg.meta new file mode 100644 index 00000000..8754427e --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_2.jpg.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: 23c78259991e1cf49a88e110cd18e0ed +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_3.jpg b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_3.jpg new file mode 100644 index 00000000..e9d52bf4 Binary files /dev/null and b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_3.jpg differ diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_3.jpg.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_3.jpg.meta new file mode 100644 index 00000000..4dc7751a --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/interface_3.jpg.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: c6bc8b3735742bd439c4f5eee478cc1a +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_1.jpg b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_1.jpg new file mode 100644 index 00000000..65d704cd Binary files /dev/null and b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_1.jpg differ diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_1.jpg.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_1.jpg.meta new file mode 100644 index 00000000..03db4542 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_1.jpg.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: 1be7c06f1e0cc2a448ad9166891d03dd +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_2.jpg b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_2.jpg new file mode 100644 index 00000000..951347ea Binary files /dev/null and b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_2.jpg differ diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_2.jpg.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_2.jpg.meta new file mode 100644 index 00000000..20249090 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/images/result_2.jpg.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: d2fa21619ba10b043a82f64ccca30878 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + 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: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + 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: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/notes.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/notes.meta new file mode 100644 index 00000000..72f20c27 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/notes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea010ddf8bf34de4fb36d95afb078702 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/notes/MeshSeparator.md b/Assets/ThirdParty/VRM/MeshUtility/Documentation/notes/MeshSeparator.md new file mode 100644 index 00000000..da93e7d9 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/notes/MeshSeparator.md @@ -0,0 +1,25 @@ +# MeshSeparator + +MeshSeparator provides a functionality of separating meshes contained BlendShape. Simply select a GameObject with skinned Meshes and click processing. The mesh splitting results are generated in the Assets folder. The model with sparse BlendShape data distributed in a large-volume mesh can be benefited from size reduction and performance improvements after mesh separation. + +## How to use + +Select a GameObject contained skinned mesh and BlendShape: + + + +Select `Mesh Utility` -> `MeshSeparator`: + + + +The separate meshes are saved in the Assets folder. GameObjects with separate meshes are also available in the Hierarchy Window: + + + +In this example, the model's mesh are split into two parts: face and body: + +Face: with BlendShape | Body: without BlendShape +:-------------------------:|:-------------------------: + | + +Note that if all the polygons of a mesh are used by BlendShape, MeshSeparator will not perform mesh separation. \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/Documentation/notes/MeshSeparator.md.meta b/Assets/ThirdParty/VRM/MeshUtility/Documentation/notes/MeshSeparator.md.meta new file mode 100644 index 00000000..13d9f1f9 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Documentation/notes/MeshSeparator.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ad5ca4fe4bdde854bb90cb5a3aa267d4 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Editor.meta b/Assets/ThirdParty/VRM/MeshUtility/Editor.meta new file mode 100644 index 00000000..9c63441d --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e0d906064b5cad4394c89ec960a887e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Editor/BoneMeshEraserWizard.cs b/Assets/ThirdParty/VRM/MeshUtility/Editor/BoneMeshEraserWizard.cs new file mode 100644 index 00000000..63bf9045 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Editor/BoneMeshEraserWizard.cs @@ -0,0 +1,200 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEngine; + + +namespace MeshUtility +{ + [CustomPropertyDrawer(typeof(BoneMeshEraser.EraseBone))] + public class EraseBoneDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + //EditorGUI.BeginProperty(position, label, property); + + var leftWidth = 0.6f; + var rightWidth = 1.0f - leftWidth; + + var leftSide = new Rect(position.x, position.y, position.width * leftWidth, position.height); + var rightSide = new Rect(position.width * leftWidth, position.y, position.width * rightWidth, position.height); + { + EditorGUI.PropertyField(leftSide, property.FindPropertyRelative("Bone"), new GUIContent("", "")); + EditorGUI.PropertyField(rightSide, property.FindPropertyRelative("Erase")); + } + + //EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + var height = base.GetPropertyHeight(property, label); + return height; + } + } + + public class BoneMeshEraserWizard : ScriptableWizard + { + const string ASSET_SUFFIX = ".asset"; + + [SerializeField] + SkinnedMeshRenderer m_skinnedMesh; + + [SerializeField] + Animator m_animator; + + [SerializeField] + Transform EraseRoot; + + [SerializeField] + BoneMeshEraser.EraseBone[] m_eraseBones; + + [MenuItem(MeshUtility.MENU_PARENT + "BoneMeshEraser Wizard", priority = 4)] + static void CreateWizard() + { + ScriptableWizard.DisplayWizard("BoneMeshEraser", "Erase triangles by bone", "Erase"); + } + + private void OnEnable() + { + var root = Selection.activeGameObject; + if (root != null) + { + m_animator = root.GetComponent(); + m_skinnedMesh = root.GetComponent(); + OnValidate(); + } + } + + void OnValidate() + { + //Debug.Log("OnValidate"); + if (m_skinnedMesh == null) + { + m_eraseBones = new BoneMeshEraser.EraseBone[] { }; + return; + } + + if (EraseRoot == null) + { + if (m_animator != null) + { + EraseRoot = m_animator.GetBoneTransform(HumanBodyBones.Head); + //Debug.LogFormat("head: {0}", EraseRoot); + } + } + + m_eraseBones = m_skinnedMesh.bones.Select(x => + { + var eb = new BoneMeshEraser.EraseBone + { + Bone = x, + }; + + if (EraseRoot != null) + { + // 首の子孫を消去 + if (eb.Bone.Ancestor().Any(y => y == EraseRoot)) + { + //Debug.LogFormat("erase {0}", x); + eb.Erase = true; + } + } + + return eb; + }) + .ToArray(); + } + + void OnWizardUpdate() + { + helpString = "select target skinnedMesh and animator"; + } + + + + static int IndexOf(Transform[] list, Transform target) + { + for (int i = 0; i < list.Length; ++i) + { + if (list[i] == target) + { + return i; + } + } + return -1; + } + + SkinnedMeshRenderer _Erase(GameObject go) + { + if (go == null) + { + Debug.LogWarning("select root object in hierarchy"); + return null; + } + if (m_skinnedMesh == null) + { + Debug.LogWarning("no skinnedmesh"); + return null; + } + + var bones = m_skinnedMesh.bones; + var eraseBones = m_eraseBones + .Where(x => x.Erase) + .Select(x => Array.IndexOf(bones, x.Bone)) + .ToArray(); + + var meshNode = new GameObject("BoneMeshEraser"); + meshNode.transform.SetParent(go.transform, false); + + var erased = meshNode.AddComponent(); + erased.sharedMesh = BoneMeshEraser.CreateErasedMesh(m_skinnedMesh.sharedMesh, eraseBones); + erased.sharedMaterials = m_skinnedMesh.sharedMaterials; + erased.bones = m_skinnedMesh.bones; + + return erased; + } + + void Erase() + { + var go = Selection.activeGameObject; + var renderer = _Erase(go); + if (renderer == null) + { + return; + } + + // save mesh to Assets + var assetPath = string.Format("{0}{1}", go.name, ASSET_SUFFIX); + var prefab = MeshUtility.GetPrefab(go); + if (prefab != null) + { + var prefabPath = AssetDatabase.GetAssetPath(prefab); + assetPath = string.Format("{0}/{1}{2}", + Path.GetDirectoryName(prefabPath), + Path.GetFileNameWithoutExtension(prefabPath), + ASSET_SUFFIX + ); + } + + Debug.LogFormat("CreateAsset: {0}", assetPath); + AssetDatabase.CreateAsset(renderer.sharedMesh, assetPath); + } + + void OnWizardCreate() + { + //Debug.Log("OnWizardCreate"); + Erase(); + + // close + } + + void OnWizardOtherButton() + { + //Debug.Log("OnWizardOtherButton"); + Erase(); + } + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Editor/BoneMeshEraserWizard.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Editor/BoneMeshEraserWizard.cs.meta new file mode 100644 index 00000000..ef9f3976 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Editor/BoneMeshEraserWizard.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 881b00db73f639c48a3f043a775fa61a +timeCreated: 1518503829 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Editor/HumanoidEditor.cs b/Assets/ThirdParty/VRM/MeshUtility/Editor/HumanoidEditor.cs new file mode 100644 index 00000000..f9a99cfc --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Editor/HumanoidEditor.cs @@ -0,0 +1,324 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.IO; +using UnityEditor; +using UnityEngine; +using System; + +namespace MeshUtility +{ + [CustomEditor(typeof(Humanoid))] + public class HumanoidEditor : Editor + { + const int LABEL_WIDTH = 100; + + Humanoid m_target; + + SerializedProperty m_Hips; + #region leg + SerializedProperty m_LeftUpperLeg; + SerializedProperty m_RightUpperLeg; + SerializedProperty m_LeftLowerLeg; + SerializedProperty m_RightLowerLeg; + SerializedProperty m_LeftFoot; + SerializedProperty m_RightFoot; + SerializedProperty m_LeftToes; + SerializedProperty m_RightToes; + + #endregion + + #region spine + SerializedProperty m_Spine; + SerializedProperty m_Chest; + SerializedProperty m_UpperChest; + SerializedProperty m_Neck; + SerializedProperty m_Head; + SerializedProperty m_LeftEye; + SerializedProperty m_RightEye; + SerializedProperty m_Jaw; + + #endregion + + #region arm + SerializedProperty m_LeftShoulder; + SerializedProperty m_RightShoulder; + SerializedProperty m_LeftUpperArm; + SerializedProperty m_RightUpperArm; + SerializedProperty m_LeftLowerArm; + SerializedProperty m_RightLowerArm; + SerializedProperty m_LeftHand; + SerializedProperty m_RightHand; + + #endregion + + #region fingers + SerializedProperty m_LeftThumbProximal; + SerializedProperty m_LeftThumbIntermediate; + SerializedProperty m_LeftThumbDistal; + SerializedProperty m_LeftIndexProximal; + SerializedProperty m_LeftIndexIntermediate; + SerializedProperty m_LeftIndexDistal; + SerializedProperty m_LeftMiddleProximal; + SerializedProperty m_LeftMiddleIntermediate; + SerializedProperty m_LeftMiddleDistal; + SerializedProperty m_LeftRingProximal; + SerializedProperty m_LeftRingIntermediate; + SerializedProperty m_LeftRingDistal; + SerializedProperty m_LeftLittleProximal; + SerializedProperty m_LeftLittleIntermediate; + SerializedProperty m_LeftLittleDistal; + SerializedProperty m_RightThumbProximal; + SerializedProperty m_RightThumbIntermediate; + SerializedProperty m_RightThumbDistal; + SerializedProperty m_RightIndexProximal; + SerializedProperty m_RightIndexIntermediate; + SerializedProperty m_RightIndexDistal; + SerializedProperty m_RightMiddleProximal; + SerializedProperty m_RightMiddleIntermediate; + SerializedProperty m_RightMiddleDistal; + SerializedProperty m_RightRingProximal; + SerializedProperty m_RightRingIntermediate; + SerializedProperty m_RightRingDistal; + SerializedProperty m_RightLittleProximal; + SerializedProperty m_RightLittleIntermediate; + SerializedProperty m_RightLittleDistal; + + #endregion + + void OnEnable() + { + m_target = target as Humanoid; + m_Hips = serializedObject.FindProperty($"m_{nameof(Humanoid.Hips)}"); + + #region legs + m_LeftUpperLeg = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftUpperLeg)}"); + m_RightUpperLeg = serializedObject.FindProperty($"m_{nameof(Humanoid.RightUpperLeg)}"); + m_LeftLowerLeg = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftLowerLeg)}"); + m_RightLowerLeg = serializedObject.FindProperty($"m_{nameof(Humanoid.RightLowerLeg)}"); + m_LeftFoot = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftFoot)}"); + m_RightFoot = serializedObject.FindProperty($"m_{nameof(Humanoid.RightFoot)}"); + m_LeftToes = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftToes)}"); + m_RightToes = serializedObject.FindProperty($"m_{nameof(Humanoid.RightToes)}"); + #endregion + + #region spine + m_Spine = serializedObject.FindProperty($"m_{nameof(Humanoid.Spine)}"); + m_Chest = serializedObject.FindProperty($"m_{nameof(Humanoid.Chest)}"); + m_UpperChest = serializedObject.FindProperty($"m_{nameof(Humanoid.UpperChest)}"); + m_Neck = serializedObject.FindProperty($"m_{nameof(Humanoid.Neck)}"); + m_Head = serializedObject.FindProperty($"m_{nameof(Humanoid.Head)}"); + m_LeftEye = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftEye)}"); + m_RightEye = serializedObject.FindProperty($"m_{nameof(Humanoid.RightEye)}"); + m_Jaw = serializedObject.FindProperty($"m_{nameof(Humanoid.Jaw)}"); + + #endregion + + #region arm + m_LeftShoulder = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftShoulder)}"); + m_RightShoulder = serializedObject.FindProperty($"m_{nameof(Humanoid.RightShoulder)}"); + m_LeftUpperArm = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftUpperArm)}"); + m_RightUpperArm = serializedObject.FindProperty($"m_{nameof(Humanoid.RightUpperArm)}"); + m_LeftLowerArm = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftLowerArm)}"); + m_RightLowerArm = serializedObject.FindProperty($"m_{nameof(Humanoid.RightLowerArm)}"); + m_LeftHand = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftHand)}"); + m_RightHand = serializedObject.FindProperty($"m_{nameof(Humanoid.RightHand)}"); + + #endregion + + #region fingers + m_LeftThumbProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftThumbProximal)}"); + m_LeftThumbIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftThumbIntermediate)}"); + m_LeftThumbDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftThumbDistal)}"); + m_LeftIndexProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftIndexProximal)}"); + m_LeftIndexIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftIndexIntermediate)}"); + m_LeftIndexDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftIndexDistal)}"); + m_LeftMiddleProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftMiddleProximal)}"); + m_LeftMiddleIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftMiddleIntermediate)}"); + m_LeftMiddleDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftMiddleDistal)}"); + m_LeftRingProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftRingProximal)}"); + m_LeftRingIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftRingIntermediate)}"); + m_LeftRingDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftRingDistal)}"); + m_LeftLittleProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftLittleProximal)}"); + m_LeftLittleIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftLittleIntermediate)}"); + m_LeftLittleDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.LeftLittleDistal)}"); + m_RightThumbProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightThumbProximal)}"); + m_RightThumbIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.RightThumbIntermediate)}"); + m_RightThumbDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightThumbDistal)}"); + m_RightIndexProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightIndexProximal)}"); + m_RightIndexIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.RightIndexIntermediate)}"); + m_RightIndexDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightIndexDistal)}"); + m_RightMiddleProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightMiddleProximal)}"); + m_RightMiddleIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.RightMiddleIntermediate)}"); + m_RightMiddleDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightMiddleDistal)}"); + m_RightRingProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightRingProximal)}"); + m_RightRingIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.RightRingIntermediate)}"); + m_RightRingDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightRingDistal)}"); + m_RightLittleProximal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightLittleProximal)}"); + m_RightLittleIntermediate = serializedObject.FindProperty($"m_{nameof(Humanoid.RightLittleIntermediate)}"); + m_RightLittleDistal = serializedObject.FindProperty($"m_{nameof(Humanoid.RightLittleDistal)}"); + #endregion + } + + struct Horizontal : IDisposable + { + public static Horizontal Using() + { + EditorGUILayout.BeginHorizontal(); + return default; + } + public void Dispose() + { + EditorGUILayout.EndHorizontal(); + } + } + + static void HorizontalFields(string label, params SerializedProperty[] props) + { + try + { + EditorGUILayout.BeginHorizontal(); + + GUILayout.Label(label, GUILayout.Width(LABEL_WIDTH)); + GUILayout.FlexibleSpace(); + + foreach (var prop in props) + { + EditorGUILayout.PropertyField(prop, GUIContent.none, true, GUILayout.MinWidth(100)); + } + } + finally + { + EditorGUILayout.EndHorizontal(); + } + } + + static bool s_spineFold; + static bool s_legFold; + static bool s_armFold; + static bool s_fingerFold; + static string GetDialogDir(UnityEngine.Object obj) + { + var prefab = PrefabUtility.GetCorrespondingObjectFromSource(obj); + if (prefab == null) + { + return null; + } + return UnityPath.FromAsset(prefab).FullPath; + } + + public override void OnInspectorGUI() + { + foreach (var validation in m_target.Validate()) + { + EditorGUILayout.HelpBox(validation.Message, validation.IsError ? MessageType.Error : MessageType.Warning); + } + + // prefer + serializedObject.Update(); + + EditorGUILayout.PropertyField(m_Hips); + + s_spineFold = EditorGUILayout.Foldout(s_spineFold, "Body"); + if (s_spineFold) + { + EditorGUILayout.PropertyField(m_Spine); + EditorGUILayout.PropertyField(m_Chest); + EditorGUILayout.PropertyField(m_UpperChest); + EditorGUILayout.PropertyField(m_Neck); + EditorGUILayout.PropertyField(m_Head); + EditorGUILayout.PropertyField(m_Jaw); + HorizontalFields("Eye", m_LeftEye, m_RightEye); + } + + s_legFold = EditorGUILayout.Foldout(s_legFold, "Leg"); + if (s_legFold) + { + HorizontalFields("UpperLeg", m_LeftUpperLeg, m_RightUpperLeg); + HorizontalFields("LowerLeg", m_LeftLowerLeg, m_RightLowerLeg); + HorizontalFields("Foot", m_LeftFoot, m_RightFoot); + HorizontalFields("Toes", m_LeftToes, m_RightToes); + } + + s_armFold = EditorGUILayout.Foldout(s_armFold, "Arm"); + if (s_armFold) + { + HorizontalFields("Shoulder", m_LeftShoulder, m_RightShoulder); + HorizontalFields("UpperArm", m_LeftUpperArm, m_RightUpperArm); + HorizontalFields("LowerArm", m_LeftLowerArm, m_RightLowerArm); + HorizontalFields("Hand", m_LeftHand, m_RightHand); + } + + s_fingerFold = EditorGUILayout.Foldout(s_fingerFold, "Finger"); + if (s_fingerFold) + { + HorizontalFields("LeftThumb", m_LeftThumbProximal, m_LeftThumbIntermediate, m_LeftThumbDistal); + HorizontalFields("LeftIndex", m_LeftIndexProximal, m_LeftIndexIntermediate, m_LeftIndexDistal); + HorizontalFields("LeftMiddle", m_LeftMiddleProximal, m_LeftMiddleIntermediate, m_LeftMiddleDistal); + HorizontalFields("LeftRing", m_LeftRingProximal, m_LeftRingIntermediate, m_LeftRingDistal); + HorizontalFields("LeftLittle", m_LeftLittleProximal, m_LeftLittleIntermediate, m_LeftLittleDistal); + HorizontalFields("RightThumb", m_RightThumbProximal, m_RightThumbIntermediate, m_RightThumbDistal); + HorizontalFields("RightIndex", m_RightIndexProximal, m_RightIndexIntermediate, m_RightIndexDistal); + HorizontalFields("RightMiddle", m_RightMiddleProximal, m_RightMiddleIntermediate, m_RightMiddleDistal); + HorizontalFields("RightRing", m_RightRingProximal, m_RightRingIntermediate, m_RightRingDistal); + HorizontalFields("RightLittle", m_RightLittleProximal, m_RightLittleIntermediate, m_RightLittleDistal); + } + + serializedObject.ApplyModifiedProperties(); + + // create avatar + if (GUILayout.Button("Create UnityEngine.Avatar")) + { + var path = EditorUtility.SaveFilePanel( + "Save avatar", + GetDialogDir(m_target), + string.Format("{0}.avatar.asset", serializedObject.targetObject.name), + "asset"); + if (!string.IsNullOrEmpty(path)) + { + var avatar = m_target.CreateAvatar(); + if (avatar != null) + { + var unityPath = UnityPath.FromFullpath(path); + avatar.name = "avatar"; + Debug.LogFormat("Create avatar {0}", unityPath); + AssetDatabase.CreateAsset(avatar, unityPath.Value); + AssetDatabase.ImportAsset(unityPath.Value); + + // replace + var animator = m_target.GetComponent(); + if (animator == null) + { + animator = m_target.gameObject.AddComponent(); + } + animator.avatar = avatar; + + Selection.activeObject = avatar; + } + } + } + } + + void OnSceneGUI() + { + // var bones = m_target.Bones; + // if (bones != null) + // { + // for (int i = 0; i < bones.Length; ++i) + // { + // DrawBone((HumanBodyBones)i, bones[i]); + // } + // foreach (var x in m_bones) + // { + // x.Draw(); + // } + // } + + var forward = m_target.GetForward(); + + var begin = m_target.transform.position; + var end = begin + forward; + Handles.DrawLine(begin, end); + } + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Editor/HumanoidEditor.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Editor/HumanoidEditor.cs.meta new file mode 100644 index 00000000..dffaaa18 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Editor/HumanoidEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 57cc7b16eb4146c4ab5631f538e2489f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.Editor.asmdef b/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.Editor.asmdef new file mode 100644 index 00000000..9854cd8f --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.Editor.asmdef @@ -0,0 +1,16 @@ +{ + "name": "MeshUtility.Editor", + "references": [ + "MeshUtility" + ], + "optionalUnityReferences": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [] +} \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.Editor.asmdef.meta b/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.Editor.asmdef.meta new file mode 100644 index 00000000..ad84160c --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: eedb868807606df4db953419ab9e0780 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.cs b/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.cs new file mode 100644 index 00000000..045879c6 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.cs @@ -0,0 +1,286 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEngine; +using UnityEditor; + +namespace MeshUtility +{ + public class MeshUtility + { + public const string MENU_PARENT = "Mesh Utility/"; + public const int MENU_PRIORITY = 11; + + private const string ASSET_SUFFIX = ".mesh.asset"; + private const string MENU_NAME = MENU_PARENT + "MeshSeparator"; + private static readonly Vector3 ZERO_MOVEMENT = Vector3.zero; + + public static Object GetPrefab(GameObject instance) + { +#if UNITY_2018_2_OR_NEWER + return PrefabUtility.GetCorrespondingObjectFromSource(instance); +#else + return PrefabUtility.GetPrefabParent(go); +#endif + } + + private enum BlendShapeLogic + { + WithBlendShape, + WithoutBlendShape, + } + + [MenuItem(MENU_NAME, validate = true)] + private static bool ShowLogValidation() + { + if (Selection.activeTransform == null) + return false; + else + return true; + } + + [MenuItem(MENU_NAME, priority = 2)] + public static void SeparateSkinnedMeshContainedBlendShape() + { + var go = Selection.activeTransform.gameObject; + + if (go.GetComponentsInChildren().Length > 0) + { + SeparationProcessing(go); + go.SetActive(false); + } + else + { + EditorUtility.DisplayDialog("Error", "No skinnedMeshRenderer contained", "ok"); + } + } + + [MenuItem("Mesh Utility/MeshSeparator Docs", priority = MeshUtility.MENU_PRIORITY)] + public static void LinkToMeshSeparatorDocs() + { + Application.OpenURL("https://github.com/vrm-c/UniVRM/tree/master/Assets/MeshUtility"); + } + + private static void SeparationProcessing(GameObject go) + { + var outputObject = GameObject.Instantiate(go); + var skinnedMeshRenderers = outputObject.GetComponentsInChildren(); + foreach (var skinnedMeshRenderer in skinnedMeshRenderers) + { + if (skinnedMeshRenderer.sharedMesh.blendShapeCount > 0) + { + SeparatePolyWithBlendShape(skinnedMeshRenderer); + } + } + } + + private static void SeparatePolyWithBlendShape(SkinnedMeshRenderer skinnedMeshRendererInput) + { + var indicesUsedByBlendShape = new Dictionary(); + var mesh = skinnedMeshRendererInput.sharedMesh; + + // retrieve the original BlendShape data + for (int i = 0; i < mesh.blendShapeCount; ++i) + { + var deltaVertices = new Vector3[mesh.vertexCount]; + var deltaNormals = new Vector3[mesh.vertexCount]; + var deltaTangents = new Vector3[mesh.vertexCount]; + mesh.GetBlendShapeFrameVertices(i, 0, deltaVertices, deltaNormals, deltaTangents); + + for (int j = 0; j < deltaVertices.Length; j++) + { + if (!deltaVertices[j].Equals(ZERO_MOVEMENT)) + { + if (!indicesUsedByBlendShape.Values.Contains(j)) + { + indicesUsedByBlendShape.Add(indicesUsedByBlendShape.Count, j); + } + } + } + } + + var subMeshCount = mesh.subMeshCount; + var submeshesWithBlendShape = new Dictionary(); + var submeshesWithoutBlendShape = new Dictionary(); + var vertexIndexWithBlendShape = new Dictionary(); + var vertexCounterWithBlendShape = 0; + var vertexIndexWithoutBlendShape = new Dictionary(); + var vertexCounterWithoutBlendShape = 0; + + // check blendshape's vertex index from submesh + for (int i = 0; i < subMeshCount; i++) + { + var triangle = mesh.GetTriangles(i); + var submeshWithBlendShape = new List(); + var submeshWithoutBlendShape = new List(); + + for (int j = 0; j < triangle.Length; j += 3) + { + if (indicesUsedByBlendShape.Values.Contains(triangle[j]) || + indicesUsedByBlendShape.Values.Contains(triangle[j + 1]) || + indicesUsedByBlendShape.Values.Contains(triangle[j + 2])) + { + BuildNewTriangleList(vertexIndexWithBlendShape, triangle, j, submeshWithBlendShape, ref vertexCounterWithBlendShape); + } + else + { + BuildNewTriangleList(vertexIndexWithoutBlendShape, triangle, j, submeshWithoutBlendShape, ref vertexCounterWithoutBlendShape); + } + } + if (submeshWithBlendShape.Count > 0) + submeshesWithBlendShape.Add(i, submeshWithBlendShape.ToArray()); + if (submeshWithoutBlendShape.Count > 0) + submeshesWithoutBlendShape.Add(i, submeshWithoutBlendShape.ToArray()); ; + } + + // check if any BlendShape exists + if (submeshesWithoutBlendShape.Count > 0) + { + // put the mesh without BlendShape in a new SkinnedMeshRenderer + var srcGameObject = skinnedMeshRendererInput.gameObject; + var srcTransform = skinnedMeshRendererInput.transform.parent; + var targetObjectForMeshWithoutBS = GameObject.Instantiate(srcGameObject); + targetObjectForMeshWithoutBS.name = srcGameObject.name + "_WithoutBlendShape"; + targetObjectForMeshWithoutBS.transform.SetParent(srcTransform); + var skinnedMeshRendererWithoutBS = targetObjectForMeshWithoutBS.GetComponent(); + + // build meshes with/without BlendShape + BuildNewMesh(skinnedMeshRendererInput, vertexIndexWithBlendShape, submeshesWithBlendShape, BlendShapeLogic.WithBlendShape); + BuildNewMesh(skinnedMeshRendererWithoutBS, vertexIndexWithoutBlendShape, submeshesWithoutBlendShape, BlendShapeLogic.WithoutBlendShape); + } + } + + private static void BuildNewTriangleList(Dictionary newVerticesListLookUp, int[] triangleList, int index, + List newTriangleList, ref int vertexCounter) + { + // build new vertex list and triangle list + // vertex 1 + if (!newVerticesListLookUp.Keys.Contains(triangleList[index])) + { + newVerticesListLookUp.Add(triangleList[index], vertexCounter); + newTriangleList.Add(vertexCounter); + vertexCounter++; + } + else + { + var newVertexIndex = newVerticesListLookUp[triangleList[index]]; + newTriangleList.Add(newVertexIndex); + } + // vertex 2 + if (!newVerticesListLookUp.Keys.Contains(triangleList[index + 1])) + { + newVerticesListLookUp.Add(triangleList[index + 1], vertexCounter); + newTriangleList.Add(vertexCounter); + vertexCounter++; + } + else + { + var newVertexIndex = newVerticesListLookUp[triangleList[index + 1]]; + newTriangleList.Add(newVertexIndex); + } + // vertex 3 + if (!newVerticesListLookUp.Keys.Contains(triangleList[index + 2])) + { + newVerticesListLookUp.Add(triangleList[index + 2], vertexCounter); + newTriangleList.Add(vertexCounter); + vertexCounter++; + } + else + { + var newVertexIndex = newVerticesListLookUp[triangleList[index + 2]]; + newTriangleList.Add(newVertexIndex); + } + } + + private static void BuildNewMesh(SkinnedMeshRenderer skinnedMeshRenderer, Dictionary newIndexLookUpDict, + Dictionary subMeshes, BlendShapeLogic blendShapeLabel) + { + // get original mesh data + var materialList = new List(); + skinnedMeshRenderer.GetSharedMaterials(materialList); + var mesh = skinnedMeshRenderer.sharedMesh; + var meshVertices = mesh.vertices; + var meshNormals = mesh.normals; + var meshTangents = mesh.tangents; + var meshColors = mesh.colors; + var meshBoneWeights = mesh.boneWeights; + var meshUVs = mesh.uv; + + // build new mesh + var materialListNew = new List(); + var newMesh = new Mesh(); + + if (mesh.vertexCount > ushort.MaxValue) + { +#if UNITY_2017_3_OR_NEWER + Debug.LogFormat("exceed 65535 vertices: {0}", mesh.vertexCount); + newMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32; +#else + throw new NotImplementedException(String.Format("exceed 65535 vertices: {0}", integrator.Positions.Count.ToString())); +#endif + } + + var newDataLength = newIndexLookUpDict.Count; + var newIndexLookUp = newIndexLookUpDict.Keys.ToArray(); + + newMesh.vertices = newIndexLookUp.Select(x => meshVertices[x]).ToArray(); + if (meshNormals.Length > 0) newMesh.normals = newIndexLookUp.Select(x => meshNormals[x]).ToArray(); + if (meshTangents.Length > 0) newMesh.tangents = newIndexLookUp.Select(x => meshTangents[x]).ToArray(); + if (meshColors.Length > 0) newMesh.colors = newIndexLookUp.Select(x => meshColors[x]).ToArray(); + if (meshBoneWeights.Length > 0) newMesh.boneWeights = newIndexLookUp.Select(x => meshBoneWeights[x]).ToArray(); + if (meshUVs.Length > 0) newMesh.uv = newIndexLookUp.Select(x => meshUVs[x]).ToArray(); + newMesh.bindposes = mesh.bindposes; + + // add BlendShape data + if (blendShapeLabel == BlendShapeLogic.WithBlendShape) + { + for (int i = 0; i < mesh.blendShapeCount; i++) + { + // get original BlendShape data + var srcVertices = new Vector3[mesh.vertexCount]; + var srcNormals = new Vector3[mesh.vertexCount]; + var srcTangents = new Vector3[mesh.vertexCount]; + mesh.GetBlendShapeFrameVertices(i, 0, srcVertices, srcNormals, srcTangents); + + // declare the size for the destination array + var dstVertices = new Vector3[newDataLength]; + var dstNormals = new Vector3[newDataLength]; + var dstTangents = new Vector3[newDataLength]; + + dstVertices = newIndexLookUp.Select(x => srcVertices[x]).ToArray(); + dstNormals = newIndexLookUp.Select(x => srcNormals[x]).ToArray(); + dstTangents = newIndexLookUp.Select(x => srcTangents[x]).ToArray(); + newMesh.AddBlendShapeFrame(mesh.GetBlendShapeName(i), mesh.GetBlendShapeFrameWeight(i, 0), + dstVertices, dstNormals, dstTangents); + } + } + + newMesh.subMeshCount = subMeshes.Count; + var cosMaterialIndex = subMeshes.Keys.ToArray(); + + // build material list + for (int i = 0; i < subMeshes.Count; i++) + { + newMesh.SetTriangles(subMeshes[cosMaterialIndex[i]], i); + materialListNew.Add(materialList[cosMaterialIndex[i]]); + } + skinnedMeshRenderer.sharedMaterials = materialListNew.ToArray(); + skinnedMeshRenderer.sharedMesh = newMesh; + + // save mesh as asset + var assetPath = string.Format("{0}{1}", Path.GetFileNameWithoutExtension(mesh.name), ASSET_SUFFIX); + Debug.Log(assetPath); + if (!string.IsNullOrEmpty((AssetDatabase.GetAssetPath(mesh)))) + { + var directory = Path.GetDirectoryName(AssetDatabase.GetAssetPath(mesh)).Replace("\\", "/"); + assetPath = string.Format("{0}/{1}{2}", directory, Path.GetFileNameWithoutExtension(mesh.name) + "_" + blendShapeLabel.ToString(), ASSET_SUFFIX); + } + else + { + assetPath = string.Format("Assets/{0}{1}", Path.GetFileNameWithoutExtension(mesh.name) + "_" + blendShapeLabel.ToString(), ASSET_SUFFIX); + } + Debug.LogFormat("CreateAsset: {0}", assetPath); + AssetDatabase.CreateAsset(newMesh, assetPath); + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.cs.meta new file mode 100644 index 00000000..2fb0aadd --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Editor/MeshUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1bbe850b95e44740bbbb44064e17d25 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/LICENSE.md b/Assets/ThirdParty/VRM/MeshUtility/LICENSE.md new file mode 100644 index 00000000..7a9585e4 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/LICENSE.md @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2020 VRM Consortium + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/LICENSE.md.meta b/Assets/ThirdParty/VRM/MeshUtility/LICENSE.md.meta new file mode 100644 index 00000000..6462af9e --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/LICENSE.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5759a25d3024bd94a92b0af38bac243c +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/README.md b/Assets/ThirdParty/VRM/MeshUtility/README.md new file mode 100644 index 00000000..c96f8f90 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/README.md @@ -0,0 +1,58 @@ +# MeshUtility + +Mesh processing tool in Unity platform. + +## Utilities + +### MeshSeparator + +Separate the target mesh into different categories based on given conditions. + +Currently support BlendShape mesh separation. See [documentation](Documentation/notes/MeshSeparator.md) for more details. + + + +### MeshIntegrator + +Integrate all the meshes of a Prefab (Project window). + +### Integrate Static Mesh + +Integrate all the static meshes in the Hierarchy (Root and its children). + +### MeshNormalizer + +Bake the Hierarchy. This is VRM normalize backend. +MeshNormalizer can do blendShape bake. + +## Import MeshUtility + +There are two ways to import MeshUtility into a Unity project. + +### 1. Unity Package Manager (from Unity 2019) + +You can add MeshUtility package via `UPM`. First click `Window` from menu on top, then select `Package Manager`. + + + +In `Package Manager`, click `Add package from git URL` and paste `https://github.com/vrm-c/UniVRM.git?path=/Assets/MeshUtility`. + + + +Now check your project window. You shall see MeshUtility in the `Packages` folder. + +### 2. Add package name and its url in manifest.json + +Another way of importing MeshUtility is manually adding necessary information in manifest.json, which is in the directory of `Package folder` in your Unity project. Open manifest.json with text editor and add the followings in `dependencies`: + +```json +{ + "dependencies": { + "com.vrmc.meshutility": "https://github.com/vrm-c/UniVRM.git?path=/Assets/MeshUtility", + } +} +``` + +Go back to the Unity project. The system will automatically load the package. + + \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/README.md.meta b/Assets/ThirdParty/VRM/MeshUtility/README.md.meta new file mode 100644 index 00000000..b5c1eb77 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: febba2ec3ea2c9247ab21226ce81f924 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/README.url b/Assets/ThirdParty/VRM/MeshUtility/README.url new file mode 100644 index 00000000..79542bae --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/README.url @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=https://github.com/vrm-c/UniVRM/tree/master/Assets/MeshUtility \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/README.url.meta b/Assets/ThirdParty/VRM/MeshUtility/README.url.meta new file mode 100644 index 00000000..6ee109b6 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/README.url.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 42e2fc8311d7ef44fa3975996ba1645d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime.meta new file mode 100644 index 00000000..3b08e959 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fc6ddf08077eac64fb9e33738e1c314d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/BindposeGizmo.cs b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BindposeGizmo.cs new file mode 100644 index 00000000..23e233e5 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BindposeGizmo.cs @@ -0,0 +1,158 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +// using UniGLTF; +#if UNITY_EDITOR +using UnityEditor; +#endif + + +namespace MeshUtility +{ + [DisallowMultipleComponent] + public class BindposeGizmo : MonoBehaviour + { + [SerializeField] + Mesh m_target; + + [SerializeField] + float[] m_boneWeights; + + [SerializeField, Range(0.1f, 1.0f)] + float m_gizmoSize = 0.02f; + + [SerializeField] + Color m_meshGizmoColor = Color.yellow; + + [SerializeField] + Color m_bindGizmoColor = Color.red; + + private void Reset() + { + var renderer = GetComponent(); + if (renderer == null) return; + m_target = renderer.sharedMesh; + } + +#if UNITY_EDITOR + #region ToBindpose + [ContextMenu("ToBindpose")] + void ToBindpose() + { + var renderer = GetComponent(); + + var root = + renderer.bones + .Select(x => Ancestors(x).Reverse().ToArray()) + .Aggregate((a, b) => + { + int i = 0; + for (; i < a.Length && i < b.Length; ++i) + { + if (a[i] != b[i]) + { + break; + } + } + return a.Take(i).ToArray(); + }) + .Last() + ; + + var map = new Dictionary(); + for (int i = 0; i < renderer.bones.Length; ++i) + { + map[renderer.bones[i]] = m_target.bindposes[i]; + } + + { + var bones = Traverse(root); + Undo.RecordObjects(bones.ToArray(), "toBindpose"); + + foreach (var x in bones) + { + var bind = default(Matrix4x4); + if (map.TryGetValue(x, out bind)) + { + var toWorld = renderer.transform.localToWorldMatrix * bind.inverse; + x.position = toWorld.GetColumn(3); + x.rotation = toWorld.ExtractRotation(); + } + } + + //EditorUtility.SetDirty(transform); + } + } + + IEnumerable Traverse(Transform self) + { + yield return self; + + foreach (Transform child in self) + { + foreach (var x in Traverse(child)) + { + yield return x; + } + } + } + + IEnumerable Ancestors(Transform self) + { + yield return self; + + if (self.parent != null) + { + foreach (var x in Ancestors(self.parent)) + { + yield return x; + } + } + } + #endregion +#endif + + private void OnDrawGizmos() + { + if (m_target == null) + { + return; + } + + Gizmos.matrix = transform.localToWorldMatrix; + + if (m_target.bindposes != null && m_target.bindposes.Length > 0) + { + if (m_boneWeights == null || m_boneWeights.Length != m_target.bindposes.Length) + { + m_boneWeights = new float[m_target.bindposes.Length]; + foreach (var bw in m_target.boneWeights) + { + if (bw.weight0 > 0) m_boneWeights[bw.boneIndex0] += bw.weight0; + if (bw.weight1 > 0) m_boneWeights[bw.boneIndex1] += bw.weight1; + if (bw.weight2 > 0) m_boneWeights[bw.boneIndex2] += bw.weight2; + if (bw.weight3 > 0) m_boneWeights[bw.boneIndex3] += bw.weight3; + } + } + + Gizmos.color = m_meshGizmoColor; + Gizmos.DrawWireMesh(m_target); + + for (var i = 0; i < m_target.bindposes.Length; ++i) + { + var color = m_bindGizmoColor * m_boneWeights[i]; + color.a = 1.0f; + Gizmos.color = color; + + Gizmos.matrix = transform.localToWorldMatrix * m_target.bindposes[i].inverse; + Gizmos.DrawWireCube(Vector3.zero, Vector3.one * m_gizmoSize); + } + } + else + { + Gizmos.color = Color.gray; + Gizmos.DrawWireMesh(m_target); + } + } + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/BindposeGizmo.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BindposeGizmo.cs.meta new file mode 100644 index 00000000..1567b1e4 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BindposeGizmo.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3ada4f7077a352343aed57e71a58885d +timeCreated: 1518245944 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneMeshEraser.cs b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneMeshEraser.cs new file mode 100644 index 00000000..64ee850d --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneMeshEraser.cs @@ -0,0 +1,166 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + + +namespace MeshUtility +{ + public static class BoneMeshEraser + { + private struct ExcludeBoneIndex + { + public readonly bool Bone0; + public readonly bool Bone1; + public readonly bool Bone2; + public readonly bool Bone3; + + public ExcludeBoneIndex(bool bone0, bool bone1, bool bone2, bool bone3) + { + Bone0 = bone0; + Bone1 = bone1; + Bone2 = bone2; + Bone3 = bone3; + } + } + + [Serializable] + public struct EraseBone + { + public Transform Bone; + public bool Erase; + + public override string ToString() + { + return Bone.name + ":" + Erase; + } + } + + static int ExcludeTriangles(int[] triangles, BoneWeight[] bws, int[] exclude) + { + int count = 0; + if (bws != null && bws.Length > 0) + { + for (int i = 0; i < triangles.Length; i += 3) + { + var a = triangles[i]; + var b = triangles[i + 1]; + var c = triangles[i + 2]; + + { + var bw = bws[a]; + var eb = AreBoneContains(ref exclude, bw.boneIndex0, bw.boneIndex1, bw.boneIndex2, bw.boneIndex3); + if (bw.weight0 > 0 && eb.Bone0) continue; + if (bw.weight1 > 0 && eb.Bone1) continue; + if (bw.weight2 > 0 && eb.Bone2) continue; + if (bw.weight3 > 0 && eb.Bone3) continue; + } + { + var bw = bws[b]; + var eb = AreBoneContains(ref exclude, bw.boneIndex0, bw.boneIndex1, bw.boneIndex2, bw.boneIndex3); + if (bw.weight0 > 0 && eb.Bone0) continue; + if (bw.weight1 > 0 && eb.Bone1) continue; + if (bw.weight2 > 0 && eb.Bone2) continue; + if (bw.weight3 > 0 && eb.Bone3) continue; + } + { + var bw = bws[c]; + var eb = AreBoneContains(ref exclude, bw.boneIndex0, bw.boneIndex1, bw.boneIndex2, bw.boneIndex3); + if (bw.weight0 > 0 && eb.Bone0) continue; + if (bw.weight1 > 0 && eb.Bone1) continue; + if (bw.weight2 > 0 && eb.Bone2) continue; + if (bw.weight3 > 0 && eb.Bone3) continue; + } + + triangles[count++] = a; + triangles[count++] = b; + triangles[count++] = c; + } + } + + return count; + } + + private static ExcludeBoneIndex AreBoneContains(ref int[] exclude, int boneIndex0, int boneIndex1, + int boneIndex2, int boneIndex3) + { + var b0 = false; + var b1 = false; + var b2 = false; + var b3 = false; + for (int i = 0; i < exclude.Length; i++) + { + if (exclude[i] == boneIndex0) + { + b0 = true; + continue; + } + + if (exclude[i] == boneIndex1) + { + b1 = true; + continue; + } + + if (exclude[i] == boneIndex2) + { + b2 = true; + continue; + } + + if (exclude[i] == boneIndex3) + { + b3 = true; + } + } + + return new ExcludeBoneIndex(b0, b1, b2, b3); + } + + public static Mesh CreateErasedMesh(Mesh src, int[] eraseBoneIndices) + { + /* + Debug.LogFormat("{0} exclude: {1}", + src.name, + String.Join(", ", eraseBoneIndices.Select(x => x.ToString()).ToArray()) + ); + */ + var mesh = new Mesh(); + mesh.name = src.name + "(erased)"; + +#if UNITY_2017_3_OR_NEWER + mesh.indexFormat = src.indexFormat; +#endif + + mesh.vertices = src.vertices; + mesh.normals = src.normals; + mesh.uv = src.uv; + mesh.tangents = src.tangents; + mesh.boneWeights = src.boneWeights; + mesh.bindposes = src.bindposes; + mesh.subMeshCount = src.subMeshCount; + for (int i = 0; i < src.subMeshCount; ++i) + { + var indices = src.GetIndices(i); + var count = ExcludeTriangles(indices, mesh.boneWeights, eraseBoneIndices); + var dst = new int[count]; + Array.Copy(indices, 0, dst, 0, count); + mesh.SetIndices(dst, MeshTopology.Triangles, i); + } + + return mesh; + } + + public static IEnumerable Ancestor(this Transform t) + { + yield return t; + + if (t.parent != null) + { + foreach (var x in Ancestor(t.parent)) + { + yield return x; + } + } + } + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneMeshEraser.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneMeshEraser.cs.meta new file mode 100644 index 00000000..db633e87 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneMeshEraser.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 270bf7461f6f8d546ae540cb7d5fc6f3 +timeCreated: 1519018975 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneNormalizer.cs b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneNormalizer.cs new file mode 100644 index 00000000..b5f5231c --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneNormalizer.cs @@ -0,0 +1,507 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + + +namespace MeshUtility +{ + public static class BoneNormalizer + { + public delegate Avatar CreateAvatarFunc(GameObject original, GameObject normalized, Dictionary boneMap); + + static (GameObject, Dictionary) NormalizeHierarchy(GameObject go, CreateAvatarFunc createAvatar) + { + var boneMap = new Dictionary(); + + // + // 回転・スケールの無いヒエラルキーをコピーする + // + var normalized = new GameObject(go.name + "(normalized)"); + normalized.transform.position = go.transform.position; + CopyAndBuild(go.transform, normalized.transform, boneMap); + + // + // 新しいヒエラルキーからAvatarを作る + // + { + var animator = normalized.AddComponent(); + var avatar = createAvatar(go, normalized, boneMap); + avatar.name = go.name + ".normalized"; + animator.avatar = avatar; + } + + return (normalized, boneMap); + } + + /// + /// 回転とスケールを除去したヒエラルキーをコピーする。 + /// + /// + /// + static void CopyAndBuild(Transform src, Transform dst, Dictionary boneMap) + { + boneMap[src] = dst; + + foreach (Transform child in src) + { + if (child.gameObject.activeSelf) + { + var dstChild = new GameObject(child.name); + dstChild.transform.SetParent(dst); + dstChild.transform.position = child.position; // copy position only + + CopyAndBuild(child, dstChild.transform, boneMap); + } + } + } + + class BlendShapeReport + { + string m_name; + int m_count; + struct BlendShapeStat + { + public int Index; + public string Name; + public int VertexCount; + public int NormalCount; + public int TangentCount; + + public override string ToString() + { + return string.Format("[{0}]{1}: {2}, {3}, {4}\n", Index, Name, VertexCount, NormalCount, TangentCount); + } + } + List m_stats = new List(); + public int Count + { + get { return m_stats.Count; } + } + public BlendShapeReport(Mesh mesh) + { + m_name = mesh.name; + m_count = mesh.vertexCount; + } + public void SetCount(int index, string name, int v, int n, int t) + { + m_stats.Add(new BlendShapeStat + { + Index = index, + Name = name, + VertexCount = v, + NormalCount = n, + TangentCount = t, + }); + } + public override string ToString() + { + return String.Format("NormalizeSkinnedMesh: {0}({1}verts)\n{2}", + m_name, + m_count, + String.Join("", m_stats.Select(x => x.ToString()).ToArray())); + } + } + + /// + /// index が 有効であれば、setter に weight を渡す。無効であれば setter に 0 を渡す。 + /// + /// + /// + /// + /// + static bool CopyOrDropWeight(int[] indexMap, int srcIndex, float weight, Action setter) + { + if (srcIndex < 0 || srcIndex >= indexMap.Length) + { + // ありえるかどうかわからないが BoneWeight.boneIndexN に変な値が入っている. + setter(0, 0); + return false; + } + + var dstIndex = indexMap[srcIndex]; + if (dstIndex != -1) + { + // 有効なindex。weightをコピーする + setter(dstIndex, weight); + return true; + } + else + { + // 無効なindex。0でクリアする + setter(0, 0); + return false; + } + } + + /// + /// BoneWeight[] src から新しいボーンウェイトを作成する。 + /// + /// 変更前のBoneWeight[] + /// 新旧のボーンの対応表。新しい方は無効なボーンが除去されてnullの部分がある + /// 変更前のボーン配列 + /// 変更後のボーン配列。除去されたボーンがある場合、変更前より短い + /// + public static BoneWeight[] MapBoneWeight(BoneWeight[] src, + Dictionary boneMap, + Transform[] srcBones, + Transform[] dstBones + ) + { + // 処理前後の index の対応表を作成する + var indexMap = new int[srcBones.Length]; + for (int i = 0; i < srcBones.Length; ++i) + { + var srcBone = srcBones[i]; + if (srcBone == null) + { + // 元のボーンが無い + indexMap[i] = -1; + Debug.LogWarningFormat("bones[{0}] is null", i); + } + else + { + if (boneMap.TryGetValue(srcBone, out Transform dstBone)) + { + // 対応するボーンが存在する + var dstIndex = Array.IndexOf(dstBones, dstBone); + if (dstIndex == -1) + { + // ありえない。バグ + throw new Exception(); + } + indexMap[i] = dstIndex; + } + else + { + // 先のボーンが無い + indexMap[i] = -1; + Debug.LogWarningFormat("{0} is removed", srcBone.name); + } + } + } + + // 新しいBoneWeightを作成する + var newBoneWeights = new BoneWeight[src.Length]; + for (int i = 0; i < src.Length; ++i) + { + BoneWeight srcBoneWeight = src[i]; + + // 0 + CopyOrDropWeight(indexMap, srcBoneWeight.boneIndex0, srcBoneWeight.weight0, (newIndex, newWeight) => + { + newBoneWeights[i].boneIndex0 = newIndex; + newBoneWeights[i].weight0 = newWeight; + }); + // 1 + CopyOrDropWeight(indexMap, srcBoneWeight.boneIndex1, srcBoneWeight.weight1, (newIndex, newWeight) => + { + newBoneWeights[i].boneIndex1 = newIndex; + newBoneWeights[i].weight1 = newWeight; + }); + // 2 + CopyOrDropWeight(indexMap, srcBoneWeight.boneIndex2, srcBoneWeight.weight2, (newIndex, newWeight) => + { + newBoneWeights[i].boneIndex2 = newIndex; + newBoneWeights[i].weight2 = newWeight; + }); + // 3 + CopyOrDropWeight(indexMap, srcBoneWeight.boneIndex3, srcBoneWeight.weight3, (newIndex, newWeight) => + { + newBoneWeights[i].boneIndex3 = newIndex; + newBoneWeights[i].weight3 = newWeight; + }); + } + + return newBoneWeights; + } + + /// + /// srcのSkinnedMeshRendererを正規化して、dstにアタッチする + /// + /// 正規化前のSkinnedMeshRendererのTransform + /// 正規化後のSkinnedMeshRendererのTransform + /// 正規化前のボーンから正規化後のボーンを得る + static void NormalizeSkinnedMesh(Transform src, Transform dst, Dictionary boneMap, bool clearBlendShape) + { + var srcRenderer = src.GetComponent(); + if (srcRenderer == null + || !srcRenderer.enabled + || srcRenderer.sharedMesh == null + || srcRenderer.sharedMesh.vertexCount == 0) + { + // 有効なSkinnedMeshRendererが無かった + return; + } + + var srcMesh = srcRenderer.sharedMesh; + var originalSrcMesh = srcMesh; + + // clear blendShape + if (clearBlendShape) + { + for (int i = 0; i < srcMesh.blendShapeCount; ++i) + { + srcRenderer.SetBlendShapeWeight(i, 0); + } + } + + // 元の Transform[] bones から、無効なboneを取り除いて前に詰めた配列を作る + var dstBones = srcRenderer.bones + .Where(x => x != null && boneMap.ContainsKey(x)) + .Select(x => boneMap[x]) + .ToArray(); + + var hasBoneWeight = srcRenderer.bones != null && srcRenderer.bones.Length > 0; + if (!hasBoneWeight) + { + // Before bake, bind no weight bones + //Debug.LogFormat("no weight: {0}", srcMesh.name); + + srcMesh = srcMesh.Copy(true); + var bw = new BoneWeight + { + boneIndex0 = 0, + boneIndex1 = 0, + boneIndex2 = 0, + boneIndex3 = 0, + weight0 = 1.0f, + weight1 = 0.0f, + weight2 = 0.0f, + weight3 = 0.0f, + }; + srcMesh.boneWeights = Enumerable.Range(0, srcMesh.vertexCount).Select(x => bw).ToArray(); + srcMesh.bindposes = new Matrix4x4[] { Matrix4x4.identity }; + + srcRenderer.rootBone = srcRenderer.transform; + dstBones = new[] { boneMap[srcRenderer.transform] }; + srcRenderer.bones = new[] { srcRenderer.transform }; + srcRenderer.sharedMesh = srcMesh; + } + + // BakeMesh + var mesh = srcMesh.Copy(false); + mesh.name = srcMesh.name + ".baked"; + srcRenderer.BakeMesh(mesh); + + var blendShapeValues = new Dictionary(); + for (int i = 0; i < srcMesh.blendShapeCount; i++) + { + var val = srcRenderer.GetBlendShapeWeight(i); + if (val > 0) blendShapeValues.Add(i, val); + } + + // 新しい骨格のボーンウェイトを作成する + mesh.boneWeights = MapBoneWeight(srcMesh.boneWeights, boneMap, srcRenderer.bones, dstBones); + + // recalc bindposes + mesh.bindposes = dstBones.Select(x => x.worldToLocalMatrix * dst.transform.localToWorldMatrix).ToArray(); + + //var m = src.localToWorldMatrix; // include scaling + var m = default(Matrix4x4); + m.SetTRS(Vector3.zero, src.rotation, Vector3.one); // rotation only + mesh.ApplyMatrix(m); + + // + // BlendShapes + // + var meshVertices = mesh.vertices; + var meshNormals = mesh.normals; +#if VRM_NORMALIZE_BLENDSHAPE_TANGENT + var meshTangents = mesh.tangents.Select(x => (Vector3)x).ToArray(); +#endif + + var originalBlendShapePositions = new Vector3[meshVertices.Length]; + var originalBlendShapeNormals = new Vector3[meshVertices.Length]; + var originalBlendShapeTangents = new Vector3[meshVertices.Length]; + + var report = new BlendShapeReport(srcMesh); + var blendShapeMesh = new Mesh(); + for (int i = 0; i < srcMesh.blendShapeCount; ++i) + { + // check blendShape + srcRenderer.sharedMesh.GetBlendShapeFrameVertices(i, 0, originalBlendShapePositions, originalBlendShapeNormals, originalBlendShapeTangents); + var hasVertices = originalBlendShapePositions.Count(x => x != Vector3.zero); + var hasNormals = originalBlendShapeNormals.Count(x => x != Vector3.zero); +#if VRM_NORMALIZE_BLENDSHAPE_TANGENT + var hasTangents = originalBlendShapeTangents.Count(x => x != Vector3.zero); +#else + var hasTangents = 0; +#endif + var name = srcMesh.GetBlendShapeName(i); + if (string.IsNullOrEmpty(name)) + { + name = String.Format("{0}", i); + } + + report.SetCount(i, name, hasVertices, hasNormals, hasTangents); + + srcRenderer.SetBlendShapeWeight(i, 100.0f); + srcRenderer.BakeMesh(blendShapeMesh); + if (blendShapeMesh.vertices.Length != mesh.vertices.Length) + { + throw new Exception("different vertex count"); + } + + var value = blendShapeValues.ContainsKey(i) ? blendShapeValues[i] : 0; + srcRenderer.SetBlendShapeWeight(i, value); + + Vector3[] vertices = blendShapeMesh.vertices; + + for (int j = 0; j < vertices.Length; ++j) + { + if (originalBlendShapePositions[j] == Vector3.zero) + { + vertices[j] = Vector3.zero; + } + else + { + vertices[j] = m.MultiplyPoint(vertices[j]) - meshVertices[j]; + } + } + + Vector3[] normals = blendShapeMesh.normals; + for (int j = 0; j < normals.Length; ++j) + { + if (originalBlendShapeNormals[j] == Vector3.zero) + { + normals[j] = Vector3.zero; + + } + else + { + normals[j] = m.MultiplyVector(normals[j]) - meshNormals[j]; + } + } + + Vector3[] tangents = blendShapeMesh.tangents.Select(x => (Vector3)x).ToArray(); +#if VRM_NORMALIZE_BLENDSHAPE_TANGENT + for (int j = 0; j < tangents.Length; ++j) + { + if (originalBlendShapeTangents[j] == Vector3.zero) + { + tangents[j] = Vector3.zero; + } + else + { + tangents[j] = m.MultiplyVector(tangents[j]) - meshTangents[j]; + } + } +#endif + + var frameCount = srcMesh.GetBlendShapeFrameCount(i); + for (int f = 0; f < frameCount; f++) + { + + var weight = srcMesh.GetBlendShapeFrameWeight(i, f); + + try + { + mesh.AddBlendShapeFrame(name, + weight, + vertices, + hasNormals > 0 ? normals : null, + hasTangents > 0 ? tangents : null + ); + } + catch (Exception) + { + Debug.LogErrorFormat("fail to mesh.AddBlendShapeFrame {0}.{1}", + mesh.name, + srcMesh.GetBlendShapeName(i) + ); + throw; + } + } + } + + if (report.Count > 0) + { + Debug.LogFormat("{0}", report.ToString()); + } + + var dstRenderer = dst.gameObject.AddComponent(); + dstRenderer.sharedMaterials = srcRenderer.sharedMaterials; + if (srcRenderer.rootBone != null) + { + dstRenderer.rootBone = boneMap[srcRenderer.rootBone]; + } + dstRenderer.bones = dstBones; + dstRenderer.sharedMesh = mesh; + + if (!hasBoneWeight) + { + // restore bones + srcRenderer.bones = new Transform[] { }; + srcRenderer.sharedMesh = originalSrcMesh; + } + } + + /// + /// + /// + /// + /// + static void NormalizeNoneSkinnedMesh(Transform src, Transform dst) + { + var srcFilter = src.GetComponent(); + if (srcFilter == null + || srcFilter.sharedMesh == null + || srcFilter.sharedMesh.vertexCount == 0) + { + return; + } + + var srcRenderer = src.GetComponent(); + if (srcRenderer == null || !srcRenderer.enabled) + { + return; + } + + // Meshに乗っているボーンの姿勢を適用する + var dstFilter = dst.gameObject.AddComponent(); + + var dstMesh = srcFilter.sharedMesh.Copy(false); + dstMesh.ApplyRotationAndScale(src.localToWorldMatrix); + dstFilter.sharedMesh = dstMesh; + + // Materialをコピー + var dstRenderer = dst.gameObject.AddComponent(); + dstRenderer.sharedMaterials = srcRenderer.sharedMaterials; + } + + /// + /// 回転とスケールを除去したヒエラルキーのコピーを作成する(MeshをBakeする) + /// + /// 対象のヒエラルキーのルート + /// BlendShapeを0クリアするか否か。false の場合 BlendShape の現状を Bake する + /// Avatarを作る関数 + /// + public static (GameObject, Dictionary) Execute(GameObject go, + bool clearBlendShapeBeforeNormalize, CreateAvatarFunc createAvatar) + { + // + // 正規化されたヒエラルキーを作る + // + var (normalized, boneMap) = NormalizeHierarchy(go, createAvatar); + + // + // 各メッシュから回転・スケールを取り除いてBinding行列を再計算する + // + foreach (var src in go.transform.Traverse()) + { + Transform dst; + if (!boneMap.TryGetValue(src, out dst)) + { + continue; + } + + NormalizeSkinnedMesh(src, dst, boneMap, clearBlendShapeBeforeNormalize); + + NormalizeNoneSkinnedMesh(src, dst); + } + + return (normalized, boneMap); + } + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneNormalizer.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneNormalizer.cs.meta new file mode 100644 index 00000000..4663d268 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/BoneNormalizer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b330ec419f98af14687c302638922ab0 +timeCreated: 1519379418 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/Humanoid.cs b/Assets/ThirdParty/VRM/MeshUtility/Runtime/Humanoid.cs new file mode 100644 index 00000000..c6d61948 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/Humanoid.cs @@ -0,0 +1,441 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace MeshUtility +{ + /// + /// Bone割り当てを保持する。 + /// ヒエラルキーのルート(おそらくHipsの親)にアタッチする + /// + [DisallowMultipleComponent] + public class Humanoid : MonoBehaviour + { + [SerializeField] private Transform m_Hips; public Transform Hips => m_Hips; + + #region leg + [SerializeField] private Transform m_LeftUpperLeg; public Transform LeftUpperLeg => m_LeftUpperLeg; + [SerializeField] private Transform m_RightUpperLeg; public Transform RightUpperLeg => m_RightUpperLeg; + [SerializeField] private Transform m_LeftLowerLeg; public Transform LeftLowerLeg => m_LeftLowerLeg; + [SerializeField] private Transform m_RightLowerLeg; public Transform RightLowerLeg => m_RightLowerLeg; + [SerializeField] private Transform m_LeftFoot; public Transform LeftFoot => m_LeftFoot; + [SerializeField] private Transform m_RightFoot; public Transform RightFoot => m_RightFoot; + [SerializeField] private Transform m_LeftToes; public Transform LeftToes => m_LeftToes; + [SerializeField] private Transform m_RightToes; public Transform RightToes => m_RightToes; + #endregion + + #region spine + [SerializeField] private Transform m_Spine; public Transform Spine => m_Spine; + [SerializeField] private Transform m_Chest; public Transform Chest => m_Chest; + [SerializeField] private Transform m_UpperChest; public Transform UpperChest => m_UpperChest; + [SerializeField] private Transform m_Neck; public Transform Neck => m_Neck; + [SerializeField] private Transform m_Head; public Transform Head => m_Head; + [SerializeField] private Transform m_LeftEye; public Transform LeftEye => m_LeftEye; + [SerializeField] private Transform m_RightEye; public Transform RightEye => m_RightEye; + [SerializeField] private Transform m_Jaw; public Transform Jaw => m_Jaw; + #endregion + + #region arm + [SerializeField] private Transform m_LeftShoulder; public Transform LeftShoulder => m_LeftShoulder; + [SerializeField] private Transform m_RightShoulder; public Transform RightShoulder => m_RightShoulder; + [SerializeField] private Transform m_LeftUpperArm; public Transform LeftUpperArm => m_LeftUpperArm; + [SerializeField] private Transform m_RightUpperArm; public Transform RightUpperArm => m_RightUpperArm; + [SerializeField] private Transform m_LeftLowerArm; public Transform LeftLowerArm => m_LeftLowerArm; + [SerializeField] private Transform m_RightLowerArm; public Transform RightLowerArm => m_RightLowerArm; + [SerializeField] private Transform m_LeftHand; public Transform LeftHand => m_LeftHand; + [SerializeField] private Transform m_RightHand; public Transform RightHand => m_RightHand; + #endregion + + #region fingers + [SerializeField] private Transform m_LeftThumbProximal; public Transform LeftThumbProximal => m_LeftThumbProximal; + [SerializeField] private Transform m_LeftThumbIntermediate; public Transform LeftThumbIntermediate => m_LeftThumbIntermediate; + [SerializeField] private Transform m_LeftThumbDistal; public Transform LeftThumbDistal => m_LeftThumbDistal; + [SerializeField] private Transform m_LeftIndexProximal; public Transform LeftIndexProximal => m_LeftIndexProximal; + [SerializeField] private Transform m_LeftIndexIntermediate; public Transform LeftIndexIntermediate => m_LeftIndexIntermediate; + [SerializeField] private Transform m_LeftIndexDistal; public Transform LeftIndexDistal => m_LeftIndexDistal; + [SerializeField] private Transform m_LeftMiddleProximal; public Transform LeftMiddleProximal => m_LeftMiddleProximal; + [SerializeField] private Transform m_LeftMiddleIntermediate; public Transform LeftMiddleIntermediate => m_LeftMiddleIntermediate; + [SerializeField] private Transform m_LeftMiddleDistal; public Transform LeftMiddleDistal => m_LeftMiddleDistal; + [SerializeField] private Transform m_LeftRingProximal; public Transform LeftRingProximal => m_LeftRingProximal; + [SerializeField] private Transform m_LeftRingIntermediate; public Transform LeftRingIntermediate => m_LeftRingIntermediate; + [SerializeField] private Transform m_LeftRingDistal; public Transform LeftRingDistal => m_LeftRingDistal; + [SerializeField] private Transform m_LeftLittleProximal; public Transform LeftLittleProximal => m_LeftLittleProximal; + [SerializeField] private Transform m_LeftLittleIntermediate; public Transform LeftLittleIntermediate => m_LeftLittleIntermediate; + [SerializeField] private Transform m_LeftLittleDistal; public Transform LeftLittleDistal => m_LeftLittleDistal; + [SerializeField] private Transform m_RightThumbProximal; public Transform RightThumbProximal => m_RightThumbProximal; + [SerializeField] private Transform m_RightThumbIntermediate; public Transform RightThumbIntermediate => m_RightThumbIntermediate; + [SerializeField] private Transform m_RightThumbDistal; public Transform RightThumbDistal => m_RightThumbDistal; + [SerializeField] private Transform m_RightIndexProximal; public Transform RightIndexProximal => m_RightIndexProximal; + [SerializeField] private Transform m_RightIndexIntermediate; public Transform RightIndexIntermediate => m_RightIndexIntermediate; + [SerializeField] private Transform m_RightIndexDistal; public Transform RightIndexDistal => m_RightIndexDistal; + [SerializeField] private Transform m_RightMiddleProximal; public Transform RightMiddleProximal => m_RightMiddleProximal; + [SerializeField] private Transform m_RightMiddleIntermediate; public Transform RightMiddleIntermediate => m_RightMiddleIntermediate; + [SerializeField] private Transform m_RightMiddleDistal; public Transform RightMiddleDistal => m_RightMiddleDistal; + [SerializeField] private Transform m_RightRingProximal; public Transform RightRingProximal => m_RightRingProximal; + [SerializeField] private Transform m_RightRingIntermediate; public Transform RightRingIntermediate => m_RightRingIntermediate; + [SerializeField] private Transform m_RightRingDistal; public Transform RightRingDistal => m_RightRingDistal; + [SerializeField] private Transform m_RightLittleProximal; public Transform RightLittleProximal => m_RightLittleProximal; + [SerializeField] private Transform m_RightLittleIntermediate; public Transform RightLittleIntermediate => m_RightLittleIntermediate; + [SerializeField] private Transform m_RightLittleDistal; public Transform RightLittleDistal => m_RightLittleDistal; + #endregion + + void Reset() + { + AssignBonesFromAnimator(); + } + + public struct Validation + { + public readonly string Message; + public readonly bool IsError; + + public Validation(string message, bool isError) + { + Message = message; + IsError = isError; + } + } + + IEnumerable Required(params (string, Transform)[] props) + { + foreach (var prop in props) + { + if (prop.Item2 == null) + { + var name = prop.Item1; + if (name.StartsWith("m_")) + { + name = name.Substring(2); + } + yield return new Validation($"{name} is Required", true); + } + } + } + + static Vector3 GetForward(Transform l, Transform r) + { + if (l == null || r == null) + { + return Vector3.zero; + } + var lr = (r.position - l.position).normalized; + return Vector3.Cross(lr, Vector3.up); + } + + public Vector3 GetForward() + { + return GetForward(m_LeftUpperLeg, m_RightUpperLeg); + } + + public IEnumerable Validate() + { + foreach (var validation in Required( + (nameof(m_Hips), m_Hips), (nameof(m_Spine), m_Spine), (nameof(m_Head), m_Head), + (nameof(m_LeftUpperLeg), m_LeftUpperLeg), (nameof(m_LeftLowerLeg), m_LeftLowerLeg), (nameof(m_LeftFoot), m_LeftFoot), + (nameof(m_RightUpperLeg), m_RightUpperLeg), (nameof(m_RightLowerLeg), m_RightLowerLeg), (nameof(m_RightFoot), m_RightFoot), + (nameof(m_LeftUpperArm), m_LeftUpperArm), (nameof(m_LeftLowerArm), m_LeftLowerArm), (nameof(m_LeftHand), m_LeftHand), + (nameof(m_RightUpperArm), m_RightUpperArm), (nameof(m_RightLowerArm), m_RightLowerArm), (nameof(m_RightHand), m_RightHand) + )) + { + yield return validation; + } + + // var forward = GetForward(); + // if (Vector3.Dot(Vector3.forward, forward) < 0.5f) + // { + // yield return new Validation("Not facing the Z-axis positive direction", true); + // } + } + + /// + /// ボーン割り当てから UnityEngine.Avatar を生成する + /// + /// + public Avatar CreateAvatar() + { + return HumanoidLoader.LoadHumanoidAvatar(transform, BoneMap); + } + + public Transform GetBoneTransform(HumanBodyBones bone) + { + switch (bone) + { + case HumanBodyBones.Hips: return Hips; + + #region leg + case HumanBodyBones.LeftUpperLeg: return LeftUpperLeg; + case HumanBodyBones.RightUpperLeg: return RightUpperLeg; + case HumanBodyBones.LeftLowerLeg: return LeftLowerLeg; + case HumanBodyBones.RightLowerLeg: return RightLowerLeg; + case HumanBodyBones.LeftFoot: return LeftFoot; + case HumanBodyBones.RightFoot: return RightFoot; + case HumanBodyBones.LeftToes: return LeftToes; + case HumanBodyBones.RightToes: return RightToes; + #endregion + + #region spine + case HumanBodyBones.Spine: return Spine; + case HumanBodyBones.Chest: return Chest; + case HumanBodyBones.UpperChest: return UpperChest; + case HumanBodyBones.Neck: return Neck; + case HumanBodyBones.Head: return Head; + case HumanBodyBones.LeftEye: return LeftEye; + case HumanBodyBones.RightEye: return RightEye; + case HumanBodyBones.Jaw: return Jaw; + #endregion + + #region arm + case HumanBodyBones.LeftShoulder: return LeftShoulder; + case HumanBodyBones.RightShoulder: return RightShoulder; + case HumanBodyBones.LeftUpperArm: return LeftUpperArm; + case HumanBodyBones.RightUpperArm: return RightUpperArm; + case HumanBodyBones.LeftLowerArm: return LeftLowerArm; + case HumanBodyBones.RightLowerArm: return RightLowerArm; + case HumanBodyBones.LeftHand: return LeftHand; + case HumanBodyBones.RightHand: return RightHand; + #endregion + + #region fingers + case HumanBodyBones.LeftThumbProximal: return LeftThumbProximal; + case HumanBodyBones.LeftThumbIntermediate: return LeftThumbIntermediate; + case HumanBodyBones.LeftThumbDistal: return LeftThumbDistal; + case HumanBodyBones.LeftIndexProximal: return LeftIndexProximal; + case HumanBodyBones.LeftIndexIntermediate: return LeftIndexIntermediate; + case HumanBodyBones.LeftIndexDistal: return LeftIndexDistal; + case HumanBodyBones.LeftMiddleProximal: return LeftMiddleProximal; + case HumanBodyBones.LeftMiddleIntermediate: return LeftMiddleIntermediate; + case HumanBodyBones.LeftMiddleDistal: return LeftMiddleDistal; + case HumanBodyBones.LeftRingProximal: return LeftRingProximal; + case HumanBodyBones.LeftRingIntermediate: return LeftRingIntermediate; + case HumanBodyBones.LeftRingDistal: return LeftRingDistal; + case HumanBodyBones.LeftLittleProximal: return LeftLittleProximal; + case HumanBodyBones.LeftLittleIntermediate: return LeftLittleIntermediate; + case HumanBodyBones.LeftLittleDistal: return LeftLittleDistal; + case HumanBodyBones.RightThumbProximal: return RightThumbProximal; + case HumanBodyBones.RightThumbIntermediate: return RightThumbIntermediate; + case HumanBodyBones.RightThumbDistal: return RightThumbDistal; + case HumanBodyBones.RightIndexProximal: return RightIndexProximal; + case HumanBodyBones.RightIndexIntermediate: return RightIndexIntermediate; + case HumanBodyBones.RightIndexDistal: return RightIndexDistal; + case HumanBodyBones.RightMiddleProximal: return RightMiddleProximal; + case HumanBodyBones.RightMiddleIntermediate: return RightMiddleIntermediate; + case HumanBodyBones.RightMiddleDistal: return RightMiddleDistal; + case HumanBodyBones.RightRingProximal: return RightRingProximal; + case HumanBodyBones.RightRingIntermediate: return RightRingIntermediate; + case HumanBodyBones.RightRingDistal: return RightRingDistal; + case HumanBodyBones.RightLittleProximal: return RightLittleProximal; + case HumanBodyBones.RightLittleIntermediate: return RightLittleIntermediate; + case HumanBodyBones.RightLittleDistal: return RightLittleDistal; + #endregion + + } + + return null; + } + + IEnumerable<(Transform, HumanBodyBones)> BoneMap + { + get + { + if (Hips != null) { yield return (Hips, HumanBodyBones.Hips); } + + #region leg + if (LeftUpperLeg != null) { yield return (LeftUpperLeg, HumanBodyBones.LeftUpperLeg); } + if (RightUpperLeg != null) { yield return (RightUpperLeg, HumanBodyBones.RightUpperLeg); } + if (LeftLowerLeg != null) { yield return (LeftLowerLeg, HumanBodyBones.LeftLowerLeg); } + if (RightLowerLeg != null) { yield return (RightLowerLeg, HumanBodyBones.RightLowerLeg); } + if (LeftFoot != null) { yield return (LeftFoot, HumanBodyBones.LeftFoot); } + if (RightFoot != null) { yield return (RightFoot, HumanBodyBones.RightFoot); } + if (LeftToes != null) { yield return (LeftToes, HumanBodyBones.LeftToes); } + if (RightToes != null) { yield return (RightToes, HumanBodyBones.RightToes); } + #endregion + + #region spine + if (Spine != null) { yield return (Spine, HumanBodyBones.Spine); } + if (Chest != null) { yield return (Chest, HumanBodyBones.Chest); } + if (UpperChest != null) { yield return (UpperChest, HumanBodyBones.UpperChest); } + if (Neck != null) { yield return (Neck, HumanBodyBones.Neck); } + if (Head != null) { yield return (Head, HumanBodyBones.Head); } + if (LeftEye != null) { yield return (LeftEye, HumanBodyBones.LeftEye); } + if (RightEye != null) { yield return (RightEye, HumanBodyBones.RightEye); } + if (Jaw != null) { yield return (Jaw, HumanBodyBones.Jaw); } + #endregion + + #region arm + if (LeftShoulder != null) { yield return (LeftShoulder, HumanBodyBones.LeftShoulder); } + if (RightShoulder != null) { yield return (RightShoulder, HumanBodyBones.RightShoulder); } + if (LeftUpperArm != null) { yield return (LeftUpperArm, HumanBodyBones.LeftUpperArm); } + if (RightUpperArm != null) { yield return (RightUpperArm, HumanBodyBones.RightUpperArm); } + if (LeftLowerArm != null) { yield return (LeftLowerArm, HumanBodyBones.LeftLowerArm); } + if (RightLowerArm != null) { yield return (RightLowerArm, HumanBodyBones.RightLowerArm); } + if (LeftHand != null) { yield return (LeftHand, HumanBodyBones.LeftHand); } + if (RightHand != null) { yield return (RightHand, HumanBodyBones.RightHand); } + #endregion + + #region fingers + if (LeftThumbProximal != null) { yield return (LeftThumbProximal, HumanBodyBones.LeftThumbProximal); } + if (LeftThumbIntermediate != null) { yield return (LeftThumbIntermediate, HumanBodyBones.LeftThumbIntermediate); } + if (LeftThumbDistal != null) { yield return (LeftThumbDistal, HumanBodyBones.LeftThumbDistal); } + if (LeftIndexProximal != null) { yield return (LeftIndexProximal, HumanBodyBones.LeftIndexProximal); } + if (LeftIndexIntermediate != null) { yield return (LeftIndexIntermediate, HumanBodyBones.LeftIndexIntermediate); } + if (LeftIndexDistal != null) { yield return (LeftIndexDistal, HumanBodyBones.LeftIndexDistal); } + if (LeftMiddleProximal != null) { yield return (LeftMiddleProximal, HumanBodyBones.LeftMiddleProximal); } + if (LeftMiddleIntermediate != null) { yield return (LeftMiddleIntermediate, HumanBodyBones.LeftMiddleIntermediate); } + if (LeftMiddleDistal != null) { yield return (LeftMiddleDistal, HumanBodyBones.LeftMiddleDistal); } + if (LeftRingProximal != null) { yield return (LeftRingProximal, HumanBodyBones.LeftRingProximal); } + if (LeftRingIntermediate != null) { yield return (LeftRingIntermediate, HumanBodyBones.LeftRingIntermediate); } + if (LeftRingDistal != null) { yield return (LeftRingDistal, HumanBodyBones.LeftRingDistal); } + if (LeftLittleProximal != null) { yield return (LeftLittleProximal, HumanBodyBones.LeftLittleProximal); } + if (LeftLittleIntermediate != null) { yield return (LeftLittleIntermediate, HumanBodyBones.LeftLittleIntermediate); } + if (LeftLittleDistal != null) { yield return (LeftLittleDistal, HumanBodyBones.LeftLittleDistal); } + if (RightThumbProximal != null) { yield return (RightThumbProximal, HumanBodyBones.RightThumbProximal); } + if (RightThumbIntermediate != null) { yield return (RightThumbIntermediate, HumanBodyBones.RightThumbIntermediate); } + if (RightThumbDistal != null) { yield return (RightThumbDistal, HumanBodyBones.RightThumbDistal); } + if (RightIndexProximal != null) { yield return (RightIndexProximal, HumanBodyBones.RightIndexProximal); } + if (RightIndexIntermediate != null) { yield return (RightIndexIntermediate, HumanBodyBones.RightIndexIntermediate); } + if (RightIndexDistal != null) { yield return (RightIndexDistal, HumanBodyBones.RightIndexDistal); } + if (RightMiddleProximal != null) { yield return (RightMiddleProximal, HumanBodyBones.RightMiddleProximal); } + if (RightMiddleIntermediate != null) { yield return (RightMiddleIntermediate, HumanBodyBones.RightMiddleIntermediate); } + if (RightMiddleDistal != null) { yield return (RightMiddleDistal, HumanBodyBones.RightMiddleDistal); } + if (RightRingProximal != null) { yield return (RightRingProximal, HumanBodyBones.RightRingProximal); } + if (RightRingIntermediate != null) { yield return (RightRingIntermediate, HumanBodyBones.RightRingIntermediate); } + if (RightRingDistal != null) { yield return (RightRingDistal, HumanBodyBones.RightRingDistal); } + if (RightLittleProximal != null) { yield return (RightLittleProximal, HumanBodyBones.RightLittleProximal); } + if (RightLittleIntermediate != null) { yield return (RightLittleIntermediate, HumanBodyBones.RightLittleIntermediate); } + if (RightLittleDistal != null) { yield return (RightLittleDistal, HumanBodyBones.RightLittleDistal); } + #endregion + } + } + + /// + /// nodes からボーンを割り当てる + /// + /// + public void AssignBones(IEnumerable<(HumanBodyBones, Transform)> nodes) + { + foreach (var (key, value) in nodes) + { + if (key == HumanBodyBones.LastBone) + { + continue; + } + if (value is null) + { + continue; + } + + switch (key) + { + case HumanBodyBones.Hips: m_Hips = value; break; + + #region leg + case HumanBodyBones.LeftUpperLeg: m_LeftUpperLeg = value; break; + case HumanBodyBones.RightUpperLeg: m_RightUpperLeg = value; break; + case HumanBodyBones.LeftLowerLeg: m_LeftLowerLeg = value; break; + case HumanBodyBones.RightLowerLeg: m_RightLowerLeg = value; break; + case HumanBodyBones.LeftFoot: m_LeftFoot = value; break; + case HumanBodyBones.RightFoot: m_RightFoot = value; break; + case HumanBodyBones.LeftToes: m_LeftToes = value; break; + case HumanBodyBones.RightToes: m_RightToes = value; break; + #endregion + + #region spine + case HumanBodyBones.Spine: m_Spine = value; break; + case HumanBodyBones.Chest: m_Chest = value; break; + case HumanBodyBones.UpperChest: m_UpperChest = value; break; + case HumanBodyBones.Neck: m_Neck = value; break; + case HumanBodyBones.Head: m_Head = value; break; + case HumanBodyBones.LeftEye: m_LeftEye = value; break; + case HumanBodyBones.RightEye: m_RightEye = value; break; + case HumanBodyBones.Jaw: m_Jaw = value; break; + #endregion + + #region arm + case HumanBodyBones.LeftShoulder: m_LeftShoulder = value; break; + case HumanBodyBones.RightShoulder: m_RightShoulder = value; break; + case HumanBodyBones.LeftUpperArm: m_LeftUpperArm = value; break; + case HumanBodyBones.RightUpperArm: m_RightUpperArm = value; break; + case HumanBodyBones.LeftLowerArm: m_LeftLowerArm = value; break; + case HumanBodyBones.RightLowerArm: m_RightLowerArm = value; break; + case HumanBodyBones.LeftHand: m_LeftHand = value; break; + case HumanBodyBones.RightHand: m_RightHand = value; break; + #endregion + + #region fingers + case HumanBodyBones.LeftThumbProximal: m_LeftThumbProximal = value; break; + case HumanBodyBones.LeftThumbIntermediate: m_LeftThumbIntermediate = value; break; + case HumanBodyBones.LeftThumbDistal: m_LeftThumbDistal = value; break; + case HumanBodyBones.LeftIndexProximal: m_LeftIndexProximal = value; break; + case HumanBodyBones.LeftIndexIntermediate: m_LeftIndexIntermediate = value; break; + case HumanBodyBones.LeftIndexDistal: m_LeftIndexDistal = value; break; + case HumanBodyBones.LeftMiddleProximal: m_LeftMiddleProximal = value; break; + case HumanBodyBones.LeftMiddleIntermediate: m_LeftMiddleIntermediate = value; break; + case HumanBodyBones.LeftMiddleDistal: m_LeftMiddleDistal = value; break; + case HumanBodyBones.LeftRingProximal: m_LeftRingProximal = value; break; + case HumanBodyBones.LeftRingIntermediate: m_LeftRingIntermediate = value; break; + case HumanBodyBones.LeftRingDistal: m_LeftRingDistal = value; break; + case HumanBodyBones.LeftLittleProximal: m_LeftLittleProximal = value; break; + case HumanBodyBones.LeftLittleIntermediate: m_LeftLittleIntermediate = value; break; + case HumanBodyBones.LeftLittleDistal: m_LeftLittleDistal = value; break; + case HumanBodyBones.RightThumbProximal: m_RightThumbProximal = value; break; + case HumanBodyBones.RightThumbIntermediate: m_RightThumbIntermediate = value; break; + case HumanBodyBones.RightThumbDistal: m_RightThumbDistal = value; break; + case HumanBodyBones.RightIndexProximal: m_RightIndexProximal = value; break; + case HumanBodyBones.RightIndexIntermediate: m_RightIndexIntermediate = value; break; + case HumanBodyBones.RightIndexDistal: m_RightIndexDistal = value; break; + case HumanBodyBones.RightMiddleProximal: m_RightMiddleProximal = value; break; + case HumanBodyBones.RightMiddleIntermediate: m_RightMiddleIntermediate = value; break; + case HumanBodyBones.RightMiddleDistal: m_RightMiddleDistal = value; break; + case HumanBodyBones.RightRingProximal: m_RightRingProximal = value; break; + case HumanBodyBones.RightRingIntermediate: m_RightRingIntermediate = value; break; + case HumanBodyBones.RightRingDistal: m_RightRingDistal = value; break; + case HumanBodyBones.RightLittleProximal: m_RightLittleProximal = value; break; + case HumanBodyBones.RightLittleIntermediate: m_RightLittleIntermediate = value; break; + case HumanBodyBones.RightLittleDistal: m_RightLittleDistal = value; break; + #endregion + } + } + } + + /// + /// Animator から Bone を割り当てる + /// + /// + public bool AssignBonesFromAnimator() + { + var animator = GetComponent(); + if (animator == null) + { + return false; + } + var avatar = animator.avatar; + if (avatar == null) + { + return false; + } + if (!avatar.isValid) + { + return false; + } + if (!avatar.isHuman) + { + return false; + } + + var keys = (UnityEngine.HumanBodyBones[])Enum.GetValues(typeof(UnityEngine.HumanBodyBones)); + + AssignBones(keys.Select(x => + { + if (x == HumanBodyBones.LastBone) + { + return (HumanBodyBones.LastBone, null); + } + return ((HumanBodyBones)Enum.Parse(typeof(HumanBodyBones), x.ToString(), true), animator.GetBoneTransform(x)); + })); + + return true; + } + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/Humanoid.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/Humanoid.cs.meta new file mode 100644 index 00000000..53fc0f6d --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/Humanoid.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 889d98e41c0e8ff48bae50d1a729c2df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/HumanoidLoader.cs b/Assets/ThirdParty/VRM/MeshUtility/Runtime/HumanoidLoader.cs new file mode 100644 index 00000000..2a5d5252 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/HumanoidLoader.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace MeshUtility +{ + public static class HumanoidLoader + { + public static Avatar LoadHumanoidAvatar(Transform root, IEnumerable<(Transform, HumanBodyBones)> boneMap) + { + var description = new HumanDescription + { + skeleton = root.GetComponentsInChildren() + .Select(x => x.ToSkeletonBone()).ToArray(), + human = boneMap + .Select(x => new HumanBone + { + boneName = x.Item1.name, + humanName = s_humanTranitBoneNameMap[x.Item2], + limit = new HumanLimit + { + useDefaultValues = true, + } + }).ToArray(), + + armStretch = 0.05f, + legStretch = 0.05f, + upperArmTwist = 0.5f, + lowerArmTwist = 0.5f, + upperLegTwist = 0.5f, + lowerLegTwist = 0.5f, + feetSpacing = 0, + hasTranslationDoF = false, + }; + + return AvatarBuilder.BuildHumanAvatar(root.gameObject, description); + } + + static SkeletonBone ToSkeletonBone(this Transform t) + { + var sb = new SkeletonBone(); + sb.name = t.name; + sb.position = t.localPosition; + sb.rotation = t.localRotation; + sb.scale = t.localScale; + return sb; + } + + static HumanBodyBones TraitToHumanBone(string x) + { + return (HumanBodyBones)Enum.Parse(typeof(HumanBodyBones), x.Replace(" ", ""), true); + } + + static readonly Dictionary s_humanTranitBoneNameMap = + HumanTrait.BoneName.ToDictionary( + x => TraitToHumanBone(x), + x => x); + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/HumanoidLoader.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/HumanoidLoader.cs.meta new file mode 100644 index 00000000..02965556 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/HumanoidLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12453a111483e4145852e3b057e065d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshExtensions.cs b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshExtensions.cs new file mode 100644 index 00000000..aa458d52 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshExtensions.cs @@ -0,0 +1,85 @@ +using UnityEngine; +using System.Linq; + + +namespace MeshUtility +{ + public static class MeshExtensions + { + public static Mesh Copy(this Mesh src, bool copyBlendShape) + { + var dst = new Mesh(); + dst.name = src.name + "(copy)"; +#if UNITY_2017_3_OR_NEWER + dst.indexFormat = src.indexFormat; +#endif + + dst.vertices = src.vertices; + dst.normals = src.normals; + dst.tangents = src.tangents; + dst.colors = src.colors; + dst.uv = src.uv; + dst.uv2 = src.uv2; + dst.uv3 = src.uv3; + dst.uv4 = src.uv4; + dst.boneWeights = src.boneWeights; + dst.bindposes = src.bindposes; + + dst.subMeshCount = src.subMeshCount; + for (int i = 0; i < dst.subMeshCount; ++i) + { + dst.SetIndices(src.GetIndices(i), src.GetTopology(i), i); + } + + dst.RecalculateBounds(); + + if (copyBlendShape) + { + var vertices = src.vertices; + var normals = src.normals; +#if VRM_NORMALIZE_BLENDSHAPE_TANGENT + var tangents = src.tangents.Select(x => (Vector3)x).ToArray(); +#else + Vector3[] tangents = null; +#endif + + for (int i = 0; i < src.blendShapeCount; ++i) + { + src.GetBlendShapeFrameVertices(i, 0, vertices, normals, tangents); + dst.AddBlendShapeFrame( + src.GetBlendShapeName(i), + src.GetBlendShapeFrameWeight(i, 0), + vertices, + normals, + tangents + ); + } + } + + return dst; + } + + public static void ApplyRotationAndScale(this Mesh src, Matrix4x4 m) + { + m.SetColumn(3, new Vector4(0, 0, 0, 1)); // remove translation + src.ApplyMatrix(m); + } + + public static void ApplyMatrix(this Mesh src, Matrix4x4 m) + { + src.vertices = src.vertices.Select(x => m.MultiplyPoint(x)).ToArray(); + if (src.normals != null && src.normals.Length > 0) + { + src.normals = src.normals.Select(x => m.MultiplyVector(x)).ToArray(); + } + if (src.tangents != null && src.tangents.Length > 0) + { + src.tangents = src.tangents.Select(x => + { + var t = m.MultiplyVector((Vector3)x); + return new Vector4(t.x, t.y, t.z, x.w); + }).ToArray(); + } + } + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshExtensions.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshExtensions.cs.meta new file mode 100644 index 00000000..7485178c --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshExtensions.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4181f0b5e9a271b45b3e995a38202780 +timeCreated: 1532506262 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrationResult.cs b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrationResult.cs new file mode 100644 index 00000000..91742fc8 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrationResult.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace MeshUtility +{ + [System.Serializable] + public class MeshIntegrationResult + { + public List SourceSkinnedMeshRenderers = new List(); + public List SourceMeshRenderers = new List(); + public SkinnedMeshRenderer IntegratedRenderer; + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrationResult.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrationResult.cs.meta new file mode 100644 index 00000000..5f32450b --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrationResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1c66a21d479b3e4a92eedd622d27f4f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrator.cs b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrator.cs new file mode 100644 index 00000000..34ba7005 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrator.cs @@ -0,0 +1,253 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace MeshUtility +{ + public class MeshIntegrator + { + public struct SubMesh + { + public List Indices; + public Material Material; + } + + public class BlendShape + { + public int VertexOffset; + public string Name; + public float FrameWeight; + public Vector3[] Positions; + public Vector3[] Normals; + public Vector3[] Tangents; + } + +// public List Renderers { get; private set; } + public List Positions { get; private set; } + public List Normals { get; private set; } + public List UV { get; private set; } + public List Tangents { get; private set; } + public List BoneWeights { get; private set; } + + public List SubMeshes + { + get; + private set; + } + + public List BindPoses { get; private set; } + public List Bones { get; private set; } + + public List BlendShapes { get; private set; } + public void AddBlendShapesToMesh(Mesh mesh) + { + Dictionary map = new Dictionary(); + + foreach (var x in BlendShapes) + { + BlendShape bs = null; + if (!map.TryGetValue(x.Name, out bs)) + { + bs = new BlendShape(); + bs.Positions = new Vector3[Positions.Count]; + bs.Normals = new Vector3[Normals.Count]; + bs.Tangents = new Vector3[Tangents.Count]; + bs.Name = x.Name; + bs.FrameWeight = x.FrameWeight; + map.Add(x.Name, bs); + } + + var j = x.VertexOffset; + for (int i = 0; i < x.Positions.Length; ++i, ++j) + { + bs.Positions[j] = x.Positions[i]; + bs.Normals[j] = x.Normals[i]; + bs.Tangents[j] = x.Tangents[i]; + } + } + + foreach (var kv in map) + { + //Debug.LogFormat("AddBlendShapeFrame: {0}", kv.Key); + mesh.AddBlendShapeFrame(kv.Key, kv.Value.FrameWeight, + kv.Value.Positions, kv.Value.Normals, kv.Value.Tangents); + } + } + + public MeshIntegrator() + { +// Renderers = new List(); + + Positions = new List(); + Normals = new List(); + UV = new List(); + Tangents = new List(); + BoneWeights = new List(); + + SubMeshes = new List(); + + BindPoses = new List(); + Bones = new List(); + + BlendShapes = new List(); + } + + static BoneWeight AddBoneIndexOffset(BoneWeight bw, int boneIndexOffset) + { + if (bw.weight0 > 0) bw.boneIndex0 += boneIndexOffset; + if (bw.weight1 > 0) bw.boneIndex1 += boneIndexOffset; + if (bw.weight2 > 0) bw.boneIndex2 += boneIndexOffset; + if (bw.weight3 > 0) bw.boneIndex3 += boneIndexOffset; + return bw; + } + + public void Push(MeshRenderer renderer) + { + var meshFilter = renderer.GetComponent(); + if (meshFilter == null) + { + Debug.LogWarningFormat("{0} has no mesh filter", renderer.name); + return; + } + var mesh = meshFilter.sharedMesh; + if (mesh == null) + { + Debug.LogWarningFormat("{0} has no mesh", renderer.name); + return; + } + + var indexOffset = Positions.Count; + var boneIndexOffset = Bones.Count; + + Positions.AddRange(mesh.vertices + .Select(x => renderer.transform.TransformPoint(x)) + ); + Normals.AddRange(mesh.normals + .Select(x => renderer.transform.TransformVector(x)) + ); + UV.AddRange(mesh.uv); + Tangents.AddRange(mesh.tangents + .Select(t => + { + var v = renderer.transform.TransformVector(t.x, t.y, t.z); + return new Vector4(v.x, v.y, v.z, t.w); + }) + ); + + var self = renderer.transform; + var bone = self.parent; + if (bone == null) + { + Debug.LogWarningFormat("{0} is root gameobject.", self.name); + return; + } + var bindpose = bone.worldToLocalMatrix; + + BoneWeights.AddRange(Enumerable.Range(0, mesh.vertices.Length) + .Select(x => new BoneWeight() + { + boneIndex0 = Bones.Count, + weight0 = 1, + }) + ); + + BindPoses.Add(bindpose); + Bones.Add(bone); + + for (int i = 0; i < mesh.subMeshCount; ++i) + { + var indices = mesh.GetIndices(i).Select(x => x + indexOffset); + var mat = renderer.sharedMaterials[i]; + var sameMaterialSubMeshIndex = SubMeshes.FindIndex(x => ReferenceEquals(x.Material, mat)); + if (sameMaterialSubMeshIndex >= 0) + { + SubMeshes[sameMaterialSubMeshIndex].Indices.AddRange(indices); + } + else + { + SubMeshes.Add(new SubMesh + { + Indices = indices.ToList(), + Material = mat, + }); + } + } + } + + public void Push(SkinnedMeshRenderer renderer) + { + var mesh = renderer.sharedMesh; + if (mesh == null) + { + Debug.LogWarningFormat("{0} has no mesh", renderer.name); + return; + } + +// Renderers.Add(renderer); + + var indexOffset = Positions.Count; + var boneIndexOffset = Bones.Count; + + Positions.AddRange(mesh.vertices); + Normals.AddRange(mesh.normals); + UV.AddRange(mesh.uv); + Tangents.AddRange(mesh.tangents); + + if (mesh.vertexCount == mesh.boneWeights.Length) + { + BoneWeights.AddRange(mesh.boneWeights.Select(x => AddBoneIndexOffset(x, boneIndexOffset)).ToArray()); + BindPoses.AddRange(mesh.bindposes); + Bones.AddRange(renderer.bones); + } + else + { + // Bone Count 0 の SkinnedMeshRenderer + var rigidBoneWeight = new BoneWeight + { + boneIndex0 = boneIndexOffset, + weight0 = 1f, + }; + BoneWeights.AddRange(Enumerable.Range(0, mesh.vertexCount).Select(x => rigidBoneWeight).ToArray()); + BindPoses.Add(renderer.transform.localToWorldMatrix); + Bones.Add(renderer.transform); + } + + for (int i = 0; i < mesh.subMeshCount; ++i) + { + var indices = mesh.GetIndices(i).Select(x => x + indexOffset); + var mat = renderer.sharedMaterials[i]; + var sameMaterialSubMeshIndex = SubMeshes.FindIndex(x => ReferenceEquals(x.Material, mat)); + if (sameMaterialSubMeshIndex >= 0) + { + SubMeshes[sameMaterialSubMeshIndex].Indices.AddRange(indices); + } + else + { + SubMeshes.Add(new SubMesh + { + Indices = indices.ToList(), + Material = mat, + }); + } + } + + for (int i = 0; i < mesh.blendShapeCount; ++i) + { + var positions = (Vector3[])mesh.vertices.Clone(); + var normals = (Vector3[])mesh.normals.Clone(); + var tangents = mesh.tangents.Select(x => (Vector3)x).ToArray(); + + mesh.GetBlendShapeFrameVertices(i, 0, positions, normals, tangents); + BlendShapes.Add(new BlendShape + { + VertexOffset = indexOffset, + FrameWeight = mesh.GetBlendShapeFrameWeight(i, 0), + Name = mesh.GetBlendShapeName(i), + Positions = positions, + Normals = normals, + Tangents = tangents, + }); + } + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrator.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrator.cs.meta new file mode 100644 index 00000000..15921c89 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegrator.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 547dd57b50bf4820a570336659345084 +timeCreated: 1560168946 \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegratorUtility.cs b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegratorUtility.cs new file mode 100644 index 00000000..cfb1742e --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegratorUtility.cs @@ -0,0 +1,140 @@ +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace MeshUtility +{ + public static class MeshIntegratorUtility + { + /// + /// go を root としたヒエラルキーから Renderer を集めて、統合された Mesh 作成する + /// + /// + /// BlendShapeを保持するSkinnedMeshRendererのみ/BlendShapeを保持しないSkinnedMeshRenderer + MeshRenderer + /// + public static MeshIntegrationResult Integrate(GameObject go, bool onlyBlendShapeRenderers) + { + var result = new MeshIntegrationResult(); + + var meshNode = new GameObject(); + if (onlyBlendShapeRenderers) + { + meshNode.name = "MeshIntegrator(BlendShape)"; + } + else + { + meshNode.name = "MeshIntegrator"; + } + meshNode.transform.SetParent(go.transform, false); + + // レンダラから情報を集める + var integrator = new MeshUtility.MeshIntegrator(); + + if (onlyBlendShapeRenderers) + { + foreach (var x in EnumerateSkinnedMeshRenderer(go.transform, true)) + { + integrator.Push(x); + result.SourceSkinnedMeshRenderers.Add(x); + } + } + else + { + foreach (var x in EnumerateSkinnedMeshRenderer(go.transform, false)) + { + integrator.Push(x); + result.SourceSkinnedMeshRenderers.Add(x); + } + + foreach (var x in EnumerateMeshRenderer(go.transform)) + { + integrator.Push(x); + result.SourceMeshRenderers.Add(x); + } + } + + var mesh = new Mesh(); + mesh.name = "integrated"; + + if (integrator.Positions.Count > ushort.MaxValue) + { + Debug.LogFormat("exceed 65535 vertices: {0}", integrator.Positions.Count); + mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32; + } + + mesh.vertices = integrator.Positions.ToArray(); + mesh.normals = integrator.Normals.ToArray(); + mesh.uv = integrator.UV.ToArray(); + mesh.tangents = integrator.Tangents.ToArray(); + mesh.boneWeights = integrator.BoneWeights.ToArray(); + mesh.subMeshCount = integrator.SubMeshes.Count; + for (var i = 0; i < integrator.SubMeshes.Count; ++i) + { + mesh.SetIndices(integrator.SubMeshes[i].Indices.ToArray(), MeshTopology.Triangles, i); + } + mesh.bindposes = integrator.BindPoses.ToArray(); + + if (onlyBlendShapeRenderers) + { + integrator.AddBlendShapesToMesh(mesh); + } + + var integrated = meshNode.AddComponent(); + integrated.sharedMesh = mesh; + integrated.sharedMaterials = integrator.SubMeshes.Select(x => x.Material).ToArray(); + integrated.bones = integrator.Bones.ToArray(); + result.IntegratedRenderer = integrated; + + return result; + } + + public static IEnumerable EnumerateSkinnedMeshRenderer(Transform root, bool hasBlendShape) + { + foreach (var x in Traverse(root)) + { + var renderer = x.GetComponent(); + if (renderer != null && + renderer.gameObject.activeInHierarchy && + renderer.sharedMesh != null && + renderer.enabled && + renderer.sharedMesh.blendShapeCount > 0 == hasBlendShape) + { + yield return renderer; + } + } + } + + public static IEnumerable EnumerateMeshRenderer(Transform root) + { + foreach (var x in Traverse(root)) + { + var renderer = x.GetComponent(); + var filter = x.GetComponent(); + + if (renderer != null && + filter != null && + renderer.gameObject.activeInHierarchy && + filter.sharedMesh != null) + { + yield return renderer; + } + } + } + + private static IEnumerable Traverse(Transform parent) + { + if (parent.gameObject.activeSelf) + { + yield return parent; + + foreach (Transform child in parent) + { + foreach (var x in Traverse(child)) + { + yield return x; + } + } + } + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegratorUtility.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegratorUtility.cs.meta new file mode 100644 index 00000000..b9075e71 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshIntegratorUtility.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a982d9d30c0145038245b0214dc2f2e4 +timeCreated: 1560190306 \ No newline at end of file diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshUtility.asmdef b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshUtility.asmdef new file mode 100644 index 00000000..f161fcaf --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshUtility.asmdef @@ -0,0 +1,3 @@ +{ + "name": "MeshUtility" +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshUtility.asmdef.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshUtility.asmdef.meta new file mode 100644 index 00000000..4085faa9 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/MeshUtility.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 71ab1919192903d44971eedbc26b24d1 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityExtensions.cs b/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityExtensions.cs new file mode 100644 index 00000000..a772980d --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityExtensions.cs @@ -0,0 +1,319 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + + +namespace MeshUtility +{ + public struct PosRot + { + public Vector3 Position; + public Quaternion Rotation; + + public static PosRot FromGlobalTransform(Transform t) + { + return new PosRot + { + Position = t.position, + Rotation = t.rotation, + }; + } + } + + public class BlendShape + { + public string Name; + + public BlendShape(string name) + { + Name = name; + } + + public List Positions = new List(); + public List Normals = new List(); + public List Tangents = new List(); + } + + public static class UnityExtensions + { + public static Vector4 ReverseZ(this Vector4 v) + { + return new Vector4(v.x, v.y, -v.z, v.w); + } + + public static Vector3 ReverseZ(this Vector3 v) + { + return new Vector3(v.x, v.y, -v.z); + } + + [Obsolete] + public static Vector2 ReverseY(this Vector2 v) + { + return new Vector2(v.x, -v.y); + } + + public static Vector2 ReverseUV(this Vector2 v) + { + return new Vector2(v.x, 1.0f - v.y); + } + + public static Quaternion ReverseZ(this Quaternion q) + { + float angle; + Vector3 axis; + q.ToAngleAxis(out angle, out axis); + return Quaternion.AngleAxis(-angle, ReverseZ(axis)); + } + + public static Matrix4x4 Matrix4x4FromColumns(Vector4 c0, Vector4 c1, Vector4 c2, Vector4 c3) + { +#if UNITY_2017_1_OR_NEWER + return new Matrix4x4(c0, c1, c2, c3); +#else + var m = default(Matrix4x4); + m.SetColumn(0, c0); + m.SetColumn(1, c1); + m.SetColumn(2, c2); + m.SetColumn(3, c3); + return m; +#endif + } + + public static Matrix4x4 Matrix4x4FromRotation(Quaternion q) + { +#if UNITY_2017_1_OR_NEWER + return Matrix4x4.Rotate(q); +#else + var m = default(Matrix4x4); + m.SetTRS(Vector3.zero, q, Vector3.one); + return m; +#endif + } + + public static Matrix4x4 ReverseZ(this Matrix4x4 m) + { + m.SetTRS(m.ExtractPosition().ReverseZ(), m.ExtractRotation().ReverseZ(), m.ExtractScale()); + return m; + } + + public static Matrix4x4 MatrixFromArray(float[] values) + { + var m = new Matrix4x4(); + m.m00 = values[0]; + m.m10 = values[1]; + m.m20 = values[2]; + m.m30 = values[3]; + m.m01 = values[4]; + m.m11 = values[5]; + m.m21 = values[6]; + m.m31 = values[7]; + m.m02 = values[8]; + m.m12 = values[9]; + m.m22 = values[10]; + m.m32 = values[11]; + m.m03 = values[12]; + m.m13 = values[13]; + m.m23 = values[14]; + m.m33 = values[15]; + return m; + } + + // https://forum.unity.com/threads/how-to-assign-matrix4x4-to-transform.121966/ + public static Quaternion ExtractRotation(this Matrix4x4 matrix) + { + Vector3 forward; + forward.x = matrix.m02; + forward.y = matrix.m12; + forward.z = matrix.m22; + + Vector3 upwards; + upwards.x = matrix.m01; + upwards.y = matrix.m11; + upwards.z = matrix.m21; + + return Quaternion.LookRotation(forward, upwards); + } + + public static Vector3 ExtractPosition(this Matrix4x4 matrix) + { + Vector3 position; + position.x = matrix.m03; + position.y = matrix.m13; + position.z = matrix.m23; + return position; + } + + public static Vector3 ExtractScale(this Matrix4x4 matrix) + { + Vector3 scale; + scale.x = new Vector4(matrix.m00, matrix.m10, matrix.m20, matrix.m30).magnitude; + scale.y = new Vector4(matrix.m01, matrix.m11, matrix.m21, matrix.m31).magnitude; + scale.z = new Vector4(matrix.m02, matrix.m12, matrix.m22, matrix.m32).magnitude; + return scale; + } + + public static string RelativePathFrom(this Transform self, Transform root) + { + var path = new List(); + for (var current = self; current != null; current = current.parent) + { + if (current == root) + { + return String.Join("/", path.ToArray()); + } + + path.Insert(0, current.name); + } + + throw new Exception("no RelativePath"); + } + + public static Transform GetChildByName(this Transform self, string childName) + { + foreach (Transform child in self) + { + if (child.name == childName) + { + return child; + } + } + + throw new KeyNotFoundException(); + } + + public static Transform GetFromPath(this Transform self, string path) + { + var current = self; + + var split = path.Split('/'); + + foreach (var childName in split) + { + current = current.GetChildByName(childName); + } + + return current; + } + + public static IEnumerable GetChildren(this Transform self) + { + foreach (Transform child in self) + { + yield return child; + } + } + + public static IEnumerable Traverse(this Transform t) + { + yield return t; + foreach (Transform x in t) + { + foreach (Transform y in x.Traverse()) + { + yield return y; + } + } + } + + [Obsolete("Use FindDescendant(name)")] + public static Transform FindDescenedant(this Transform t, string name) + { + return FindDescendant(t, name); + } + + public static Transform FindDescendant(this Transform t, string name) + { + return t.Traverse().First(x => x.name == name); + } + + public static IEnumerable Ancestors(this Transform t) + { + yield return t; + if (t.parent != null) + { + foreach (Transform x in t.parent.Ancestors()) + { + yield return x; + } + } + } + + public static float[] ToArray(this Quaternion q) + { + return new float[] { q.x, q.y, q.z, q.w }; + } + + public static float[] ToArray(this Vector3 v) + { + return new float[] { v.x, v.y, v.z }; + } + + public static float[] ToArray(this Vector4 v) + { + return new float[] { v.x, v.y, v.z, v.w }; + } + + public static float[] ToArray(this Color c) + { + return new float[] { c.r, c.g, c.b, c.a }; + } + + public static void ReverseZRecursive(this Transform root) + { + var globalMap = root.Traverse().ToDictionary(x => x, x => PosRot.FromGlobalTransform(x)); + + foreach (var x in root.Traverse()) + { + x.position = globalMap[x].Position.ReverseZ(); + x.rotation = globalMap[x].Rotation.ReverseZ(); + } + } + + public static Mesh GetSharedMesh(this Transform t) + { + var meshFilter = t.GetComponent(); + if (meshFilter != null) + { + return meshFilter.sharedMesh; + } + + var skinnedMeshRenderer = t.GetComponent(); + if (skinnedMeshRenderer != null) + { + return skinnedMeshRenderer.sharedMesh; + } + + return null; + } + + public static Material[] GetSharedMaterials(this Transform t) + { + var renderer = t.GetComponent(); + if (renderer != null) + { + return renderer.sharedMaterials; + } + + return new Material[] { }; + } + + public static bool Has(this Transform transform, T t) where T : Component + { + return transform.GetComponent() == t; + } + + public static T GetOrAddComponent(this GameObject go) where T : Component + { + var c = go.GetComponent(); + if (c != null) + { + return c; + } + return go.AddComponent(); + } + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityExtensions.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityExtensions.cs.meta new file mode 100644 index 00000000..07785c58 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5294813527b3278458026afc820dd63d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityPath.cs b/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityPath.cs new file mode 100644 index 00000000..24404741 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityPath.cs @@ -0,0 +1,435 @@ +using System; +using System.IO; +using UnityEngine; +using System.Collections.Generic; +#if UNITY_EDITOR +using UnityEditor; +#endif + + +namespace MeshUtility +{ + /// + /// relative path from Unity project root. + /// For AssetDatabase. + /// + public struct UnityPath + { + #region UnityPath + public string Value + { + get; + private set; + } + + public override string ToString() + { + return string.Format("unity://{0}", Value); + } + + public bool IsNull + { + get { return Value == null; } + } + + public bool IsUnderAssetsFolder + { + get + { + if (IsNull) + { + return false; + } + return Value == "Assets" || Value.StartsWith("Assets/"); + } + } + + public bool IsStreamingAsset + { + get + { + if (IsNull) + { + return false; + } + + return FullPath.StartsWith(Application.streamingAssetsPath + "/"); + } + } + + public string FileName + { + get { return Path.GetFileName(Value); } + } + + public string FileNameWithoutExtension + { + get { return Path.GetFileNameWithoutExtension(Value); } + } + + public string Extension + { + get { return Path.GetExtension(Value); } + } + + public UnityPath Parent + { + get + { + if (IsNull) + { + return default(UnityPath); + } + + return new UnityPath(Path.GetDirectoryName(Value)); + } + } + + public bool HasParent + { + get + { + return !string.IsNullOrEmpty(Value); + } + } + + static readonly char[] EscapeChars = new char[] + { + '\\', + '/', + ':', + '*', + '?', + '"', + '<', + '>', + '|', + }; + + static string EscapeFilePath(string path) + { + foreach (var x in EscapeChars) + { + path = path.Replace(x, '+'); + } + return path; + } + + public UnityPath Child(string name) + { + if (IsNull) + { + throw new NotImplementedException(); + } + else if (Value == "") + { + return new UnityPath(name); + } + else + { + return new UnityPath(Value + "/" + name); + } + } + + public override int GetHashCode() + { + if (IsNull) + { + return 0; + } + return Value.GetHashCode(); + } + + public override bool Equals(object obj) + { + if(obj is UnityPath) + { + var rhs = (UnityPath)obj; + if(Value==null && rhs.Value == null) + { + return true; + } + else if (Value == null) + { + return false; + } + else if (rhs.Value == null) + { + return false; + } + else + { + return Value == rhs.Value; + } + } + else + { + return false; + } + } + + /// + /// Remove extension and add suffix + /// + /// + /// + /// + public UnityPath GetAssetFolder(string suffix) + { + if (!IsUnderAssetsFolder) + { + throw new NotImplementedException(); + } + + return new UnityPath( + string.Format("{0}/{1}{2}", + Parent.Value, + FileNameWithoutExtension, + suffix + )); + } + + UnityPath(string value) : this() + { + Value = value.Replace("\\", "/"); + } + + /// + /// + /// + /// Relative from unity current path. GetParent(Application.dataPath) + /// + public static UnityPath FromUnityPath(string unityPath) + { + if (String.IsNullOrEmpty(unityPath)) + { + return new UnityPath + { + Value="" + }; + } + return FromFullpath(Path.GetFullPath(unityPath)); + } + #endregion + + #region FullPath + static string s_basePath; + static string BaseFullPath + { + get + { + if (string.IsNullOrEmpty(s_basePath)) + { + s_basePath = Path.GetFullPath(Application.dataPath + "/..").Replace("\\", "/"); + } + return s_basePath; + } + } + + static string AssetFullPath + { + get + { + return BaseFullPath + "/Assets"; + } + } + + public string FullPath + { + get + { + if (IsNull) + { + throw new NotImplementedException(); + } + return Path.Combine(BaseFullPath, Value).Replace("\\", "/"); + } + } + + public bool IsFileExists + { + get { return File.Exists(FullPath); } + } + + public bool IsDirectoryExists + { + get { return Directory.Exists(FullPath); } + } + + /// + /// + /// + /// C:/path/to/file + /// + public static UnityPath FromFullpath(string fullPath) + { + if(fullPath == null) + { + fullPath = ""; + } + fullPath = fullPath.Replace("\\", "/"); + + if (fullPath == BaseFullPath) { + return new UnityPath + { + Value="" + }; + } + else if(fullPath.StartsWith(BaseFullPath + "/")) + { + return new UnityPath(fullPath.Substring(BaseFullPath.Length + 1)); + } + else + { + return default(UnityPath); + } + } + + public static bool IsUnderAssetFolder(string fullPath) + { + return fullPath.Replace("\\", "/").StartsWith(AssetFullPath); + } + #endregion + + [Obsolete("Use TraverseDir()")] + public IEnumerable TravserseDir() + { + return TraverseDir(); + } + + public IEnumerable TraverseDir() + { + if (IsDirectoryExists) + { + yield return this; + + foreach(var child in ChildDirs) + { + foreach(var x in child.TraverseDir()) + { + yield return x; + } + } + } + } + + public IEnumerable ChildDirs + { + get + { + foreach(var x in Directory.GetDirectories(FullPath)) + { + yield return UnityPath.FromFullpath(x); + } + } + } + + public IEnumerable ChildFiles + { + get + { + foreach (var x in Directory.GetFiles(FullPath)) + { + yield return UnityPath.FromFullpath(x); + } + } + } + +#if UNITY_EDITOR + public T GetImporter() where T : AssetImporter + { + return AssetImporter.GetAtPath(Value) as T; + } + + public static UnityPath FromAsset(UnityEngine.Object asset) + { + return new UnityPath(AssetDatabase.GetAssetPath(asset)); + } + + public void ImportAsset() + { + if (!IsUnderAssetsFolder) + { + throw new NotImplementedException(); + } + AssetDatabase.ImportAsset(Value); + } + + public void EnsureFolder() + { + if (IsNull) + { + throw new NotImplementedException(); + } + + if (HasParent) + { + Parent.EnsureFolder(); + } + + if (!IsDirectoryExists) + { + var parent = Parent; + // ensure parent + parent.ImportAsset(); + // create + AssetDatabase.CreateFolder( + parent.Value, + Path.GetFileName(Value) + ); + ImportAsset(); + } + } + + public UnityEngine.Object[] GetSubAssets() + { + if (!IsUnderAssetsFolder) + { + throw new NotImplementedException(); + } + + return AssetDatabase.LoadAllAssetsAtPath(Value); + } + + public void CreateAsset(UnityEngine.Object o) + { + if (!IsUnderAssetsFolder) + { + throw new NotImplementedException(); + } + + AssetDatabase.CreateAsset(o, Value); + } + + public void AddObjectToAsset(UnityEngine.Object o) + { + if (!IsUnderAssetsFolder) + { + throw new NotImplementedException(); + } + + AssetDatabase.AddObjectToAsset(o, Value); + } + + public T LoadAsset() where T : UnityEngine.Object + { + if (!IsUnderAssetsFolder) + { + throw new NotImplementedException(); + } + + return AssetDatabase.LoadAssetAtPath(Value); + } + + public UnityPath GenerateUniqueAssetPath() + { + if (!IsUnderAssetsFolder) + { + throw new NotImplementedException(); + } + + return new UnityPath(AssetDatabase.GenerateUniqueAssetPath(Value)); + } + #endif + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityPath.cs.meta b/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityPath.cs.meta new file mode 100644 index 00000000..f64923d8 --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/Runtime/UnityPath.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7b7af908694806c469d62ce0b5b2f06a +timeCreated: 1532326996 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/VRM/MeshUtility/package.json b/Assets/ThirdParty/VRM/MeshUtility/package.json new file mode 100644 index 00000000..1bb826ba --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/package.json @@ -0,0 +1,13 @@ +{ + "name": "com.vrmc.meshutility", + "version": "0.61.0", + "displayName": "MeshUtility", + "unity": "2018.4", + "description": "MeshUtility is a package for mesh separation, etc. \n\nCheck out the latest information here: ", + "keywords": [ + "mesh" + ], + "author": { + "name": "VRM Consortium" + } +} diff --git a/Assets/ThirdParty/VRM/MeshUtility/package.json.meta b/Assets/ThirdParty/VRM/MeshUtility/package.json.meta new file mode 100644 index 00000000..e590e57a --- /dev/null +++ b/Assets/ThirdParty/VRM/MeshUtility/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8ae0f09270317494b8fe54cf2858ffc4 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: -- cgit v1.1-26-g67d0