Ejemplo n.º 1
0
    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();
        }
    }
Ejemplo n.º 2
0
 public StopGroup(GradientStopUI stop, T value)
 {
     this.stop  = stop;
     this.value = value;
 }