public void Do() { if (firstTime) { firstTime = false; return; } go.SetActive(true); rendererStation.UseIt(go, objectWidth); onNeedUpdate?.Invoke(); }
public PaintCommand(RendererStation rendererStation, GameObject go, float objectWidth, Action onNeedUpdate) { Assert.ArgumentNotNull(rendererStation, nameof(rendererStation)); Assert.ArgumentNotNull(go, nameof(go)); this.rendererStation = rendererStation; this.go = go; this.objectWidth = Mathf.Clamp(objectWidth, 0, float.MaxValue); this.onNeedUpdate = onNeedUpdate; rendererStation.UseIt(go, objectWidth); }