private void Update() { if (currentShapeProvider != polyShapeProvider.UsedObject) { OnPolyShapeProviderChange(currentShapeProvider, polyShapeProvider.UsedObject); currentShapeProvider = polyShapeProvider.UsedObject; } }
private void Update() { if (old != polyShapeProvider.UsedObject) { OnPolyShapeProviderChange(old, polyShapeProvider.UsedObject); old = polyShapeProvider.UsedObject; } }
public void OnPolyShapeProviderChange(IPolyShapeProvider oldObj, IPolyShapeProvider newObj) { currentShapeProvider = newObj; if (oldObj != null) { oldObj.OnPolyShapeChange -= OnDraw; } if (newObj != null) { newObj.OnPolyShapeChange += OnDraw; Draw(); } }
public void OnPolyShapeProviderChange(IPolyShapeProvider oldObj, IPolyShapeProvider newObj) { if (oldObj != null) { oldObj.OnPolyShapeChange -= Draw; } if (newObj != null) { newObj.OnPolyShapeChange += Draw; lastPolyShape = newObj.Poly; } else { lastPolyShape = null; } needGenerateMesh = true; SetVerticesDirty(); }
void OnDraw(IPolyShapeProvider pp) { Draw(); }
void Draw(IPolyShapeProvider polyShapeProvider) { lastPolyShape = polyShapeProvider.Poly; needGenerateMesh = true; SetVerticesDirty(); }