You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS/device including version:
Output of uname -a:
Linux laptop 5.2.1-arch1-1-ARCH #1 SMP PREEMPT Sun Jul 14 14:52:52 UTC 2019 x86_64 GNU/Linux
Running Arch Linux with Godot-Mono from AUR
Issue description:
While making C# plugin I have encoutered:
_Ready(), _EnterTree(), _ExitTree() being called even in the editor itself.
_Init() never called, even after game starts.
Steps to reproduce:
Create a plugin with a following script:
using Godot;
[Tool]
public class NodeScript : Node
{
public override void _EnterTree()
{
GD.Print("Node _EnterTree()");
}
public NodeScript()
{
GD.Print("Node constructor");
}
public override void _Init()
{
base._Init();
GD.Print("Node _Init()");
}
public override void _Ready()
{
base._Ready();
GD.Print("Node _Ready()");
}
public override void _ExitTree()
{
GD.Print("Node _ExitTree()");
}
}
Enable plugin and add the custom node.
Rebuild project
You will now notice that these prints happen in the editor itself, not even in the game.
Start project
You will notice that _Init() is never called. Constructor is called sometimes 3 times and sometimes once.
_Ready(), _EnterTree(), _ExitTree() being called even in the editor itself.
This is the expected behaviour, isn't it? The [Tool] attribute means "run in the editor". If you've added the node to your tree in the editor, these functions will be called. This is the same in GDScript.
_Init() never called, even after game starts.
_Init() was never implemented in C#, and I removed it completely on latest master. _init() is simply a constructor in GDScript, so the equivalent in C# is a constructor as well.
Constructor is called sometimes 3 times and sometimes once.
These are most likely temporary instances the editor needs to create in order to get the default values of exported fields. I plan to improve this so that you can at least know when this happens (probably via a specialized constructor overload).
Godot version:
Godot Engine v3.1.1.stable.mono.official
OS/device including version:
Output of
uname -a
:Linux laptop 5.2.1-arch1-1-ARCH #1 SMP PREEMPT Sun Jul 14 14:52:52 UTC 2019 x86_64 GNU/Linux
Running Arch Linux with Godot-Mono from AUR
Issue description:
While making C# plugin I have encoutered:
_Ready(), _EnterTree(), _ExitTree() being called even in the editor itself.
_Init() never called, even after game starts.
Steps to reproduce:
Enable plugin and add the custom node.
Rebuild project
Minimal reproduction project:
New Game Project.zip
The text was updated successfully, but these errors were encountered: