コード例 #1
0
ファイル: TimeSlider.cs プロジェクト: mmerchante/aedifex
    protected void DrawTimeIndicators(Rect container)
    {
        float z           = Mathf.Max(1f, Zoom);
        int   zoomScaling = (int)((int)(z / secondsPerTick) * secondsPerTick) + 1;

        int   ticks  = (int)((BaseDuration) / secondsPerTick) * zoomScaling;
        float offset = Offset * container.width * Zoom;

        int accents = ticks / ticksPerAccent;

        while (currentIndicators.Count < accents)
        {
            currentIndicators.Add(indicatorPool.Retrieve());
        }

        if (currentIndicators.Count >= accents)
        {
            List <TimeSliderIndicator> toReturn = new List <TimeSliderIndicator>();
            int toRemove = currentIndicators.Count - accents;

            for (int i = 0; i < toRemove; ++i)
            {
                toReturn.Add(currentIndicators[currentIndicators.Count - 1]);
                indicatorPool.Return(currentIndicators[currentIndicators.Count - 1]);
                currentIndicators.RemoveAt(currentIndicators.Count - 1);
            }
        }

        for (int i = 0; i < currentIndicators.Count; ++i)
        {
            TimeSliderIndicator indicator = currentIndicators[i];
            float t = Mathf.Clamp01(i / (float)accents);
            float x = t * container.width * Zoom - offset;
            indicator.UpdateData(BaseDuration * t, x);
        }
    }
コード例 #2
0
ファイル: EmotionTrack.cs プロジェクト: mmerchante/aedifex
 protected override AbstractTrackChunk <EmotionData> InstanceChunk()
 {
     return(chunkPool.Retrieve());
 }