コード例 #1
0
        public TableBuilder AddFlipper(string name)
        {
            var data = new FlipperData($"GameItem{_gameItem++}")
            {
                Name = name, Center = new Vertex2D(500, 500)
            };

            _table.Add(new Flipper.Flipper(data));
            return(this);
        }
コード例 #2
0
        public TableBuilder AddFlipper(string name, bool isDualWound = false)
        {
            var data = new FlipperData($"GameItem{_gameItem++}")
            {
                Name        = name, Center = new Vertex2D(500, 500),
                IsDualWound = isDualWound,
            };

            _tableContainer.Add(new Flipper.Flipper(data));
            return(this);
        }
コード例 #3
0
    //
    private void SetUpFlippers()
    {
        FlipperData flipleft = new FlipperData()
        {
            flipperPower = flipperPower,
            flipperDamp  = flipperDamp,
            UpAngle      = UpAngle,
            DownAngle    = DownAngle
        };

        flipperleft.SetUp(flipleft);
        flipperright.SetUp(flipleft);
    }
コード例 #4
0
    public void SetUp(FlipperData d)
    {
        joint = GetComponent<HingeJoint>();
        data = d;

        //Set up springiness
        joint.useSpring = false;
        JointSpring js = new JointSpring();
        js.spring = data.flipperPower;
        js.damper = data.flipperDamp;

        //Set up limits
        //Left Flipper
        JointLimits limit = new JointLimits();
        limit.min = data.UpAngle;
        limit.max = data.DownAngle;
        js.targetPosition = data.UpAngle;
        joint.spring = js;
        joint.limits = limit;
    }
コード例 #5
0
        private static void ValidateFlipper(FlipperData data)
        {
            data.BaseRadius.Should().Be(30.0303f);
            data.Center.X.Should().Be(269.287f);
            data.Center.Y.Should().Be(1301.21f);
            data.Elasticity.Should().Be(0.823f);
            data.ElasticityFalloff.Should().Be(0.4321f);
            data.EndAngle.Should().Be(70.701f);
            data.EndRadius.Should().Be(20.1762f);
            data.FlipperRadius.Should().Be(150.987f);
            data.FlipperRadiusMax.Should().Be(150.987f);
            data.FlipperRadiusMin.Should().Be(0.332f);
            data.Friction.Should().Be(0.6187f);
            data.Height.Should().Be(70.1627f);
            data.Image.Should().Be("ldr");
            data.IsEnabled.Should().Be(true);
            data.IsReflectionEnabled.Should().Be(true);
            data.IsVisible.Should().Be(true);
            data.Mass.Should().Be(1.1992f);
            data.Material.Should().Be("Playfield");
            data.OverridePhysics.Should().Be(0);
            data.RampUp.Should().Be(3.109f);
            data.Return.Should().Be(0.05813f);
            data.RubberHeight.Should().Be(19.912f);
            data.RubberMaterial.Should().Be("");
            data.RubberWidth.Should().Be(24.1872f);
            data.Scatter.Should().Be(0.192f);
            data.StartAngle.Should().Be(121.163f);
            data.Strength.Should().Be(2200.1832f);
            data.Surface.Should().Be("");
            data.TorqueDamping.Should().Be(0.7532f);
            data.TorqueDampingAngle.Should().Be(6.209f);

            data.TimerInterval.Should().Be(100);
            data.IsTimerEnabled.Should().Be(false);

            data.EditorLayer.Should().Be(0);
            data.EditorLayerName.Should().Be("Layer_1");
            data.EditorLayerVisibility.Should().Be(true);
            data.IsLocked.Should().Be(false);
        }
コード例 #6
0
        private static void ValidateFlipper(FlipperData data)
        {
            Assert.Equal(30.0303f, data.BaseRadius);
            Assert.Equal(269.287f, data.Center.X);
            Assert.Equal(1301.21f, data.Center.Y);
            Assert.Equal(0.823f, data.Elasticity);
            Assert.Equal(0.4321f, data.ElasticityFalloff);
            Assert.Equal(70.701f, data.EndAngle);
            Assert.Equal(20.1762f, data.EndRadius);
            Assert.Equal(150.987f, data.FlipperRadius);
            Assert.Equal(150.987f, data.FlipperRadiusMax);
            Assert.Equal(0.332f, data.FlipperRadiusMin);
            Assert.Equal(0.6187f, data.Friction);
            Assert.Equal(70.1627f, data.Height);
            Assert.Equal("ldr", data.Image);
            Assert.Equal(true, data.IsEnabled);
            Assert.Equal(true, data.IsReflectionEnabled);
            Assert.Equal(true, data.IsVisible);
            Assert.Equal(1.1992f, data.Mass);
            Assert.Equal("Playfield", data.Material);
            Assert.Equal(0, data.OverridePhysics);
            Assert.Equal(3.109f, data.RampUp);
            Assert.Equal(0.05813f, data.Return);
            Assert.Equal(19.912f, data.RubberHeight);
            Assert.Equal("", data.RubberMaterial);
            Assert.Equal(24.1872f, data.RubberWidth);
            Assert.Equal(0.192f, data.Scatter);
            Assert.Equal(121.163f, data.StartAngle);
            Assert.Equal(2200.1832f, data.Strength);
            Assert.Equal("", data.Surface);
            Assert.Equal(0.7532f, data.TorqueDamping);
            Assert.Equal(6.209f, data.TorqueDampingAngle);

            Assert.Equal(100f, data.TimerInterval);
            Assert.Equal(false, data.IsTimerEnabled);

            Assert.Equal(0, data.EditorLayer);
            Assert.Equal(false, data.IsLocked);
        }