Add move blocks command and improve dependencies
This commit is contained in:
parent
d4db32ccb4
commit
064f719f82
4 changed files with 81 additions and 22 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -337,4 +337,8 @@ ASALocalRun/
|
|||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
healthchecksdb
|
||||
|
||||
# Referenced DLLs
|
||||
ref
|
||||
ref/**
|
BIN
IllusionPlugin.dll
Normal file
BIN
IllusionPlugin.dll
Normal file
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net45</TargetFramework>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -10,65 +10,69 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Reference Include="CommandLine">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\CommandLine.dll</HintPath>
|
||||
<HintPath>..\ref\CommandLine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FullGame">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\FullGame.dll</HintPath>
|
||||
<HintPath>..\ref\FullGame.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="IllusionPlugin">
|
||||
<HintPath>..\..\..\IPA\IPA\bin\Debug\IPA\Data\Managed\IllusionPlugin.dll</HintPath>
|
||||
<HintPath>..\IllusionPlugin.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RobocraftX.Character">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\RobocraftX.Character.dll</HintPath>
|
||||
<HintPath>..\ref\RobocraftX.Character.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CommandLine">
|
||||
<HintPath>..\ref\RobocraftX.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RobocraftX.Multiplayer">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.dll</HintPath>
|
||||
<HintPath>..\ref\RobocraftX.Multiplayer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RobocraftX.Multiplayer.NetworkEntityStream">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll</HintPath>
|
||||
<HintPath>..\ref\RobocraftX.Multiplayer.NetworkEntityStream.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RobocraftX.MultiplayerInput">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\RobocraftX.MultiplayerInput.dll</HintPath>
|
||||
<HintPath>..\ref\RobocraftX.MultiplayerInput.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RobocraftX.StateSync">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\RobocraftX.StateSync.dll</HintPath>
|
||||
<HintPath>..\ref\RobocraftX.StateSync.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Svelto.Common">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\Svelto.Common.dll</HintPath>
|
||||
<HintPath>..\ref\Svelto.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Svelto.ECS">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\Svelto.ECS.dll</HintPath>
|
||||
<HintPath>..\ref\Svelto.ECS.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Entities">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\Unity.Entities.dll</HintPath>
|
||||
<HintPath>..\ref\Unity.Entities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Entities.Hybrid">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\Unity.Entities.Hybrid.dll</HintPath>
|
||||
<HintPath>..\ref\Unity.Entities.Hybrid.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Entities.Properties">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\Unity.Entities.Properties.dll</HintPath>
|
||||
<HintPath>..\ref\Unity.Entities.Properties.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Entities.StaticTypeRegistry">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\Unity.Entities.StaticTypeRegistry.dll</HintPath>
|
||||
<HintPath>..\ref\Unity.Entities.StaticTypeRegistry.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Mathematics">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\Unity.Mathematics.dll</HintPath>
|
||||
<HintPath>..\ref\Unity.Mathematics.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Mathematics.Extensions">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.dll</HintPath>
|
||||
<HintPath>..\ref\Unity.Mathematics.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Mathematics.Extensions.Hybrid">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll</HintPath>
|
||||
<HintPath>..\ref\Unity.Mathematics.Extensions.Hybrid.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\UnityEngine.dll</HintPath>
|
||||
<HintPath>..\ref\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
<HintPath>..\ref\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="uREPL">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Gamecraft\GamecraftPreview_Data\Managed\uREPL.dll</HintPath>
|
||||
<HintPath>..\ref\uREPL.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Build, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
51
extracommands/MoveBlocksCommandEngine.cs
Normal file
51
extracommands/MoveBlocksCommandEngine.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using RobocraftX.GUI.CommandLine;
|
||||
using RobocraftX.Multiplayer;
|
||||
using RobocraftX.StateSync;
|
||||
using RobocraftX.Character;
|
||||
using RobocraftX.Common;
|
||||
using Svelto.ECS;
|
||||
using Svelto.ECS.EntityStructs;
|
||||
using Unity.Entities;
|
||||
using UnityEngine;
|
||||
using uREPL;
|
||||
using Svelto.Context;
|
||||
using RobocraftX;
|
||||
|
||||
namespace ExtraCommands.Building
|
||||
{
|
||||
[CustomCommand("MoveBlocks", "Move blocks from their original position")]
|
||||
class MoveBlocksCommandEngine : CustomCommandEngine
|
||||
{
|
||||
public MoveBlocksCommandEngine(UnityContext<FullGameCompositionRoot> ctxHolder, EnginesRoot enginesRoot, World physW, Action reloadGame, MultiplayerInitParameters mpParams) : base(ctxHolder, enginesRoot, physW, reloadGame, mpParams)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Ready()
|
||||
{
|
||||
uREPL.RuntimeCommands.Register<float, float, float>("MoveBlocks", MoveBlocksCommand, "Move blocks from their original position");
|
||||
}
|
||||
|
||||
private void MoveBlocksCommand(float x, float y, float z)
|
||||
{
|
||||
uint loopCount;
|
||||
for (loopCount = 0; loopCount < CommonExclusiveGroups.CurrentBlockEntityID; loopCount++)
|
||||
{
|
||||
ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity<PositionEntityStruct>(loopCount, CommonExclusiveGroups.OWNED_BLOCKS_GROUP);
|
||||
if (!posStruct.Equals(null) && !posStruct.position.Equals(null))
|
||||
{
|
||||
posStruct.position.x += x;
|
||||
posStruct.position.y += y;
|
||||
posStruct.position.z += z;
|
||||
} else {
|
||||
uREPL.Log.Warn("Null position found for ID "+loopCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
uREPL.RuntimeCommands.Unregister("MoveBlocks");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue