Cleanup 4
This commit is contained in:
@@ -108,9 +108,13 @@ namespace FlaxEditor.Viewport
|
||||
Parent = scaleSnappingWidget
|
||||
};
|
||||
enableScaleSnapping.Toggled += OnScaleSnappingToggle;
|
||||
|
||||
var scaleSnappingCM = new ContextMenu();
|
||||
_scaleSnapping = new ViewportWidgetButton(TransformGizmo.ScaleSnapValue.ToString(), SpriteHandle.Invalid, scaleSnappingCM);
|
||||
_scaleSnapping.TooltipText = "Scale snapping values";
|
||||
_scaleSnapping = new ViewportWidgetButton(TransformGizmo.ScaleSnapValue.ToString(), SpriteHandle.Invalid, scaleSnappingCM)
|
||||
{
|
||||
TooltipText = "Scale snapping values"
|
||||
};
|
||||
|
||||
for (int i = 0; i < EditorViewportScaleSnapValues.Length; i++)
|
||||
{
|
||||
var v = EditorViewportScaleSnapValues[i];
|
||||
@@ -131,9 +135,13 @@ namespace FlaxEditor.Viewport
|
||||
Parent = rotateSnappingWidget
|
||||
};
|
||||
enableRotateSnapping.Toggled += OnRotateSnappingToggle;
|
||||
|
||||
var rotateSnappingCM = new ContextMenu();
|
||||
_rotateSnapping = new ViewportWidgetButton(TransformGizmo.RotationSnapValue.ToString(), SpriteHandle.Invalid, rotateSnappingCM);
|
||||
_rotateSnapping.TooltipText = "Rotation snapping values";
|
||||
_rotateSnapping = new ViewportWidgetButton(TransformGizmo.RotationSnapValue.ToString(), SpriteHandle.Invalid, rotateSnappingCM)
|
||||
{
|
||||
TooltipText = "Rotation snapping values"
|
||||
};
|
||||
|
||||
for (int i = 0; i < EditorViewportRotateSnapValues.Length; i++)
|
||||
{
|
||||
var v = EditorViewportRotateSnapValues[i];
|
||||
@@ -154,9 +162,13 @@ namespace FlaxEditor.Viewport
|
||||
Parent = translateSnappingWidget
|
||||
};
|
||||
enableTranslateSnapping.Toggled += OnTranslateSnappingToggle;
|
||||
|
||||
var translateSnappingCM = new ContextMenu();
|
||||
_translateSnappng = new ViewportWidgetButton(TransformGizmo.TranslationSnapValue.ToString(), SpriteHandle.Invalid, translateSnappingCM);
|
||||
_translateSnappng.TooltipText = "Position snapping values";
|
||||
_translateSnappng = new ViewportWidgetButton(TransformGizmo.TranslationSnapValue.ToString(), SpriteHandle.Invalid, translateSnappingCM)
|
||||
{
|
||||
TooltipText = "Position snapping values"
|
||||
};
|
||||
|
||||
for (int i = 0; i < EditorViewportTranslateSnapValues.Length; i++)
|
||||
{
|
||||
var v = EditorViewportTranslateSnapValues[i];
|
||||
@@ -659,9 +671,11 @@ namespace FlaxEditor.Viewport
|
||||
if (binaryAssetItem.Type == typeof(ParticleSystem))
|
||||
{
|
||||
var particleSystem = FlaxEngine.Content.LoadAsync<ParticleSystem>(item.ID);
|
||||
var actor = new ParticleEffect();
|
||||
actor.Name = item.ShortName;
|
||||
actor.ParticleSystem = particleSystem;
|
||||
var actor = new ParticleEffect
|
||||
{
|
||||
Name = item.ShortName,
|
||||
ParticleSystem = particleSystem
|
||||
};
|
||||
actor.Position = PostProcessSpawnedActorLocation(actor, ref hitLocation);
|
||||
Spawn(actor);
|
||||
return;
|
||||
@@ -684,9 +698,11 @@ namespace FlaxEditor.Viewport
|
||||
if (typeof(SkinnedModel).IsAssignableFrom(binaryAssetItem.Type))
|
||||
{
|
||||
var model = FlaxEngine.Content.LoadAsync<SkinnedModel>(item.ID);
|
||||
var actor = new AnimatedModel();
|
||||
actor.Name = item.ShortName;
|
||||
actor.SkinnedModel = model;
|
||||
var actor = new AnimatedModel
|
||||
{
|
||||
Name = item.ShortName,
|
||||
SkinnedModel = model
|
||||
};
|
||||
actor.Position = PostProcessSpawnedActorLocation(actor, ref hitLocation);
|
||||
Spawn(actor);
|
||||
return;
|
||||
@@ -694,9 +710,11 @@ namespace FlaxEditor.Viewport
|
||||
if (typeof(Model).IsAssignableFrom(binaryAssetItem.Type))
|
||||
{
|
||||
var model = FlaxEngine.Content.LoadAsync<Model>(item.ID);
|
||||
var actor = new StaticModel();
|
||||
actor.Name = item.ShortName;
|
||||
actor.Model = model;
|
||||
var actor = new StaticModel
|
||||
{
|
||||
Name = item.ShortName,
|
||||
Model = model
|
||||
};
|
||||
actor.Position = PostProcessSpawnedActorLocation(actor, ref hitLocation);
|
||||
Spawn(actor);
|
||||
return;
|
||||
@@ -704,9 +722,11 @@ namespace FlaxEditor.Viewport
|
||||
if (typeof(AudioClip).IsAssignableFrom(binaryAssetItem.Type))
|
||||
{
|
||||
var clip = FlaxEngine.Content.LoadAsync<AudioClip>(item.ID);
|
||||
var actor = new AudioSource();
|
||||
actor.Name = item.ShortName;
|
||||
actor.Clip = clip;
|
||||
var actor = new AudioSource
|
||||
{
|
||||
Name = item.ShortName,
|
||||
Clip = clip
|
||||
};
|
||||
actor.Position = PostProcessSpawnedActorLocation(actor, ref hitLocation);
|
||||
Spawn(actor);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user