public static TroughAuthoring SetupGameObject(this Engine.VPT.Trough.Trough Trough, GameObject obj, RenderObjectGroup rog) { var ic = obj.AddComponent <TroughAuthoring>().SetItem(Trough); obj.AddComponent <ConvertToEntity>(); return(ic as TroughAuthoring); }
public static ConvertedItem SetupGameObject(this Engine.VPT.Trough.Trough trough, GameObject obj) { var mainAuthoring = obj.AddComponent <TroughAuthoring>(); mainAuthoring.SetItem(trough); mainAuthoring.UpdatePosition(); obj.GetComponentInParent <Player>().RegisterTrough(trough, obj); return(new ConvertedItem(mainAuthoring)); }
public void ShouldReturnCorrectCoilsForModernMechanical() { var data = new TroughData("Trough") { Type = TroughType.ModernMech, }; var trough = new Engine.VPT.Trough.Trough(data); var coils = trough.AvailableCoils.ToArray(); coils.Should().HaveCount(1); coils[0].Id.Should().Be(Engine.VPT.Trough.Trough.EjectCoilId); }
public void ShouldReturnCorrectSwitchesForClassicSingleBall() { var data = new TroughData("Trough") { Type = TroughType.ClassicSingleBall, }; var trough = new Engine.VPT.Trough.Trough(data); var switches = trough.AvailableSwitches.ToArray(); switches.Should().HaveCount(1); switches[0].Id.Should().Be(Engine.VPT.Trough.Trough.EntrySwitchId); }
public void ShouldReturnCorrectCoilsForTwoCoilsOneSwitch() { var data = new TroughData("Trough") { Type = TroughType.TwoCoilsOneSwitch, }; var trough = new Engine.VPT.Trough.Trough(data); var coils = trough.AvailableCoils.ToArray(); coils.Should().HaveCount(2); coils[0].Id.Should().Be(Engine.VPT.Trough.Trough.EntryCoilId); coils[1].Id.Should().Be(Engine.VPT.Trough.Trough.EjectCoilId); }
public void ShouldReturnCorrectSwitchesForTwoCoilsNSwitches() { var data = new TroughData("Trough") { Type = TroughType.TwoCoilsNSwitches, SwitchCount = 3 }; var trough = new Engine.VPT.Trough.Trough(data); var switches = trough.AvailableSwitches.ToArray(); switches.Should().HaveCount(4); switches[0].Id.Should().Be(Engine.VPT.Trough.Trough.EntrySwitchId); switches[1].Id.Should().Be("1"); switches[2].Id.Should().Be("2"); switches[3].Id.Should().Be("3"); }
public void ShouldReturnCorrectSwitchesForModernMechanical() { var data = new TroughData("Trough") { TransitionTime = 100, RollTime = 1000, Type = TroughType.ModernMech, SwitchCount = 3 }; var trough = new Engine.VPT.Trough.Trough(data); var switches = trough.AvailableSwitches.ToArray(); trough.RollTimeDisabled.Should().Be(500); trough.RollTimeEnabled.Should().Be(500); switches.Should().HaveCount(3); switches[0].Id.Should().Be("1"); switches[1].Id.Should().Be("2"); switches[2].Id.Should().Be("3"); }