Пример #1
0
    public override void UnEquip()
    {
        inventory.RemoveItemFromInventory(this);
        var shotgun = weaponScene.Instance() as Shotgun;

        shotgun.Position        = GetTree().CurrentScene.GetNode <Player>("Player").Position;
        shotgun.RotationDegrees = Utlities.LookAtMouse(GetGlobalMousePosition(), shotgun.Position);

        GetTree().CurrentScene.AddChild(shotgun);
    }
Пример #2
0
    public override void UnEquip()
    {
        inventory.RemoveItemFromInventory(this);
        var rocketLauncher = weaponScene.Instance() as RocketLauncher;

        rocketLauncher.Position        = GetTree().CurrentScene.GetNode <Player>("Player").Position;
        rocketLauncher.RotationDegrees = Utlities.LookAtMouse(GetGlobalMousePosition(), rocketLauncher.Position);

        GetTree().CurrentScene.AddChild(rocketLauncher);
    }
Пример #3
0
 public override void _Process(float delta)
 {
     lookDir         = GetGlobalMousePosition() - GlobalPosition;
     RotationDegrees = Utlities.LookAtMouse(GetGlobalMousePosition(), GlobalPosition);
     Shoot(lookDir, delta);
 }