mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-11-11 16:48:30 +00:00
提交GAS 打算做一个帧同步的GAS
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52c0fd243c6c01e4d9efa03616b655d5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 85e532eecf67ab545b2a5a28f1a22894
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
Odin Inspector makes use of the Bootstrap icon library.
|
||||
The library has been packed into the SdfIconAtlas.png
|
||||
file as SDF data.
|
||||
|
||||
Bootstrap is released under the following license:
|
||||
|
||||
---
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2018 Twitter, Inc.
|
||||
Copyright (c) 2011-2018 The Bootstrap Authors
|
||||
|
||||
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 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.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3fdc67fad3e362e47b5dd365a0bbdd7f
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 90eaa0dc28c1934408dc1c02e13a507f
|
||||
timeCreated: 1628274352
|
||||
licenseType: Store
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 08379ccefc05200459f90a1c0711a340
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
@@ -0,0 +1,128 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a0112a98875dfd488b5d10bdb8a4903
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 0
|
||||
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: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
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: 10
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 16384
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 16384
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 16384
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 460275d0428699145bf00bd425cac9b6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c491065ef4371f74788ef58a3a112d38
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
%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: 1726182683, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
|
||||
m_Name: AOTGenerationConfig
|
||||
m_EditorClassIdentifier:
|
||||
automateBeforeBuilds: 0
|
||||
deleteDllAfterBuilds: 1
|
||||
AutomateForAllAOTPlatforms: 1
|
||||
automateForPlatforms: 0900000014000000
|
||||
lastScan: 0
|
||||
supportSerializedTypes: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa27db24d17deae49b6aa7ff3ede30c6
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,136 @@
|
||||
%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: 772478971, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
|
||||
m_Name: ColorPaletteManager
|
||||
m_EditorClassIdentifier:
|
||||
colorPalettes:
|
||||
- name: Country
|
||||
showAlpha: 0
|
||||
colors:
|
||||
- {r: 0.776, g: 0.651, b: 0.349, a: 1}
|
||||
- {r: 0.863, g: 0.761, b: 0.631, a: 1}
|
||||
- {r: 0.91, g: 0.831, b: 0.686, a: 1}
|
||||
- {r: 0.961, g: 0.902, b: 0.788, a: 1}
|
||||
- {r: 0.753, g: 0.714, b: 0.667, a: 1}
|
||||
- {r: 0.478, g: 0.573, b: 0.431, a: 1}
|
||||
- {r: 0.314, g: 0.427, b: 0.31, a: 1}
|
||||
- {r: 0.596, g: 0.345, b: 0.235, a: 1}
|
||||
- {r: 0.545, g: 0.329, b: 0.318, a: 1}
|
||||
- {r: 0.647, g: 0.204, b: 0.227, a: 1}
|
||||
- {r: 0.435, g: 0.161, b: 0.063, a: 1}
|
||||
- {r: 0.357, g: 0.333, b: 0.278, a: 1}
|
||||
- {r: 0.976, g: 0.98, b: 0.961, a: 1}
|
||||
- {r: 0.165, g: 0.271, b: 0.11, a: 1}
|
||||
- name: Beach
|
||||
showAlpha: 0
|
||||
colors:
|
||||
- {r: 0.996, g: 0.906, b: 0.459, a: 1}
|
||||
- {r: 0.314, g: 0.592, b: 0.035, a: 1}
|
||||
- {r: 0.486, g: 0.953, b: 0.875, a: 1}
|
||||
- {r: 0.996, g: 0.82, b: 0.212, a: 1}
|
||||
- {r: 1, g: 0.769, b: 0.165, a: 1}
|
||||
- {r: 0.804, g: 0.835, b: 0.753, a: 1}
|
||||
- {r: 1, g: 0.769, b: 0.165, a: 1}
|
||||
- {r: 1, g: 0.702, b: 0.063, a: 1}
|
||||
- {r: 1, g: 0.898, b: 0.569, a: 1}
|
||||
- name: Fall
|
||||
showAlpha: 0
|
||||
colors:
|
||||
- {r: 0.82, g: 0.722, b: 0.318, a: 1}
|
||||
- {r: 0.537, g: 0.192, b: 0.153, a: 1}
|
||||
- {r: 0.996, g: 0.812, b: 0.012, a: 1}
|
||||
- {r: 1, g: 0.431, b: 0.02, a: 1}
|
||||
- {r: 0.937, g: 0.267, b: 0.094, a: 1}
|
||||
- {r: 0.42, g: 0.212, b: 0.18, a: 1}
|
||||
- {r: 0.992, g: 0.651, b: 0.004, a: 1}
|
||||
- {r: 0.89, g: 0.353, b: 0.086, a: 1}
|
||||
- {r: 1, g: 0.443, b: 0.004, a: 1}
|
||||
- {r: 0.682, g: 0.275, b: 0.137, a: 1}
|
||||
- {r: 0.306, g: 0.231, b: 0.114, a: 1}
|
||||
- {r: 0.384, g: 0.416, b: 0.082, a: 1}
|
||||
- {r: 0.165, g: 0.157, b: 0.008, a: 1}
|
||||
- {r: 0.906, g: 0.635, b: 0.227, a: 1}
|
||||
- {r: 0.82, g: 0.722, b: 0.318, a: 1}
|
||||
- {r: 0.745, g: 0.435, b: 0.031, a: 1}
|
||||
- {r: 0.765, g: 0.682, b: 0.569, a: 1}
|
||||
- {r: 0.18, g: 0.149, b: 0.075, a: 1}
|
||||
- {r: 0.702, g: 0.451, b: 0.059, a: 1}
|
||||
- name: Passion
|
||||
showAlpha: 0
|
||||
colors:
|
||||
- {r: 0.925, g: 0.682, b: 0.624, a: 1}
|
||||
- {r: 0.188, g: 0.114, b: 0.224, a: 1}
|
||||
- {r: 0.349, g: 0.11, b: 0.231, a: 1}
|
||||
- {r: 0.435, g: 0.267, b: 0.357, a: 1}
|
||||
- name: Sepia
|
||||
showAlpha: 0
|
||||
colors:
|
||||
- {r: 0.353, g: 0.098, b: 0.02, a: 1}
|
||||
- {r: 0.663, g: 0.188, b: 0.114, a: 1}
|
||||
- {r: 0.906, g: 0.643, b: 0.082, a: 1}
|
||||
- {r: 0.996, g: 0.839, b: 0.322, a: 1}
|
||||
- {r: 0.486, g: 0.392, b: 0.02, a: 1}
|
||||
- {r: 0.294, g: 0.235, b: 0.012, a: 1}
|
||||
- name: Floral
|
||||
showAlpha: 0
|
||||
colors:
|
||||
- {r: 0.855, g: 0.518, b: 0.412, a: 1}
|
||||
- {r: 0.827, g: 0.294, b: 0.333, a: 1}
|
||||
- {r: 0.737, g: 0.118, b: 0.208, a: 1}
|
||||
- {r: 0.549, g: 0.149, b: 0.235, a: 1}
|
||||
- {r: 0.949, g: 0.925, b: 0.784, a: 1}
|
||||
- {r: 0.945, g: 0.882, b: 0.69, a: 1}
|
||||
- {r: 0.871, g: 0.812, b: 0.698, a: 1}
|
||||
- {r: 0.4, g: 0.196, b: 0.243, a: 1}
|
||||
- {r: 0.271, g: 0.157, b: 0.227, a: 1}
|
||||
- name: Underwater
|
||||
showAlpha: 0
|
||||
colors:
|
||||
- {r: 0.663, g: 0.416, b: 0.733, a: 1}
|
||||
- {r: 0.2, g: 0.6, b: 0.698, a: 1}
|
||||
- {r: 0.11, g: 0.49, b: 0.698, a: 1}
|
||||
- {r: 0.439, g: 0.627, b: 0.227, a: 1}
|
||||
- {r: 0, g: 0.357, b: 0.604, a: 1}
|
||||
- {r: 0.067, g: 0.271, b: 0.353, a: 1}
|
||||
- name: Breeze
|
||||
showAlpha: 0
|
||||
colors:
|
||||
- {r: 0.706, g: 1, b: 0, a: 1}
|
||||
- {r: 0.651, g: 1, b: 0.404, a: 1}
|
||||
- {r: 0.122, g: 1, b: 0.514, a: 1}
|
||||
- {r: 0.216, g: 0.894, b: 0.961, a: 1}
|
||||
- {r: 0.4, g: 1, b: 0.882, a: 1}
|
||||
- {r: 0.027, g: 0.792, b: 0.8, a: 1}
|
||||
- name: Clovers
|
||||
showAlpha: 0
|
||||
colors:
|
||||
- {r: 0.431, g: 0.549, b: 0.102, a: 1}
|
||||
- {r: 0.671, g: 0.714, b: 0.071, a: 1}
|
||||
- {r: 0.969, g: 0.949, b: 0.831, a: 1}
|
||||
- {r: 0.886, g: 0.902, b: 0.702, a: 1}
|
||||
- {r: 0.753, g: 0.824, b: 0.627, a: 1}
|
||||
- {r: 0.404, g: 0.6, b: 0.4, a: 1}
|
||||
- name: Tropical
|
||||
showAlpha: 0
|
||||
colors:
|
||||
- {r: 0.953, g: 0.647, b: 0.804, a: 1}
|
||||
- {r: 0.965, g: 0.741, b: 0.871, a: 1}
|
||||
- {r: 0.949, g: 0.549, b: 0.643, a: 1}
|
||||
- {r: 0.992, g: 0.659, b: 0.498, a: 1}
|
||||
- {r: 0.976, g: 0.792, b: 0.729, a: 1}
|
||||
- {r: 0.984, g: 0.855, b: 0.725, a: 1}
|
||||
- {r: 0.259, g: 0.882, b: 0.663, a: 1}
|
||||
- {r: 0.349, g: 0.753, b: 0.78, a: 1}
|
||||
- {r: 0.725, g: 0.976, b: 0.91, a: 1}
|
||||
- {r: 0.647, g: 0.745, b: 0.957, a: 1}
|
||||
- {r: 0.725, g: 0.863, b: 0.973, a: 1}
|
||||
- {r: 0.89, g: 0.945, b: 0.996, a: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ebf1c2a9e76aa14092d5a3fb871bab6
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -645759843, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
|
||||
m_Name: GeneralDrawerConfig
|
||||
m_EditorClassIdentifier:
|
||||
enableUIToolkitSupport: 1
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51939277197f3b94ca7e020ecc5b9979
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 188390376, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
|
||||
m_Name: ImportSettingsConfig
|
||||
m_EditorClassIdentifier:
|
||||
automateBeforeBuild: 1
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32d52473a6aa601439998c7f5f967022
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d940c5f7c7c074e4f80ae455322fc175
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: -228747253, guid: a4865f1ab4504ed8a368670db22f409c, type: 3}
|
||||
m_Name: OdinModuleConfig
|
||||
m_EditorClassIdentifier:
|
||||
configurations:
|
||||
- ID: Unity.Mathematics
|
||||
ActivationSettings: 0
|
||||
ModuleTogglingSettings: 1
|
||||
ModuleUpdateSettings: 1
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7eafe81c6c9dbe74cb5c4ccc487ae61a
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49520a8acfc390f4cbb2056a730febc4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 850148bd47d17db41bebe245eb8a26c7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3aa3a3bd3e8afbc4f9128628d1b87033
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 356a67db9bc6244428bcd2aad1eefbda
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d92d0eb8b980c6d44b5f0e64a620355b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 728df0e3465c1a148b83053a3f31d489
|
||||
timeCreated: 1573836981
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a1693d73a4f6e34d955789129c71e11
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4866e740a22eb1e49b1603b051e4d92c
|
||||
timeCreated: 1573836980
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0981b5c357369f4b9eabbc6128db2db
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,883 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="MathematicsDrawers.cs" company="Sirenix ApS">
|
||||
// Copyright (c) Sirenix ApS. All rights reserved.
|
||||
// </copyright>
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
namespace Sirenix.OdinInspector.Modules.UnityMathematics.Editor
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Sirenix.OdinInspector.Editor;
|
||||
using Sirenix.Utilities;
|
||||
using Sirenix.Utilities.Editor;
|
||||
using Unity.Mathematics;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed class MatrixFloat2x2Processor : MatrixProcessor<float2x2> { }
|
||||
public sealed class MatrixFloat3x2Processor : MatrixProcessor<float3x2> { }
|
||||
public sealed class MatrixFloat4x2Processor : MatrixProcessor<float4x2> { }
|
||||
public sealed class MatrixFloat2x3Processor : MatrixProcessor<float2x3> { }
|
||||
public sealed class MatrixFloat3x3Processor : MatrixProcessor<float3x3> { }
|
||||
public sealed class MatrixFloat4x3Processor : MatrixProcessor<float4x3> { }
|
||||
public sealed class MatrixFloat2x4Processor : MatrixProcessor<float2x4> { }
|
||||
public sealed class MatrixFloat3x4Processor : MatrixProcessor<float3x4> { }
|
||||
public sealed class MatrixFloat4x4Processor : MatrixProcessor<float4x4> { }
|
||||
|
||||
public sealed class MatrixDouble2x2Processor : MatrixProcessor<double2x2> { }
|
||||
public sealed class MatrixDouble3x2Processor : MatrixProcessor<double3x2> { }
|
||||
public sealed class MatrixDouble4x2Processor : MatrixProcessor<double4x2> { }
|
||||
public sealed class MatrixDouble2x3Processor : MatrixProcessor<double2x3> { }
|
||||
public sealed class MatrixDouble3x3Processor : MatrixProcessor<double3x3> { }
|
||||
public sealed class MatrixDouble4x3Processor : MatrixProcessor<double4x3> { }
|
||||
public sealed class MatrixDouble2x4Processor : MatrixProcessor<double2x4> { }
|
||||
public sealed class MatrixDouble3x4Processor : MatrixProcessor<double3x4> { }
|
||||
public sealed class MatrixDouble4x4Processor : MatrixProcessor<double4x4> { }
|
||||
|
||||
public sealed class MatrixBool2x2Processor : MatrixProcessor<bool2x2> { }
|
||||
public sealed class MatrixBool3x2Processor : MatrixProcessor<bool3x2> { }
|
||||
public sealed class MatrixBool4x2Processor : MatrixProcessor<bool4x2> { }
|
||||
public sealed class MatrixBool2x3Processor : MatrixProcessor<bool2x3> { }
|
||||
public sealed class MatrixBool3x3Processor : MatrixProcessor<bool3x3> { }
|
||||
public sealed class MatrixBool4x3Processor : MatrixProcessor<bool4x3> { }
|
||||
public sealed class MatrixBool2x4Processor : MatrixProcessor<bool2x4> { }
|
||||
public sealed class MatrixBool3x4Processor : MatrixProcessor<bool3x4> { }
|
||||
public sealed class MatrixBool4x4Processor : MatrixProcessor<bool4x4> { }
|
||||
|
||||
public sealed class MatrixInt2x2Processor : MatrixProcessor<int2x2> { }
|
||||
public sealed class MatrixInt3x2Processor : MatrixProcessor<int3x2> { }
|
||||
public sealed class MatrixInt4x2Processor : MatrixProcessor<int4x2> { }
|
||||
public sealed class MatrixInt2x3Processor : MatrixProcessor<int2x3> { }
|
||||
public sealed class MatrixInt3x3Processor : MatrixProcessor<int3x3> { }
|
||||
public sealed class MatrixInt4x3Processor : MatrixProcessor<int4x3> { }
|
||||
public sealed class MatrixInt2x4Processor : MatrixProcessor<int2x4> { }
|
||||
public sealed class MatrixInt3x4Processor : MatrixProcessor<int3x4> { }
|
||||
public sealed class MatrixInt4x4Processor : MatrixProcessor<int4x4> { }
|
||||
|
||||
public sealed class MatrixUInt2x2Processor : MatrixProcessor<uint2x2> { }
|
||||
public sealed class MatrixUInt3x2Processor : MatrixProcessor<uint3x2> { }
|
||||
public sealed class MatrixUInt4x2Processor : MatrixProcessor<uint4x2> { }
|
||||
public sealed class MatrixUInt2x3Processor : MatrixProcessor<uint2x3> { }
|
||||
public sealed class MatrixUInt3x3Processor : MatrixProcessor<uint3x3> { }
|
||||
public sealed class MatrixUInt4x3Processor : MatrixProcessor<uint4x3> { }
|
||||
public sealed class MatrixUInt2x4Processor : MatrixProcessor<uint2x4> { }
|
||||
public sealed class MatrixUInt3x4Processor : MatrixProcessor<uint3x4> { }
|
||||
public sealed class MatrixUInt4x4Processor : MatrixProcessor<uint4x4> { }
|
||||
|
||||
public sealed class DisableUnityMatrixDrawerAttribute : Attribute { }
|
||||
|
||||
public abstract class MatrixProcessor<T> : OdinAttributeProcessor<T>
|
||||
{
|
||||
public override void ProcessSelfAttributes(InspectorProperty property, List<Attribute> attributes)
|
||||
{
|
||||
attributes.GetOrAddAttribute<InlinePropertyAttribute>();
|
||||
attributes.GetOrAddAttribute<DisableUnityMatrixDrawerAttribute>();
|
||||
}
|
||||
|
||||
public override void ProcessChildMemberAttributes(InspectorProperty parentProperty, MemberInfo member, List<Attribute> attributes)
|
||||
{
|
||||
attributes.Add(new HideLabelAttribute());
|
||||
attributes.Add(new MatrixChildAttribute());
|
||||
}
|
||||
}
|
||||
|
||||
public class DisableUnityMatrixDrawerAttributeDrawer : OdinAttributeDrawer<DisableUnityMatrixDrawerAttribute>
|
||||
{
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.SkipWhenDrawing = true;
|
||||
var chain = this.Property.GetActiveDrawerChain().BakedDrawerArray;
|
||||
|
||||
for (int i = 0; i < chain.Length; i++)
|
||||
{
|
||||
var type = chain[i].GetType();
|
||||
|
||||
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(UnityPropertyDrawer<,>) && type.GetGenericArguments()[0].Name == "MatrixDrawer")
|
||||
{
|
||||
chain[i].SkipWhenDrawing = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MatrixChildAttribute : Attribute { }
|
||||
|
||||
public class Bool2Drawer : OdinValueDrawer<bool2>
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
var showLabels = !this.isMatrixChild && SirenixEditorFields.ResponsiveVectorComponentFields && contentRect.width >= 100;
|
||||
|
||||
if (label != null)
|
||||
{
|
||||
GUILayout.Space(3); // Ugh, better than nothing
|
||||
}
|
||||
|
||||
var options = GUILayoutOptions.Height(EditorGUIUtility.singleLineHeight);
|
||||
|
||||
GUIHelper.PushLabelWidth(SirenixEditorFields.SingleLetterStructLabelWidth);
|
||||
EditorGUILayout.BeginVertical(options);
|
||||
this.ValueEntry.Property.Children[0].Draw(showLabels ? GUIHelper.TempContent("X") : null);
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.BeginVertical(options);
|
||||
this.ValueEntry.Property.Children[1].Draw(showLabels ? GUIHelper.TempContent("Y") : null);
|
||||
EditorGUILayout.EndVertical();
|
||||
GUIHelper.PopLabelWidth();
|
||||
}
|
||||
SirenixEditorGUI.EndHorizontalPropertyLayout();
|
||||
}
|
||||
}
|
||||
|
||||
public class Bool3Drawer : OdinValueDrawer<bool3>
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
var showLabels = !this.isMatrixChild && SirenixEditorFields.ResponsiveVectorComponentFields && contentRect.width >= 100;
|
||||
|
||||
if (label != null)
|
||||
{
|
||||
GUILayout.Space(3); // Ugh, better than nothing
|
||||
}
|
||||
|
||||
var options = GUILayoutOptions.Height(EditorGUIUtility.singleLineHeight);
|
||||
|
||||
GUIHelper.PushLabelWidth(SirenixEditorFields.SingleLetterStructLabelWidth);
|
||||
EditorGUILayout.BeginVertical(options);
|
||||
this.ValueEntry.Property.Children[0].Draw(showLabels ? GUIHelper.TempContent("X") : null);
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.BeginVertical(options);
|
||||
this.ValueEntry.Property.Children[1].Draw(showLabels ? GUIHelper.TempContent("Y") : null);
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.BeginVertical(options);
|
||||
this.ValueEntry.Property.Children[2].Draw(showLabels ? GUIHelper.TempContent("Z") : null);
|
||||
EditorGUILayout.EndVertical();
|
||||
GUIHelper.PopLabelWidth();
|
||||
}
|
||||
SirenixEditorGUI.EndHorizontalPropertyLayout();
|
||||
}
|
||||
}
|
||||
|
||||
public class Bool4Drawer : OdinValueDrawer<bool4>
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
var showLabels = !this.isMatrixChild && SirenixEditorFields.ResponsiveVectorComponentFields && contentRect.width >= 100;
|
||||
|
||||
if (label != null)
|
||||
{
|
||||
GUILayout.Space(3); // Ugh, better than nothing
|
||||
}
|
||||
|
||||
var options = GUILayoutOptions.Height(EditorGUIUtility.singleLineHeight);
|
||||
|
||||
GUIHelper.PushLabelWidth(SirenixEditorFields.SingleLetterStructLabelWidth);
|
||||
EditorGUILayout.BeginVertical(options);
|
||||
this.ValueEntry.Property.Children[0].Draw(showLabels ? GUIHelper.TempContent("X") : null);
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.BeginVertical(options);
|
||||
this.ValueEntry.Property.Children[1].Draw(showLabels ? GUIHelper.TempContent("Y") : null);
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.BeginVertical(options);
|
||||
this.ValueEntry.Property.Children[2].Draw(showLabels ? GUIHelper.TempContent("Z") : null);
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.BeginVertical(options);
|
||||
this.ValueEntry.Property.Children[3].Draw(showLabels ? GUIHelper.TempContent("W") : null);
|
||||
EditorGUILayout.EndVertical();
|
||||
GUIHelper.PopLabelWidth();
|
||||
}
|
||||
SirenixEditorGUI.EndHorizontalPropertyLayout();
|
||||
}
|
||||
}
|
||||
|
||||
public class Float2Drawer : OdinValueDrawer<float2>, IDefinesGenericMenuItems
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
// Slide rect
|
||||
{
|
||||
var val = this.ValueEntry.SmartValue;
|
||||
EditorGUI.BeginChangeCheck();
|
||||
var vec = SirenixEditorFields.VectorPrefixSlideRect(labelRect, new Vector2(val.x, val.y));
|
||||
val = new float2(vec.x, vec.y);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.ValueEntry.SmartValue = val;
|
||||
}
|
||||
}
|
||||
|
||||
var showLabels = !this.isMatrixChild && 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Populates the generic menu for the property.
|
||||
/// </summary>
|
||||
public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu)
|
||||
{
|
||||
float2 value = (float2)property.ValueEntry.WeakSmartValue;
|
||||
var vec = new Vector2(value.x, value.y);
|
||||
|
||||
if (genericMenu.GetItemCount() > 0)
|
||||
{
|
||||
genericMenu.AddSeparator("");
|
||||
}
|
||||
genericMenu.AddItem(new GUIContent("Normalize"), Mathf.Approximately(vec.magnitude, 1f), () => NormalizeEntries(property));
|
||||
genericMenu.AddItem(new GUIContent("Zero", "Set the vector to (0, 0)"), vec == Vector2.zero, () => SetVector(property, Vector2.zero));
|
||||
genericMenu.AddItem(new GUIContent("One", "Set the vector to (1, 1)"), vec == Vector2.one, () => SetVector(property, Vector2.one));
|
||||
genericMenu.AddSeparator("");
|
||||
genericMenu.AddItem(new GUIContent("Right", "Set the vector to (1, 0)"), vec == Vector2.right, () => SetVector(property, Vector2.right));
|
||||
genericMenu.AddItem(new GUIContent("Left", "Set the vector to (-1, 0)"), vec == Vector2.left, () => SetVector(property, Vector2.left));
|
||||
genericMenu.AddItem(new GUIContent("Up", "Set the vector to (0, 1)"), vec == Vector2.up, () => SetVector(property, Vector2.up));
|
||||
genericMenu.AddItem(new GUIContent("Down", "Set the vector to (0, -1)"), vec == Vector2.down, () => SetVector(property, Vector2.down));
|
||||
}
|
||||
|
||||
private void SetVector(InspectorProperty property, Vector2 value)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = new float2(value.x, value.y);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void NormalizeEntries(InspectorProperty property)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = math.normalizesafe((float2)property.ValueEntry.WeakValues[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class Float3Drawer : OdinValueDrawer<float3>, IDefinesGenericMenuItems
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
// Slide rect
|
||||
{
|
||||
var val = this.ValueEntry.SmartValue;
|
||||
EditorGUI.BeginChangeCheck();
|
||||
var vec = SirenixEditorFields.VectorPrefixSlideRect(labelRect, new Vector3(val.x, val.y, val.z));
|
||||
val = new float3(vec.x, vec.y, vec.z);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.ValueEntry.SmartValue = val;
|
||||
}
|
||||
}
|
||||
|
||||
var showLabels = !this.isMatrixChild && 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Populates the generic menu for the property.
|
||||
/// </summary>
|
||||
public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu)
|
||||
{
|
||||
float3 value = (float3)property.ValueEntry.WeakSmartValue;
|
||||
var vec = new Vector3(value.x, value.y, value.z);
|
||||
|
||||
if (genericMenu.GetItemCount() > 0)
|
||||
{
|
||||
genericMenu.AddSeparator("");
|
||||
}
|
||||
genericMenu.AddItem(new GUIContent("Normalize"), Mathf.Approximately(vec.magnitude, 1f), () => NormalizeEntries(property));
|
||||
genericMenu.AddItem(new GUIContent("Zero", "Set the vector to (0, 0, 0)"), vec == Vector3.zero, () => SetVector(property, Vector3.zero));
|
||||
genericMenu.AddItem(new GUIContent("One", "Set the vector to (1, 1, 1)"), vec == Vector3.one, () => SetVector(property, Vector3.one));
|
||||
genericMenu.AddSeparator("");
|
||||
genericMenu.AddItem(new GUIContent("Right", "Set the vector to (1, 0, 0)"), vec == Vector3.right, () => SetVector(property, Vector3.right));
|
||||
genericMenu.AddItem(new GUIContent("Left", "Set the vector to (-1, 0, 0)"), vec == Vector3.left, () => SetVector(property, Vector3.left));
|
||||
genericMenu.AddItem(new GUIContent("Up", "Set the vector to (0, 1, 0)"), vec == Vector3.up, () => SetVector(property, Vector3.up));
|
||||
genericMenu.AddItem(new GUIContent("Down", "Set the vector to (0, -1, 0)"), vec == Vector3.down, () => SetVector(property, Vector3.down));
|
||||
genericMenu.AddItem(new GUIContent("Forward", "Set the vector property to (0, 0, 1)"), vec == Vector3.forward, () => SetVector(property, Vector3.forward));
|
||||
genericMenu.AddItem(new GUIContent("Back", "Set the vector property to (0, 0, -1)"), vec == Vector3.back, () => SetVector(property, Vector3.back));
|
||||
}
|
||||
|
||||
private void SetVector(InspectorProperty property, Vector3 value)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = new float3(value.x, value.y, value.z);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void NormalizeEntries(InspectorProperty property)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = math.normalizesafe((float3)property.ValueEntry.WeakValues[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class Float4Drawer : OdinValueDrawer<float4>, IDefinesGenericMenuItems
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
// Slide rect
|
||||
{
|
||||
var val = this.ValueEntry.SmartValue;
|
||||
EditorGUI.BeginChangeCheck();
|
||||
var vec = SirenixEditorFields.VectorPrefixSlideRect(labelRect, new Vector4(val.x, val.y, val.z, val.w));
|
||||
val = new float4(vec.x, vec.y, vec.z, vec.w);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.ValueEntry.SmartValue = val;
|
||||
}
|
||||
}
|
||||
|
||||
var showLabels = !this.isMatrixChild && 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);
|
||||
this.ValueEntry.Property.Children[3].Draw(showLabels ? GUIHelper.TempContent("W") : null);
|
||||
GUIHelper.PopLabelWidth();
|
||||
|
||||
}
|
||||
SirenixEditorGUI.EndHorizontalPropertyLayout();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Populates the generic menu for the property.
|
||||
/// </summary>
|
||||
public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu)
|
||||
{
|
||||
float4 value = (float4)property.ValueEntry.WeakSmartValue;
|
||||
var vec = new Vector4(value.x, value.y, value.z, value.w);
|
||||
|
||||
if (genericMenu.GetItemCount() > 0)
|
||||
{
|
||||
genericMenu.AddSeparator("");
|
||||
}
|
||||
genericMenu.AddItem(new GUIContent("Normalize"), Mathf.Approximately(vec.magnitude, 1f), () => NormalizeEntries(property));
|
||||
genericMenu.AddItem(new GUIContent("Zero", "Set the vector to (0, 0, 0, 0)"), vec == Vector4.zero, () => SetVector(property, Vector3.zero));
|
||||
genericMenu.AddItem(new GUIContent("One", "Set the vector to (1, 1, 1, 1)"), vec == Vector4.one, () => SetVector(property, Vector4.one));
|
||||
genericMenu.AddSeparator("");
|
||||
genericMenu.AddItem(new GUIContent("Right", "Set the vector to (1, 0, 0, 0)"), (Vector3)vec == Vector3.right, () => SetVector(property, Vector3.right));
|
||||
genericMenu.AddItem(new GUIContent("Left", "Set the vector to (-1, 0, 0, 0)"), (Vector3)vec == Vector3.left, () => SetVector(property, Vector3.left));
|
||||
genericMenu.AddItem(new GUIContent("Up", "Set the vector to (0, 1, 0, 0)"), (Vector3)vec == Vector3.up, () => SetVector(property, Vector3.up));
|
||||
genericMenu.AddItem(new GUIContent("Down", "Set the vector to (0, -1, 0, 0)"), (Vector3)vec == Vector3.down, () => SetVector(property, Vector3.down));
|
||||
genericMenu.AddItem(new GUIContent("Forward", "Set the vector property to (0, 0, 1, 0)"), (Vector3)vec == Vector3.forward, () => SetVector(property, Vector3.forward));
|
||||
genericMenu.AddItem(new GUIContent("Back", "Set the vector property to (0, 0, -1, 0)"), (Vector3)vec == Vector3.back, () => SetVector(property, Vector3.back));
|
||||
}
|
||||
|
||||
private void SetVector(InspectorProperty property, Vector4 value)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = new float4(value.x, value.y, value.z, value.w);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void NormalizeEntries(InspectorProperty property)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = math.normalizesafe((float4)property.ValueEntry.WeakValues[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class Double2Drawer : OdinValueDrawer<double2>, IDefinesGenericMenuItems
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
// Slide rect
|
||||
{
|
||||
var val = this.ValueEntry.SmartValue;
|
||||
EditorGUI.BeginChangeCheck();
|
||||
var vec = SirenixEditorFields.VectorPrefixSlideRect(labelRect, new Vector2((float)val.x, (float)val.y));
|
||||
val = new double2(vec.x, vec.y);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.ValueEntry.SmartValue = val;
|
||||
}
|
||||
}
|
||||
|
||||
var showLabels = !this.isMatrixChild && 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Populates the generic menu for the property.
|
||||
/// </summary>
|
||||
public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu)
|
||||
{
|
||||
double2 value = (double2)property.ValueEntry.WeakSmartValue;
|
||||
var vec = new Vector2((float)value.x, (float)value.y);
|
||||
|
||||
if (genericMenu.GetItemCount() > 0)
|
||||
{
|
||||
genericMenu.AddSeparator("");
|
||||
}
|
||||
genericMenu.AddItem(new GUIContent("Normalize"), Mathf.Approximately(vec.magnitude, 1f), () => NormalizeEntries(property));
|
||||
genericMenu.AddItem(new GUIContent("Zero", "Set the vector to (0, 0)"), vec == Vector2.zero, () => SetVector(property, Vector2.zero));
|
||||
genericMenu.AddItem(new GUIContent("One", "Set the vector to (1, 1)"), vec == Vector2.one, () => SetVector(property, Vector2.one));
|
||||
genericMenu.AddSeparator("");
|
||||
genericMenu.AddItem(new GUIContent("Right", "Set the vector to (1, 0)"), vec == Vector2.right, () => SetVector(property, Vector2.right));
|
||||
genericMenu.AddItem(new GUIContent("Left", "Set the vector to (-1, 0)"), vec == Vector2.left, () => SetVector(property, Vector2.left));
|
||||
genericMenu.AddItem(new GUIContent("Up", "Set the vector to (0, 1)"), vec == Vector2.up, () => SetVector(property, Vector2.up));
|
||||
genericMenu.AddItem(new GUIContent("Down", "Set the vector to (0, -1)"), vec == Vector2.down, () => SetVector(property, Vector2.down));
|
||||
}
|
||||
|
||||
private void SetVector(InspectorProperty property, Vector2 value)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = new double2(value.x, value.y);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void NormalizeEntries(InspectorProperty property)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = math.normalizesafe((double2)property.ValueEntry.WeakValues[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class Double3Drawer : OdinValueDrawer<double3>, IDefinesGenericMenuItems
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
// Slide rect
|
||||
{
|
||||
var val = this.ValueEntry.SmartValue;
|
||||
EditorGUI.BeginChangeCheck();
|
||||
var vec = SirenixEditorFields.VectorPrefixSlideRect(labelRect, new Vector3((float)val.x, (float)val.y, (float)val.z));
|
||||
val = new double3(vec.x, vec.y, vec.z);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.ValueEntry.SmartValue = val;
|
||||
}
|
||||
}
|
||||
|
||||
var showLabels = !this.isMatrixChild && 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Populates the generic menu for the property.
|
||||
/// </summary>
|
||||
public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu)
|
||||
{
|
||||
double3 value = (double3)property.ValueEntry.WeakSmartValue;
|
||||
var vec = new Vector3((float)value.x, (float)value.y, (float)value.z);
|
||||
|
||||
if (genericMenu.GetItemCount() > 0)
|
||||
{
|
||||
genericMenu.AddSeparator("");
|
||||
}
|
||||
genericMenu.AddItem(new GUIContent("Normalize"), Mathf.Approximately(vec.magnitude, 1f), () => NormalizeEntries(property));
|
||||
genericMenu.AddItem(new GUIContent("Zero", "Set the vector to (0, 0, 0)"), vec == Vector3.zero, () => SetVector(property, Vector3.zero));
|
||||
genericMenu.AddItem(new GUIContent("One", "Set the vector to (1, 1, 1)"), vec == Vector3.one, () => SetVector(property, Vector3.one));
|
||||
genericMenu.AddSeparator("");
|
||||
genericMenu.AddItem(new GUIContent("Right", "Set the vector to (1, 0, 0)"), vec == Vector3.right, () => SetVector(property, Vector3.right));
|
||||
genericMenu.AddItem(new GUIContent("Left", "Set the vector to (-1, 0, 0)"), vec == Vector3.left, () => SetVector(property, Vector3.left));
|
||||
genericMenu.AddItem(new GUIContent("Up", "Set the vector to (0, 1, 0)"), vec == Vector3.up, () => SetVector(property, Vector3.up));
|
||||
genericMenu.AddItem(new GUIContent("Down", "Set the vector to (0, -1, 0)"), vec == Vector3.down, () => SetVector(property, Vector3.down));
|
||||
genericMenu.AddItem(new GUIContent("Forward", "Set the vector property to (0, 0, 1)"), vec == Vector3.forward, () => SetVector(property, Vector3.forward));
|
||||
genericMenu.AddItem(new GUIContent("Back", "Set the vector property to (0, 0, -1)"), vec == Vector3.back, () => SetVector(property, Vector3.back));
|
||||
}
|
||||
|
||||
private void SetVector(InspectorProperty property, Vector3 value)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = new double3(value.x, value.y, value.z);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void NormalizeEntries(InspectorProperty property)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = math.normalizesafe((double3)property.ValueEntry.WeakValues[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class Double4Drawer : OdinValueDrawer<double4>, IDefinesGenericMenuItems
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
// Slide rect
|
||||
{
|
||||
var val = this.ValueEntry.SmartValue;
|
||||
EditorGUI.BeginChangeCheck();
|
||||
var vec = SirenixEditorFields.VectorPrefixSlideRect(labelRect, new Vector4((float)val.x, (float)val.y, (float)val.z, (float)val.w));
|
||||
val = new double4(vec.x, vec.y, vec.z, vec.w);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.ValueEntry.SmartValue = val;
|
||||
}
|
||||
}
|
||||
|
||||
var showLabels = !this.isMatrixChild && 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);
|
||||
this.ValueEntry.Property.Children[3].Draw(showLabels ? GUIHelper.TempContent("W") : null);
|
||||
GUIHelper.PopLabelWidth();
|
||||
|
||||
}
|
||||
SirenixEditorGUI.EndHorizontalPropertyLayout();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Populates the generic menu for the property.
|
||||
/// </summary>
|
||||
public void PopulateGenericMenu(InspectorProperty property, GenericMenu genericMenu)
|
||||
{
|
||||
double4 value = (double4)property.ValueEntry.WeakSmartValue;
|
||||
var vec = new Vector4((float)value.x, (float)value.y, (float)value.z, (float)value.w);
|
||||
|
||||
if (genericMenu.GetItemCount() > 0)
|
||||
{
|
||||
genericMenu.AddSeparator("");
|
||||
}
|
||||
genericMenu.AddItem(new GUIContent("Normalize"), Mathf.Approximately(vec.magnitude, 1f), () => NormalizeEntries(property));
|
||||
genericMenu.AddItem(new GUIContent("Zero", "Set the vector to (0, 0, 0, 0)"), vec == Vector4.zero, () => SetVector(property, Vector3.zero));
|
||||
genericMenu.AddItem(new GUIContent("One", "Set the vector to (1, 1, 1, 1)"), vec == Vector4.one, () => SetVector(property, Vector4.one));
|
||||
genericMenu.AddSeparator("");
|
||||
genericMenu.AddItem(new GUIContent("Right", "Set the vector to (1, 0, 0, 0)"), (Vector3)vec == Vector3.right, () => SetVector(property, Vector3.right));
|
||||
genericMenu.AddItem(new GUIContent("Left", "Set the vector to (-1, 0, 0, 0)"), (Vector3)vec == Vector3.left, () => SetVector(property, Vector3.left));
|
||||
genericMenu.AddItem(new GUIContent("Up", "Set the vector to (0, 1, 0, 0)"), (Vector3)vec == Vector3.up, () => SetVector(property, Vector3.up));
|
||||
genericMenu.AddItem(new GUIContent("Down", "Set the vector to (0, -1, 0, 0)"), (Vector3)vec == Vector3.down, () => SetVector(property, Vector3.down));
|
||||
genericMenu.AddItem(new GUIContent("Forward", "Set the vector property to (0, 0, 1, 0)"), (Vector3)vec == Vector3.forward, () => SetVector(property, Vector3.forward));
|
||||
genericMenu.AddItem(new GUIContent("Back", "Set the vector property to (0, 0, -1, 0)"), (Vector3)vec == Vector3.back, () => SetVector(property, Vector3.back));
|
||||
}
|
||||
|
||||
private void SetVector(InspectorProperty property, Vector4 value)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = new double4(value.x, value.y, value.z, value.w);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void NormalizeEntries(InspectorProperty property)
|
||||
{
|
||||
property.Tree.DelayActionUntilRepaint(() =>
|
||||
{
|
||||
for (int i = 0; i < property.ValueEntry.ValueCount; i++)
|
||||
{
|
||||
property.ValueEntry.WeakValues[i] = math.normalizesafe((double4)property.ValueEntry.WeakValues[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class Int2Drawer : OdinValueDrawer<int2>
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
var showLabels = !this.isMatrixChild && 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class Int3Drawer : OdinValueDrawer<int3>
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
var showLabels = !this.isMatrixChild && 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class Int4Drawer : OdinValueDrawer<int4>
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
var showLabels = !this.isMatrixChild && 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);
|
||||
this.ValueEntry.Property.Children[3].Draw(showLabels ? GUIHelper.TempContent("W") : null);
|
||||
GUIHelper.PopLabelWidth();
|
||||
|
||||
}
|
||||
SirenixEditorGUI.EndHorizontalPropertyLayout();
|
||||
}
|
||||
}
|
||||
|
||||
public class UInt2Drawer : OdinValueDrawer<uint2>
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
var showLabels = !this.isMatrixChild && 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class UInt3Drawer : OdinValueDrawer<uint3>
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
var showLabels = !this.isMatrixChild && 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class UInt4Drawer : OdinValueDrawer<uint4>
|
||||
{
|
||||
private bool isMatrixChild;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
this.isMatrixChild = this.Property.GetAttribute<MatrixChildAttribute>() != null;
|
||||
}
|
||||
|
||||
protected override void DrawPropertyLayout(GUIContent label)
|
||||
{
|
||||
Rect labelRect;
|
||||
Rect contentRect = SirenixEditorGUI.BeginHorizontalPropertyLayout(label, out labelRect);
|
||||
{
|
||||
var showLabels = !this.isMatrixChild && 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);
|
||||
this.ValueEntry.Property.Children[3].Draw(showLabels ? GUIHelper.TempContent("W") : null);
|
||||
GUIHelper.PopLabelWidth();
|
||||
|
||||
}
|
||||
SirenixEditorGUI.EndHorizontalPropertyLayout();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74718b273a32d874a9dc3c58269c36b3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "Sirenix.OdinInspector.Modules.UnityMathematics",
|
||||
"references": [ "Unity.Mathematics", "Sirenix.OdinInspector.Attributes", "Sirenix.OdinInspector.Editor", "Sirenix.Utilities", "Sirenix.Utilities.Editor" ],
|
||||
"includePlatforms": [ "Editor" ],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": true,
|
||||
"autoReferenced": true,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [ "Sirenix.Utilities.dll", "Sirenix.Utilities.Editor.dll", "Sirenix.OdinInspector.Attributes.dll", "Sirenix.OdinInspector.Editor.dll", "Sirenix.Serialization.dll" ],
|
||||
"defineConstraints": []
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad968d605628d06499b62cdc30f11cf8
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
ManifestVersion: 1
|
||||
ModuleID: Unity.Mathematics
|
||||
ModuleVersion: 1.0.1.0
|
||||
ModuleFiles:
|
||||
MathematicsDrawers.cs
|
||||
MathematicsDrawers.cs.meta
|
||||
Sirenix.OdinInspector.Modules.UnityMathematics.asmdef
|
||||
Sirenix.OdinInspector.Modules.UnityMathematics.asmdef.meta
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aaa6e006e742f064eb66f07a61fdd792
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user