示例#1
0
 /// <summary>
 /// Set the color of this finger. Since the finger color is controlled by the server,
 /// no data is sent by the client.
 /// </summary>
 /// <param name="color">The color the finger should get.</param>
 public void SetColor(Color color)
 {
     color.a          = CUBEFINGER_ALPHA;
     this.FingerColor = color;
     gameObject.renderer.material.color = color;
     if (network.isServer)
     {
         networkView.RPC("ColorFinger", RPCMode.Others, ColorModel.ConvertToVector3(color));
     }
 }
示例#2
0
文件: Player.cs 项目: MaartenvE/game1
        public void SetPlaceableBlock(HalfBlock.HalfBlock block)
        {
            this.HalfBlock         = block;
            this.HasPlaceableBlock = true;

            Color color = HalfBlock.CalculateUnityColor();

            networkView.RPC("SetBlockType", NetworkPlayer, 1, ColorModel.ConvertToVector3(color));
            CubeFinger.Renderer.SetColor(color);
        }
示例#3
0
文件: Player.cs 项目: MaartenvE/game1
        public void GiveNewInventoryBlock()
        {
            HalfBlock = new HalfBlock.HalfBlock(getNewHalfBlockColor());
            Vector3 color = ColorModel.ConvertToVector3(HalfBlock.CalculateUnityColor());

            CubeFinger.Renderer.SetColor(HalfBlock.CalculateUnityColor());
            if (HalfBlock.wrappedObject.color.isSecondaryColor)
            {
                HasPlaceableBlock = false;
            }
            else
            {
                HasPlaceableBlock = Random.value < FULL_BLOCK_CHANCE;
            }
            networkView.RPC("SetBlockType", NetworkPlayer, HasPlaceableBlock ? 1 : 0, color);
        }
示例#4
0
 public override void OnPlayerConnected(INetworkPlayer player)
 {
     networkView.RPC("SetFingerMode", player, (int)Mode);
     networkView.RPC("ColorFinger", player, ColorModel.ConvertToVector3(Renderer.FingerColor));
 }