public override void Draw(FrameMesh component)
        {
            var mesh = component.Mesh;

            var device = GraphicDeviceFactory.Device;

            device.PrimitiveTopology = IAPrimitive.TriangleList;
            device.SetVertexBuffer(0, mesh.VertexBuffer, 0);
            device.SetIndexBuffer(mesh.IndexBuffer, 0);

            var materials = component.Materials;

            if (Clipping == PixelClipping.Opaque)
            {
                var transparents = component.TransparentMaterials;
                for (int i = 0, len = transparents.Length; i < len; i++)
                {
                    Bind(materials[transparents[i]]);
                    Bind <IVisualMaterial>(materials[transparents[i]]);
                    RenderLayers(device, mesh.GetLayersByMaterial(transparents[i]));
                }
            }
            else
            {
                for (int i = 0; i < materials.Length; i++)
                {
                    Bind(materials[i]);
                    Bind <IVisualMaterial>(materials[i]);
                    RenderLayers(device, mesh.GetLayersByMaterial(i));
                }
            }

            //UnBind(component);
        }
Ejemplo n.º 2
0
 private void Awake()
 {
     gridCanvas  = GetComponentInChildren <Canvas>();
     hexMesh     = GetComponentInChildren <HexMesh>();
     frameMesh   = GetComponentInChildren <FrameMesh>();
     targetCells = new List <HexCell>();
     cells       = new HexCell[height * width];
     for (int x = 0, i = 0; x < width; x++)
     {
         for (int z = 0; z < height; z++)
         {
             CreatCell(x, z, i++);
         }
     }
 }
Ejemplo n.º 3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (BorderImage.Length != 0)
            {
                hash ^= BorderImage.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (color_ != null)
            {
                hash ^= Color.GetHashCode();
            }
            if (IsMetallic != false)
            {
                hash ^= IsMetallic.GetHashCode();
            }
            if (FrameMesh.Length != 0)
            {
                hash ^= FrameMesh.GetHashCode();
            }
            if (NormalMap.Length != 0)
            {
                hash ^= NormalMap.GetHashCode();
            }
            if (AlbedoMap.Length != 0)
            {
                hash ^= AlbedoMap.GetHashCode();
            }
            if (Roughness != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Roughness);
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }