mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-18 11:03:47 +00:00
Fixed spawnable enemies alpha
This commit is contained in:
parent
e356c593eb
commit
6c9222e47e
5 changed files with 252 additions and 162 deletions
|
|
@ -41,12 +41,15 @@ public partial class EnemyMarker3D : PreviewMarker3D, IActivable
|
|||
{
|
||||
if (_autoSpawn)
|
||||
{
|
||||
SetSpriteAlpha(1);
|
||||
Alpha = 1.0f;
|
||||
// SetSpriteAlpha(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetSpriteAlpha(0.5f);
|
||||
Alpha = 0.5f;
|
||||
//SetSpriteAlpha(0.5f);
|
||||
}
|
||||
QueueRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -59,8 +62,20 @@ public partial class EnemyMarker3D : PreviewMarker3D, IActivable
|
|||
{
|
||||
//GroupName = (string)props["targetname"];
|
||||
this.AddToGroup("EnemyMarkers");
|
||||
AutoSpawn = props["autospawn"].AsBool();
|
||||
|
||||
_billboard = true;
|
||||
_autoSpawn = props["autospawn"].AsBool();
|
||||
if (_autoSpawn)
|
||||
{
|
||||
_alpha = 1.0f;
|
||||
// SetSpriteAlpha(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_alpha = 0.5f;
|
||||
//SetSpriteAlpha(0.5f);
|
||||
}
|
||||
|
||||
var scriptPath = props["resource_path"].AsString();
|
||||
if (!string.IsNullOrWhiteSpace(scriptPath))
|
||||
{
|
||||
|
|
@ -73,10 +88,28 @@ public partial class EnemyMarker3D : PreviewMarker3D, IActivable
|
|||
|
||||
TargetName = props["targetname"].AsStringName();
|
||||
|
||||
Billboard = true;
|
||||
|
||||
|
||||
//QueueRedraw(); // Redraw should be automatic when enemy was changed and texture updated
|
||||
//MarkerId = props["id"].AsInt32();
|
||||
}
|
||||
|
||||
protected override void QueueRedraw()
|
||||
{
|
||||
if (!Engine.IsEditorHint()) return;
|
||||
if (_autoSpawn)
|
||||
{
|
||||
_alpha = 1.0f;
|
||||
// SetSpriteAlpha(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
_alpha = 0.5f;
|
||||
//SetSpriteAlpha(0.5f);
|
||||
}
|
||||
base.QueueRedraw();
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue