示例#1
0
    private void Start()
    {
        myEasing = new EasingActions();
        mySource = GetComponent <AudioSource>();

        CurrentZ      = CurrentSquare.transform.localPosition.z;
        NextSquarePos = NextSquare.transform.localPosition;

        var value = NextSquare.ValueController.GridValues[Random.Range(0, NextSquare.ValueController.GridValues.Count - 1)];

        NextSquare.SetOccupied(value);
        ReloadGun();
    }
示例#2
0
    private void ReloadGun()
    {
        CanFire = true;
        GhostSquare.UnOccupy();

        CurrentSquare.SetOccupied(NextSquare.Value);

        //gun values are minus the highest board value.
        var value = NextSquare.ValueController.GridValues[Random.Range(0, NextSquare.ValueController.GridValues.Count - 1)];

        NextSquare.SetOccupied(value);

        AnimateDummyReload();
    }
示例#3
0
        public void nextSquareTest()
        {
            var n = new NextSquare();

            Assert.AreEqual(9, n.nextSquare(5));
            Assert.AreEqual(36, n.nextSquare(35));
            Assert.AreEqual(10000, n.nextSquare(9802));
            Assert.AreEqual(16, n.nextSquare(9));
            Assert.AreEqual(900, n.nextSquare(847));
            Assert.AreEqual(81, n.nextSquare(77));
            Assert.AreEqual(729, n.nextSquare(687));
            Assert.AreEqual(81, n.nextSquare(75));
            Assert.AreEqual(484, n.nextSquare(448));
            Assert.AreEqual(256, n.nextSquare(227));
        }