public void TestRPC_SetFingerMode() { CubeFingerMode mode = CubeFingerMode.Delete; finger.RPC_SetFingerMode((int)mode); Assert.AreEqual(mode, finger.Mode); }
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); }
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); } }
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); }
/// <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); } }