|
- using Svelto.ECS;
- //using Svelto.Context;
- using Unity.Mathematics;
-
- using GamecraftModdingAPI.Commands;
- using GamecraftModdingAPI;
-
- namespace ExtraCommands.Building
- {
- [CustomCommand("RotateLastBlock", "Rotate last block from original position")]
- class RotateBlocksCommandEngine : ICustomCommandEngine
- {
- public string Description => "Rotate last block from original position";
-
- public string Name => "RotateLastBlock";
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public bool isRemovable => true;
-
- public void Ready()
- {
- CommandRegistrationHelper.Register<float, float, float>(Name, RotateLastBlockCommand, Description);
- }
-
- // Move block with highest index by vector (x,y,z)
- private void RotateLastBlockCommand(float x, float y, float z)
- {
- float3 eulerAngles = new float3(x, y, z);
- Block.GetLastPlacedBlock().Rotation += eulerAngles;
- //GamecraftModdingAPI.Blocks.Rotation.RotateBlock(BlockIdentifiers.LatestBlockID, eulerAngles);
- }
-
- public void Dispose()
- {
- //CustomCommandUtility.Unregister("RotateBlocks");
- CommandRegistrationHelper.Unregister("RotateLastBlock");
- }
- }
- }
|