diff --git a/Assets/Demo.unity b/Assets/Demo.unity index e968e32..8860614 100644 --- a/Assets/Demo.unity +++ b/Assets/Demo.unity @@ -209,7 +209,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} --- !u!1 &1037052744 GameObject: @@ -302,170 +302,8 @@ Transform: m_LocalScale: {x: 100, y: 100, z: 100} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &1095446692 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 753119764481210622, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_Name - value: Cube - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalPosition.x - value: -26.11914 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalPosition.y - value: 70.93344 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalPosition.z - value: -483.702 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_RootOrder - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 879a8b884fd7363458a916a309746ec4, type: 3} ---- !u!1 &1165109967 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1165109971} - - component: {fileID: 1165109970} - - component: {fileID: 1165109969} - - component: {fileID: 1165109968} - m_Layer: 0 - m_Name: Plane (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!64 &1165109968 -MeshCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1165109967} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Convex: 0 - m_CookingOptions: 14 - m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &1165109969 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1165109967} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!33 &1165109970 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1165109967} - m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &1165109971 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1165109967} - m_LocalRotation: {x: -0, y: -0, z: 0.3539, w: 0.9352833} - m_LocalPosition: {x: 98.6, y: 69.7, z: -562.9} - m_LocalScale: {x: 13.485, y: 13.485, z: 13.485} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 41.452003} --- !u!1 &1420938024 GameObject: m_ObjectHideFlags: 0 @@ -549,75 +387,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &1716538062 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 2602752127934446500, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_Name - value: Sphere - objectReference: {fileID: 0} - - target: {fileID: 2146931934536288589, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_LocalPosition.x - value: -27.668411 - objectReference: {fileID: 0} - - target: {fileID: 2146931934536288589, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_LocalPosition.y - value: 70.93344 - objectReference: {fileID: 0} - - target: {fileID: 2146931934536288589, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_LocalPosition.z - value: -491.4477 - objectReference: {fileID: 0} - - target: {fileID: 2146931934536288589, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2146931934536288589, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2146931934536288589, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2146931934536288589, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 2146931934536288589, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 2146931934536288589, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2146931934536288589, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2146931934536288589, guid: c0da57286956eff4788385a1f7968c48, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: c0da57286956eff4788385a1f7968c48, type: 3} --- !u!1 &1812192218 GameObject: m_ObjectHideFlags: 0 @@ -5369,74 +5138,5 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} ---- !u!1001 &2042969503 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 753119764481210622, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_Name - value: Cube - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalPosition.x - value: -26.910599 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalPosition.y - value: 70.93344 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalPosition.z - value: -488.10562 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_RootOrder - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8488128184841061491, guid: 879a8b884fd7363458a916a309746ec4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 879a8b884fd7363458a916a309746ec4, type: 3} diff --git a/Assets/Editor/Scripts/Tools/PaintBrush.cs b/Assets/Editor/Scripts/Tools/PaintBrush.cs index 193ff41..4aa97f1 100644 --- a/Assets/Editor/Scripts/Tools/PaintBrush.cs +++ b/Assets/Editor/Scripts/Tools/PaintBrush.cs @@ -61,16 +61,16 @@ public override void Paint(RaycastHit drawPointHit) if (Physics.Raycast(rayRandom, out castCheck, Mathf.Infinity, ~(GetParameter().value))) { var hitObj = castCheck.collider.gameObject; - if (paintSettings.firstObjectFilter) + if (GetParameter().value) { if (targetSpawnObject == hitObj) { listRaycast.Add(castCheck); } } - else if (paintSettings.filterObject != null) + else if (GetParameter() != null) { - if (paintSettings.filterObject == hitObj) + if (GetParameter().value == hitObj) { listRaycast.Add(castCheck); } @@ -99,9 +99,9 @@ void CreateObject(RaycastHit rayHit) GameObject osd = PrefabUtility.InstantiatePrefab(brushInfo.brushObjects[Random.Range(0, brushInfo.brushObjects.Count)]) as GameObject; osd.transform.position = newPos; - if (paintSettings.randomizeScale) + if (GetParameter().randomScale) { - osd.transform.localScale *= Random.Range(paintSettings.randomScaleMin, paintSettings.randomScaleMax); + osd.transform.localScale *= Random.Range(GetParameter().minValue, GetParameter().maxValue); } if (paintSettings.randomizeRotation) { @@ -121,8 +121,7 @@ void CreateObject(RaycastHit rayHit) break; } - - osd.transform.SetParent(paintSettings.targetParent); + osd.transform.SetParent(GetParameter().value); osd.tag = GetParameter().value; osd.layer = GetParameter().value; Undo.RegisterCreatedObjectUndo(osd, "Create Prefab");