Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #79 from uurha/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
uurha committed Jun 25, 2023
1 parent 7a52aeb commit 387489f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,11 @@ public override void Update(object value)

public override object GetCurrentValue()
{
Type type = null;
if (_property.propertyType == SerializedPropertyType.Generic)
var objectOfProperty = _property.GetValue();
var type = objectOfProperty.GetType();
if (type == typeof(SerializedType))
{
var objectOfProperty = _property.GetValue();
type = objectOfProperty.GetType();
if (type == typeof(SerializedType))
{
type = (objectOfProperty as SerializedType)?.Type;
}
}
else if(_property.propertyType == SerializedPropertyType.ManagedReference)
{
type = _property.GetManagedType();
if (type == typeof(SerializedType))
{
type = (_property.managedReferenceValue as SerializedType)?.Type;
}
type = (objectOfProperty as SerializedType)?.Type;
}

return type;
Expand Down
87 changes: 27 additions & 60 deletions Samples~/TestSamples/Scenes/Sample.unity
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
Expand All @@ -117,7 +117,7 @@ NavMeshSettings:
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
Expand Down Expand Up @@ -156,60 +156,44 @@ MonoBehaviour:
serializedType:
fullQualifiedName: Samples.OtherModels.SomeInterfaceImplementation14, Assembly-CSharp,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
keyCode: 8
myFlagEnumTest: 4
component: {fileID: -745862845828164141, guid: 8929c6f090ecb854da923536f6ace092, type: 3}
keyCode: 0
myFlagEnumTest: 0
component: {fileID: 0}
texture: {fileID: 0}
scriptableObjectList:
- {fileID: 0}
scriptableObjectArray:
- {fileID: 0}
scriptableObjectList: []
scriptableObjectArray: []
scriptableObject: {fileID: 0}
vector3Local: {x: 0, y: 0, z: 0}
quaternion: {x: 0, y: 0, z: 0, w: 0}
vector3Local: {x: 0, y: 0, z: 4.6317034}
quaternion: {x: 0, y: 0, z: 0, w: 1}
some:
intField: 0
someClass:
intField: 0
someFloat: 0
someInterface:
rid: 8521015457725808646
id: 0
someAbstractClass:
rid: 8521015457725808642
id: 1
someAbstractClasses:
- rid: 8521015457725808643
someInterfaces:
- rid: 8521015457725808645
- rid: 8521015457725808644
- id: 2
someInterfaces: []
bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0.05, y: 0.05, z: 0.05}
m_Center: {x: 0.038021624, y: 0, z: 0.3450185}
m_Extent: {x: 0.005, y: 0.005, z: 0.033352688}
_vector3s: []
references:
version: 2
RefIds:
- rid: 8521015457725808642
type: {class: SomeAbstractClassImplementation2, ns: Samples.Models, asm: Assembly-CSharp}
version: 1
00000000:
type: {class: SomeInterfaceImplementation15, ns: Samples.OtherModels, asm: Assembly-CSharp}
data:
baseIntField: 0
boolField: 0
- rid: 8521015457725808643
intField: 0
00000001:
type: {class: , ns: , asm: }
00000002:
type: {class: SomeAbstractClassImplementation2, ns: Samples.Models, asm: Assembly-CSharp}
data:
baseIntField: 0
boolField: 0
- rid: 8521015457725808644
type: {class: SomeInterfaceImplementation2, ns: Samples.Models, asm: Assembly-CSharp}
data:
boolField: 0
- rid: 8521015457725808645
type: {class: SomeInterfaceImplementation14, ns: Samples.OtherModels, asm: Assembly-CSharp}
data:
intField: 0
- rid: 8521015457725808646
type: {class: SomeInterfaceImplementation17, ns: Samples.Models, asm: Assembly-CSharp}
data:
intField: 0
--- !u!4 &123298862
Transform:
m_ObjectHideFlags: 0
Expand All @@ -220,7 +204,6 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
Expand All @@ -238,15 +221,11 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
someInterface:
rid: 8521015457725808640
id: 0
references:
version: 2
RefIds:
- rid: 8521015457725808640
type: {class: SomeInterfaceImplementation1, ns: Samples.OtherModels, asm: Assembly-CSharp}
data:
intField: 0
gVector3: []
version: 1
00000000:
type: {class: , ns: , asm: }
--- !u!1 &705507993
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -336,7 +315,6 @@ Transform:
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
Expand Down Expand Up @@ -381,17 +359,9 @@ Camera:
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
Expand Down Expand Up @@ -428,7 +398,6 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
Expand Down Expand Up @@ -464,7 +433,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SendPointerHoverToParent: 1
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
Expand Down Expand Up @@ -497,7 +465,6 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "com.uurha.betterattributes",
"displayName": "Better Attributes",
"version": "1.8.16",
"version": "1.8.20",
"unity": "2020.1",
"description": "Unity attributes, allows to serialize interfaces, draw handles for Vector3/Vector2/Quaternion/Bounds, create read only fields.",
"dependencies": {
"com.uurha.bettereditortools" : "0.9.2"
"com.uurha.bettereditortools" : "0.9.4"
},
"author": {
"name": "Arcueid D'athemon",
Expand Down

0 comments on commit 387489f

Please sign in to comment.