private void AddStop(string id, float position, T value) { GradientStopUI stop = Instantiate(gradientStopTemplate, gradientStopsContainer); stop.Setup(); stop.SetId(id); stop.SetPosition(position); stop.onClick += () => { SelectStop(stop.GetId()); }; stop.onDragged += (np) => { changeStopPositionRequested?.Invoke(stop.GetId(), np); }; stop.onRemoveGesture += () => { removeStopRequested?.Invoke(stop.GetId()); }; stop.gameObject.SetActive(true); stops.Add(new StopGroup(stop, value)); if (!changingStops) { EndChangingStops(); } }
public StopGroup(GradientStopUI stop, T value) { this.stop = stop; this.value = value; }