Merge branch 'Menotdan-fix-spriterender-prefab'

This commit is contained in:
Wojtek Figat
2023-12-17 20:42:10 +01:00
5 changed files with 28 additions and 3 deletions

View File

@@ -71,6 +71,11 @@ namespace FlaxEditor.SceneGraph.Actors
{
base.PostSpawn();
if (Actor.HasPrefabLink)
{
return;
}
((BoxCollider)Actor).AutoResize();
}
}

View File

@@ -334,6 +334,11 @@ namespace FlaxEditor.SceneGraph.Actors
{
base.PostSpawn();
if (Actor.HasPrefabLink)
{
return;
}
// Setup for an initial spline
var spline = (Spline)Actor;
spline.AddSplineLocalPoint(Vector3.Zero, false);

View File

@@ -61,10 +61,15 @@ namespace FlaxEditor.SceneGraph.Actors
{
base.PostSpawn();
if (Actor.HasPrefabLink)
{
return;
}
// Setup for default values
var text = (SpriteRender)Actor;
text.Material = FlaxEngine.Content.LoadAsyncInternal<MaterialBase>(EditorAssets.DefaultSpriteMaterial);
text.Image = FlaxEngine.Content.LoadAsyncInternal<Texture>(EditorAssets.FlaxIconTexture);
var sprite = (SpriteRender)Actor;
sprite.Material = FlaxEngine.Content.LoadAsyncInternal<MaterialBase>(EditorAssets.DefaultSpriteMaterial);
sprite.Image = FlaxEngine.Content.LoadAsyncInternal<Texture>(EditorAssets.FlaxIconTexture);
}
}
}

View File

@@ -22,6 +22,11 @@ namespace FlaxEditor.SceneGraph.Actors
{
base.PostSpawn();
if (Actor.HasPrefabLink)
{
return;
}
// Setup for default values
var text = (TextRender)Actor;
text.Text = "My Text";

View File

@@ -29,6 +29,11 @@ namespace FlaxEditor.SceneGraph.Actors
{
base.PostSpawn();
if (Actor.HasPrefabLink)
{
return;
}
// Rotate to match the space (GUI uses upper left corner as a root)
Actor.LocalOrientation = Quaternion.Euler(0, -180, -180);
bool canSpawn = true;