예제 #1
0
        public SkillTimeLineVO getRuntimeSkillVO(bool isEditorUse = false)
        {
            SkillTimeLineVO    skillTimeLineVo = new SkillTimeLineVO();
            List <SkillLineVO> lines           = timeLine.dataProvider;

            if (lines == null)
            {
                return(null);
            }

            int len = lines.Count;

            for (int i = 0; i < len; i++)
            {
                SkillLineVO         lineVO   = lines[i];
                List <SkillPointVO> pointVos = lineVO.points as List <SkillPointVO>;
                if (pointVos == null)
                {
                    continue;
                }

                List <SkillPointVO> resultPointVos = new List <SkillPointVO>();
                foreach (SkillPointVO pointVo in pointVos)
                {
                    if (pointVo.isEmpty == false)
                    {
                        resultPointVos.Add(pointVo);
                    }
                }

                if (resultPointVos.Count > 0)
                {
                    SkillLineVO newLineVO = new SkillLineVO();
                    newLineVO.copyFrom(lineVO);
                    newLineVO.points = resultPointVos;
                    if (newLineVO.enabled == false && isEditorUse)
                    {
                        continue;
                    }
                    skillTimeLineVo.addLine(newLineVO);
                }
            }
            return(skillTimeLineVo);
        }
예제 #2
0
        public void updateView(SkillTimeLineVO value)
        {
            timeLine.Clear();

            _currentSkillTimeLineVo = new SkillTimeLineVO();
            foreach (SkillLineVO lineVO in value.lines)
            {
                List <SkillPointVO> points = new List <SkillPointVO>();

                for (int i = 0; i < totalFrame; i++)
                {
                    SkillPointVO pointVo = new SkillPointVO();
                    pointVo.startTime = i * frameTime;
                    points.Add(pointVo);
                }

                int len = Math.Min(lineVO.points.Count, totalFrame);
                for (int i = 0; i < len; i++)
                {
                    SkillPointVO pointVo = lineVO.points[i];
                    int          index   = (int)(pointVo.startTime / frameTime);

                    if (index >= totalFrame)
                    {
                        this.ShowNotification("超出时间线:" + index + "被修正:" + totalFrame);
                        index             = totalFrame - 1;
                        pointVo.startTime = index * frameTime;
                    }

                    points[index] = pointVo;
                }

                SkillLineVO newLineVo = new SkillLineVO();
                newLineVo.copyFrom(lineVO);
                newLineVo.points = points;
                _currentSkillTimeLineVo.addLine(newLineVo);
            }

            timeLine.dataProvider = _currentSkillTimeLineVo.lines;
        }