Ejemplo n.º 1
0
        private void PushIntoTackline(int lineIndex, IPTTile node)
        {
            CurveTrackLine line = _lineList[lineIndex];

            if (line == null)
            {
                Debug.LogError("not contain this line index " + lineIndex);
            }

            intoTrackNodeCount++;

            line.PushValue(node, intoTrackNodeCount);
        }
Ejemplo n.º 2
0
        public override bool CheckPushValue(IPTTile value, int lineIndex = -1)
        {
            if (lineIndex < 0)
            {
                return(_prepareList.Count < m_maxCacheNum);
            }

            CurveTrackLine trackline = _lineList[lineIndex];

            if (trackline == null)
            {
                return(false);
            }
            return(trackline.CheckPushValue(value));
        }
Ejemplo n.º 3
0
        public override void SetTracklineNum(int num, float lineSpace)
        {
            base.SetTracklineNum(num, lineSpace);

            int   midIndex = 0;
            float offsetX  = 0f;

            if (num % 2 == 0)
            {
                midIndex = (int)(num * 0.5f);
                for (int i = 0; i < num; ++i)
                {
                    if (i < midIndex)
                    {
                        offsetX = (i - midIndex + 0.5f) * _data.lineSpace;
                    }
                    else
                    {
                        offsetX = (i - midIndex + 0.5f) * _data.lineSpace;
                    }

                    if (_lineList.Count <= i)
                    {
                        CurveTrackLine line = new CurveTrackLine(this);
                        line.lineIndex = i;
                        _lineList.Add(line);
                    }
                    _lineList[i].OffsetX = offsetX;
                }
            }
            else
            {
                midIndex = (int)(num * 0.5f);
                for (int i = 0; i < num; ++i)
                {
                    offsetX = (i - midIndex) * _data.lineSpace;

                    if (_lineList.Count <= i)
                    {
                        CurveTrackLine line = new CurveTrackLine(this);
                        line.lineIndex = i;
                        _lineList.Add(line);
                    }

                    _lineList[i].OffsetX = offsetX;
                }
            }
        }
Ejemplo n.º 4
0
        public override bool PushValue(IPTTile node, int lineIndex)
        {
            CurveTrackLine line = _lineList[lineIndex];

            if (line != null)
            {
                line.ApplyforResource(node);
            }

            CacheData data = new CacheData();

            data.lineIndex = lineIndex;
            data.node      = node;

            _prepareList.Add(data);
            return(true);
        }