Ejemplo n.º 1
0
        protected override bool ShouldGenerateNewMesh(BaseShape.Model newModel)
        {
            if (currentMesh == null)
            {
                return(true);
            }

            Model newPlaneModel = newModel as Model;

            if (newPlaneModel.uvs != null && model.uvs != null)
            {
                if (newPlaneModel.uvs.Length != model.uvs.Length)
                {
                    return(true);
                }

                for (int i = 0; i < newPlaneModel.uvs.Length; i++)
                {
                    if (newPlaneModel.uvs[i] != model.uvs[i])
                    {
                        return(true);
                    }
                }
            }
            else
            {
                if (newPlaneModel.uvs != model.uvs)
                {
                    return(true);
                }
            }

            return(newPlaneModel.width != model.width || newPlaneModel.height != model.height);
        }
Ejemplo n.º 2
0
        protected override bool ShouldGenerateNewMesh(BaseShape.Model previousModel)
        {
            if (currentMesh == null)
            {
                return(true);
            }

            BoxShape.Model newBoxModel = (BoxShape.Model) this.model;
            BoxShape.Model oldBoxModel = (BoxShape.Model)previousModel;

            if (newBoxModel.uvs != null && oldBoxModel.uvs != null)
            {
                if (newBoxModel.uvs.Length != oldBoxModel.uvs.Length)
                {
                    return(true);
                }

                for (int i = 0; i < newBoxModel.uvs.Length; i++)
                {
                    if (newBoxModel.uvs[i] != oldBoxModel.uvs[i])
                    {
                        return(true);
                    }
                }
            }
            else
            {
                if (newBoxModel.uvs != oldBoxModel.uvs)
                {
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 3
0
        protected override bool ShouldGenerateNewMesh(BaseShape.Model newModel)
        {
            if (currentMesh == null)
            {
                return(true);
            }

            Model newCylinderModel = newModel as Model;

            return(newCylinderModel.radius != model.radius ||
                   newCylinderModel.radiusTop != model.radiusTop ||
                   newCylinderModel.radiusBottom != model.radiusBottom ||
                   newCylinderModel.segmentsHeight != model.segmentsHeight ||
                   newCylinderModel.segmentsRadial != model.segmentsRadial ||
                   newCylinderModel.openEnded != model.openEnded ||
                   newCylinderModel.arc != model.arc);
        }
Ejemplo n.º 4
0
 protected override bool ShouldGenerateNewMesh(BaseShape.Model newModel)
 {
     return(currentMesh == null);
 }
Ejemplo n.º 5
0
 protected virtual bool ShouldGenerateNewMesh(BaseShape.Model newModel)
 {
     return(true);
 }