private void Init() { if (graphicClass == null) { cachedGraphic = null; return; } ShaderTypeDef cutout = shaderType; if (cutout == null) { cutout = ShaderTypeDefOf.Cutout; } Shader shader = cutout.Shader; cachedGraphic = GraphicDatabase.Get(graphicClass, texPath, shader, drawSize, color, colorTwo, this, shaderParameters); if (onGroundRandomRotateAngle > 0.01f) { cachedGraphic = new Graphic_RandomRotated(cachedGraphic, onGroundRandomRotateAngle); } if (Linked) { cachedGraphic = GraphicUtility.WrapLinked(cachedGraphic, linkType); } }
private void Init() { if (this.graphicClass == null) { this.cachedGraphic = null; } else { ShaderTypeDef cutout = this.shaderType; if (cutout == null) { cutout = ShaderTypeDefOf.Cutout; } Shader shader = cutout.Shader; this.cachedGraphic = GraphicDatabase.Get(this.graphicClass, this.texPath, shader, this.drawSize, this.color, this.colorTwo, this, this.shaderParameters); if (this.onGroundRandomRotateAngle > 0.01f) { this.cachedGraphic = new Graphic_RandomRotated(this.cachedGraphic, this.onGroundRandomRotateAngle); } if (this.Linked) { this.cachedGraphic = GraphicUtility.WrapLinked(this.cachedGraphic, this.linkType); } } }
public void CopyFrom(GraphicData other) { this.texPath = other.texPath; this.graphicClass = other.graphicClass; this.shaderType = other.shaderType; this.color = other.color; this.colorTwo = other.colorTwo; this.drawSize = other.drawSize; this.onGroundRandomRotateAngle = other.onGroundRandomRotateAngle; this.drawRotated = other.drawRotated; this.allowFlip = other.allowFlip; this.flipExtraRotation = other.flipExtraRotation; this.shadowData = other.shadowData; this.damageData = other.damageData; this.linkType = other.linkType; this.linkFlags = other.linkFlags; }
public void CopyFrom(GraphicData other) { texPath = other.texPath; graphicClass = other.graphicClass; shaderType = other.shaderType; color = other.color; colorTwo = other.colorTwo; drawSize = other.drawSize; drawOffset = other.drawOffset; drawOffsetNorth = other.drawOffsetNorth; drawOffsetEast = other.drawOffsetEast; drawOffsetSouth = other.drawOffsetSouth; drawOffsetWest = other.drawOffsetSouth; onGroundRandomRotateAngle = other.onGroundRandomRotateAngle; drawRotated = other.drawRotated; allowFlip = other.allowFlip; flipExtraRotation = other.flipExtraRotation; shadowData = other.shadowData; damageData = other.damageData; linkType = other.linkType; linkFlags = other.linkFlags; cachedGraphic = null; }