Exemple #1
0
        public void TestRPC_SetFingerMode()
        {
            CubeFingerMode mode = CubeFingerMode.Delete;

            finger.RPC_SetFingerMode((int)mode);
            Assert.AreEqual(mode, finger.Mode);
        }
Exemple #2
0
        public void TestModeChange()
        {
            CubeFingerMode expected = CubeFingerMode.Delete;
            CubeFingerMode actual   = CubeFingerMode.None;

            finger.OnModeChanged += (object sender, CubeFingerMode mode) => actual = mode;

            finger.Mode = expected;
            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        private void SendModeChanged(object sender, CubeFingerMode mode)
        {
            if (IsMine)
            {
                networkView.RPC("SetFingerMode", RPCMode.Server, (int)mode);
            }

            if (Network.isServer)
            {
                networkView.RPC("SetFingerMode", RPCMode.Others, (int)mode);
            }
        }
Exemple #4
0
        public void TestNoModeChange()
        {
            CubeFingerMode value  = CubeFingerMode.Delete;
            CubeFingerMode actual = CubeFingerMode.None;

            finger.OnModeChanged += (object sender, CubeFingerMode mode) => actual = mode;
            finger.Mode           = value;

            actual = CubeFingerMode.None;

            finger.Mode = value;

            Assert.AreEqual(CubeFingerMode.None, actual);
        }
Exemple #5
0
        /// <summary>
        /// Show or hide the cubefinger depending on the new mode. If the new mode is not delete,
        /// reset the selected block and finger color.
        /// </summary>
        private void modeChanged(object sender, CubeFingerMode mode)
        {
            switch (mode)
            {
            case CubeFingerMode.Delete:
            case CubeFingerMode.Build:
                ShowFinger(true);
                break;

            default:
                ShowFinger(false);
                break;
            }

            if (mode != CubeFingerMode.Delete)
            {
                enableHiddenBlock();
                SetColor(FingerColor);
            }
        }