@@ -157,6 +157,24 @@ class Texts
157157 public GUIContent rotation = EditorGUIUtility . TrTextContent ( "Rotation" , "Rotate the emission shape." ) ;
158158 public GUIContent scale = EditorGUIUtility . TrTextContent ( "Scale" , "Scale the emission shape." ) ;
159159
160+ public readonly string undoSphereThickness = L10n . Tr ( "Sphere Thickness Handle Change" ) ;
161+ public readonly string undoSphere = L10n . Tr ( "Sphere Handle Change" ) ;
162+ public readonly string undoCircleThickness = L10n . Tr ( "Circle Thickness Handle Change" ) ;
163+ public readonly string undoCircle = L10n . Tr ( "Circle Handle Change" ) ;
164+ public readonly string undoHemisphereThickness = L10n . Tr ( "Hemisphere Thickness Handle Change" ) ;
165+ public readonly string undoHemisphere = L10n . Tr ( "Hemisphere Handle Change" ) ;
166+ public readonly string undoConeThickness = L10n . Tr ( "Cone Thickness Handle Change" ) ;
167+ public readonly string undoCone = L10n . Tr ( "Cone Handle Change" ) ;
168+ public readonly string undoConeVolumeThickness = L10n . Tr ( "Cone Volume Thickness Handle Change" ) ;
169+ public readonly string undoConeVolume = L10n . Tr ( "Cone Volume Handle Change" ) ;
170+ public readonly string undoBox = L10n . Tr ( "Box Handle Change" ) ;
171+ public readonly string undoDonut = L10n . Tr ( "Donut Handle Change" ) ;
172+ public readonly string undoDonutRadiusThickness = L10n . Tr ( "Donut Radius Thickness Handle Change" ) ;
173+ public readonly string undoDonutRadius = L10n . Tr ( "Donut Radius Handle Change" ) ;
174+ public readonly string undoEdge = L10n . Tr ( "Edge Handle Change" ) ;
175+ public readonly string undoRectangle = L10n . Tr ( "Rectangle Handle Change" ) ;
176+ public readonly string undoTransform = L10n . Tr ( "Shape Transform Change" ) ;
177+
160178 public GUIContent [ ] shapeTypes = new GUIContent [ ]
161179 {
162180 EditorGUIUtility . TrTextContent ( "Sphere" ) ,
@@ -579,17 +597,9 @@ override public void OnSceneViewGUI()
579597
580598 Matrix4x4 transformMatrix = new Matrix4x4 ( ) ;
581599 if ( mainModule . scalingMode == ParticleSystemScalingMode . Local )
582- {
583600 transformMatrix . SetTRS ( ps . transform . position , ps . transform . rotation , ps . transform . localScale ) ;
584- }
585- else if ( mainModule . scalingMode == ParticleSystemScalingMode . Hierarchy )
586- {
587- transformMatrix = ps . transform . localToWorldMatrix ;
588- }
589601 else
590- {
591- transformMatrix . SetTRS ( ps . transform . position , ps . transform . rotation , ps . transform . lossyScale ) ;
592- }
602+ transformMatrix = ps . transform . localToWorldMatrix ;
593603
594604 bool isBox = ( type == ParticleSystemShapeType . Box || type == ParticleSystemShapeType . BoxShell || type == ParticleSystemShapeType . BoxEdge || type == ParticleSystemShapeType . Rectangle ) ;
595605
@@ -606,7 +616,7 @@ override public void OnSceneViewGUI()
606616 float radiusThickness = Handles . DoSimpleRadiusHandle ( Quaternion . identity , Vector3 . zero , shapeModule . radius * ( 1.0f - shapeModule . radiusThickness ) , false , shapeModule . arc ) ;
607617 if ( EditorGUI . EndChangeCheck ( ) )
608618 {
609- Undo . RecordObject ( ps , "Sphere Thickness Handle Change" ) ;
619+ Undo . RecordObject ( ps , s_Texts . undoSphereThickness ) ;
610620 shapeModule . radiusThickness = 1.0f - ( radiusThickness / shapeModule . radius ) ;
611621 }
612622
@@ -616,7 +626,7 @@ override public void OnSceneViewGUI()
616626 float radius = Handles . DoSimpleRadiusHandle ( Quaternion . identity , Vector3 . zero , shapeModule . radius , false , shapeModule . arc ) ;
617627 if ( EditorGUI . EndChangeCheck ( ) )
618628 {
619- Undo . RecordObject ( ps , "Sphere Handle Change" ) ;
629+ Undo . RecordObject ( ps , s_Texts . undoSphere ) ;
620630 shapeModule . radius = radius ;
621631 }
622632
@@ -639,7 +649,7 @@ override public void OnSceneViewGUI()
639649
640650 if ( EditorGUI . EndChangeCheck ( ) )
641651 {
642- Undo . RecordObject ( ps , "Circle Thickness Handle Change" ) ;
652+ Undo . RecordObject ( ps , s_Texts . undoCircleThickness ) ;
643653 shapeModule . radiusThickness = 1.0f - ( m_ArcHandle . radius / shapeModule . radius ) ;
644654 }
645655
@@ -654,7 +664,7 @@ override public void OnSceneViewGUI()
654664
655665 if ( EditorGUI . EndChangeCheck ( ) )
656666 {
657- Undo . RecordObject ( ps , "Circle Handle Change" ) ;
667+ Undo . RecordObject ( ps , s_Texts . undoCircle ) ;
658668 shapeModule . radius = m_ArcHandle . radius ;
659669 shapeModule . arc = m_ArcHandle . angle ;
660670 }
@@ -671,7 +681,7 @@ override public void OnSceneViewGUI()
671681 float radiusThickness = Handles . DoSimpleRadiusHandle ( Quaternion . identity , Vector3 . zero , shapeModule . radius * ( 1.0f - shapeModule . radiusThickness ) , true , shapeModule . arc ) ;
672682 if ( EditorGUI . EndChangeCheck ( ) )
673683 {
674- Undo . RecordObject ( ps , "Hemisphere Thickness Handle Change" ) ;
684+ Undo . RecordObject ( ps , s_Texts . undoHemisphereThickness ) ;
675685 shapeModule . radiusThickness = 1.0f - ( radiusThickness / shapeModule . radius ) ;
676686 }
677687
@@ -681,7 +691,7 @@ override public void OnSceneViewGUI()
681691 float radius = Handles . DoSimpleRadiusHandle ( Quaternion . identity , Vector3 . zero , shapeModule . radius , true , shapeModule . arc ) ;
682692 if ( EditorGUI . EndChangeCheck ( ) )
683693 {
684- Undo . RecordObject ( ps , "Hemisphere Handle Change" ) ;
694+ Undo . RecordObject ( ps , s_Texts . undoHemisphere ) ;
685695 shapeModule . radius = radius ;
686696 }
687697
@@ -699,7 +709,7 @@ override public void OnSceneViewGUI()
699709 radiusThicknessAngleRange = Handles . ConeFrustrumHandle ( Quaternion . identity , Vector3 . zero , radiusThicknessAngleRange , Handles . ConeHandles . Radius ) ;
700710 if ( EditorGUI . EndChangeCheck ( ) )
701711 {
702- Undo . RecordObject ( ps , "Cone Thickness Handle Change" ) ;
712+ Undo . RecordObject ( ps , s_Texts . undoConeThickness ) ;
703713 shapeModule . radiusThickness = 1.0f - ( radiusThicknessAngleRange . x / shapeModule . radius ) ;
704714 }
705715
@@ -710,7 +720,7 @@ override public void OnSceneViewGUI()
710720 radiusAngleRange = Handles . ConeFrustrumHandle ( Quaternion . identity , Vector3 . zero , radiusAngleRange ) ;
711721 if ( EditorGUI . EndChangeCheck ( ) )
712722 {
713- Undo . RecordObject ( ps , "Cone Handle Change" ) ;
723+ Undo . RecordObject ( ps , s_Texts . undoCone ) ;
714724 shapeModule . radius = radiusAngleRange . x ;
715725 shapeModule . angle = radiusAngleRange . y ;
716726 mainModule . startSpeedMultiplier = radiusAngleRange . z ;
@@ -730,7 +740,7 @@ override public void OnSceneViewGUI()
730740 radiusThicknessAngleLength = Handles . ConeFrustrumHandle ( Quaternion . identity , Vector3 . zero , radiusThicknessAngleLength , Handles . ConeHandles . Radius ) ;
731741 if ( EditorGUI . EndChangeCheck ( ) )
732742 {
733- Undo . RecordObject ( ps , "Cone Volume Thickness Handle Change" ) ;
743+ Undo . RecordObject ( ps , s_Texts . undoConeVolumeThickness ) ;
734744 shapeModule . radiusThickness = 1.0f - ( radiusThicknessAngleLength . x / shapeModule . radius ) ;
735745 }
736746
@@ -741,7 +751,7 @@ override public void OnSceneViewGUI()
741751 radiusAngleLength = Handles . ConeFrustrumHandle ( Quaternion . identity , Vector3 . zero , radiusAngleLength ) ;
742752 if ( EditorGUI . EndChangeCheck ( ) )
743753 {
744- Undo . RecordObject ( ps , "Cone Volume Handle Change" ) ;
754+ Undo . RecordObject ( ps , s_Texts . undoConeVolume ) ;
745755 shapeModule . radius = radiusAngleLength . x ;
746756 shapeModule . angle = radiusAngleLength . y ;
747757 shapeModule . length = radiusAngleLength . z ;
@@ -761,7 +771,7 @@ override public void OnSceneViewGUI()
761771
762772 if ( EditorGUI . EndChangeCheck ( ) )
763773 {
764- Undo . RecordObject ( ps , "Box Handle Change" ) ;
774+ Undo . RecordObject ( ps , s_Texts . undoBox ) ;
765775 shapeModule . scale = m_BoxBoundsHandle . size ;
766776 }
767777
@@ -783,7 +793,7 @@ override public void OnSceneViewGUI()
783793
784794 if ( EditorGUI . EndChangeCheck ( ) )
785795 {
786- Undo . RecordObject ( ps , "Donut Handle Change" ) ;
796+ Undo . RecordObject ( ps , s_Texts . undoDonut ) ;
787797 shapeModule . radius = m_ArcHandle . radius ;
788798 shapeModule . arc = m_ArcHandle . angle ;
789799 }
@@ -824,7 +834,7 @@ override public void OnSceneViewGUI()
824834 m_SphereBoundsHandle . DrawHandle ( ) ;
825835 if ( EditorGUI . EndChangeCheck ( ) )
826836 {
827- Undo . RecordObject ( ps , "Donut Radius Thickness Handle Change" ) ;
837+ Undo . RecordObject ( ps , s_Texts . undoDonutRadiusThickness ) ;
828838 shapeModule . radiusThickness = 1.0f - ( m_SphereBoundsHandle . radius / shapeModule . donutRadius ) ;
829839 }
830840 }
@@ -840,7 +850,7 @@ override public void OnSceneViewGUI()
840850 m_SphereBoundsHandle . DrawHandle ( ) ;
841851 if ( EditorGUI . EndChangeCheck ( ) )
842852 {
843- Undo . RecordObject ( ps , "Donut Radius Handle Change" ) ;
853+ Undo . RecordObject ( ps , s_Texts . undoDonutRadius ) ;
844854 shapeModule . donutRadius = m_SphereBoundsHandle . radius ;
845855 }
846856 }
@@ -855,7 +865,7 @@ override public void OnSceneViewGUI()
855865 float radius = Handles . DoSimpleEdgeHandle ( Quaternion . identity , Vector3 . zero , shapeModule . radius ) ;
856866 if ( EditorGUI . EndChangeCheck ( ) )
857867 {
858- Undo . RecordObject ( ps , "Edge Handle Change" ) ;
868+ Undo . RecordObject ( ps , s_Texts . undoEdge ) ;
859869 shapeModule . radius = radius ;
860870 }
861871 }
@@ -883,7 +893,7 @@ override public void OnSceneViewGUI()
883893
884894 if ( EditorGUI . EndChangeCheck ( ) )
885895 {
886- Undo . RecordObject ( ps , "Rectangle Handle Change" ) ;
896+ Undo . RecordObject ( ps , s_Texts . undoRectangle ) ;
887897 shapeModule . scale = new Vector3 ( m_BoxBoundsHandle . size . x , m_BoxBoundsHandle . size . y , 0.0f ) ;
888898 }
889899
0 commit comments