protected Graphic MakeSubgraphic(GraphicRequest req, GraphicExtraData extraData, string texSuffix) { var childReq = GraphicExtraData.CopyGraphicRequest(req); childReq.graphicClass = typeof(T); var tmpG = new T(); if (tmpG is IHaveGraphicExtraData ihged && extraData != null) { var tmpPath = extraData.texPath; extraData.texPath += texSuffix; ihged.ExtraInit(childReq, extraData); extraData.texPath = tmpPath; }
public virtual void ExtraInit(GraphicRequest req, GraphicExtraData extraData) { arrow = arrow00; this.data = req.graphicData; this.color = req.color; this.colorTwo = req.colorTwo; this.drawSize = req.drawSize; this.subGraphic = new Graphic_Single(); if (extraData == null) { this.subGraphic.Init(req); this.path = req.path; return; } var req2 = GraphicExtraData.CopyGraphicRequest(req, extraData.texPath); this.path = extraData.texPath; this.subGraphic.Init(req2); if (extraData.arrowDrawOffset != null) { var v = extraData.arrowDrawOffset.Value; for (int i = 0; i < 4; i++) { arrowOffsetsByRot4[i] = new Vector3(v.x, v.y, v.z); } } if (extraData.arrowEastDrawOffset != null) { arrowOffsetsByRot4[1] = extraData.arrowEastDrawOffset.Value; } if (extraData.arrowWestDrawOffset != null) { arrowOffsetsByRot4[3] = extraData.arrowWestDrawOffset.Value; } if (extraData.arrowNorthDrawOffset != null) { arrowOffsetsByRot4[0] = extraData.arrowNorthDrawOffset.Value; } if (extraData.arrowSouthDrawOffset != null) { arrowOffsetsByRot4[2] = extraData.arrowSouthDrawOffset.Value; } if (extraData.arrowTexPath1 != null) { this.arrow = MaterialPool.MatFrom(extraData.arrowTexPath1); } }