Newer
Older
DungeonShooting / DungeonShooting_Godot / src / test / TestActivity.cs
@小李xl 小李xl on 3 Jun 2023 786 bytes 引入Godot表格插件
using Godot;

public partial class TestActivity : ActivityObject
{
	public override void OnInit()
	{
		EnableVerticalMotion = false;
	}

	protected override void Process(float delta)
	{
		if (Input.IsActionJustPressed("fire"))
		{
			Altitude = 100;
		}

		if (Input.IsActionJustPressed("interactive"))
		{
			EnableVerticalMotion = !EnableVerticalMotion;
		}
	}

	protected override void OnFallToGround()
	{
		GD.Print("OnFallToGround");
	}

	protected override void OnFirstFallToGround()
	{
		GD.Print("OnFirstFallToGround");
	}

	protected override void OnThrowStart()
	{
		GD.Print("OnThrowStart");
	}

	protected override void OnThrowMaxHeight(float height)
	{
		GD.Print("OnThrowMaxHeight: " + height);
	}

	protected override void OnThrowOver()
	{
		GD.Print("OnThrowOver");
	}
}