Esempio n. 1
0
 private void setupRenderer()
 {
     ComponentExtensions.DestroyIfInstance(rend.sharedMaterial);
     rend.sharedMaterial = meshDef.CreateCombinedMaterial(combineRequest.Atlas);
     meshDef.ApplyMesh(base.gameObject, combineRequest.Mesh);
     rend.enabled = true;
 }
Esempio n. 2
0
        public void SetupRenderer(GameObject gameObject, AvatarModel model, ref Renderer rend)
        {
            if (rend == null)
            {
                rend = MeshDef.CreateRenderer(gameObject);
                model.Definition.RenderProperties.Apply(rend);
            }
            Material material = GetMaterial();
            BodyColorMaterialProperties bodyColorMaterialProperties = new BodyColorMaterialProperties(model.BeakColor, model.BellyColor, model.BodyColor);

            bodyColorMaterialProperties.Apply(material);
            ApplyMaterialProperties(material);
            ComponentExtensions.DestroyIfInstance(rend.sharedMaterial);
            rend.sharedMaterial = material;
            MeshDef.ApplyMesh(gameObject);
        }