Ejemplo n.º 1
0
    /// <summary>
    /// 控制从第几帧播放到第几帧
    /// </summary>
    /// <param name="_index">分段播放下标</param>
    public void OnFramePlay(int _index)
    {
        CurSegment = new AniPlaySegment();

        CurSegment = aniPlaySegments[_index];

        CurSegmentIndex = _index;

        float startTime = (float)CurSegment.minSegment / AllFrame;

        if (CurSegment.maxSegment == -1)
        {
            CurSegment.maxSegment = AllFrame;
        }

        float stopTime = (float)CurSegment.maxSegment / AllFrame;

        m_ani.Play(PlayLayerName, -1, startTime);

        StopFrame = stopTime;
        Debug.Log(startTime + "*******" + StopFrame);
        m_ani.speed = 1;

        IsPlaying = true;
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 控制从第几帧播放到第几帧
    /// </summary>
    /// <param name="_name">播放段的名字</param>
    public void OnFramePlay(string _name)
    {
        CurSegment = new AniPlaySegment();
        foreach (var item in aniPlaySegments)
        {
            if (item.segmentName == _name)
            {
                CurSegment = item;
            }
        }

        float startTime = (float)CurSegment.minSegment / AllFrame;

        if (CurSegment.maxSegment == -1)
        {
            CurSegment.maxSegment = AllFrame;
        }

        float stopTime = (float)CurSegment.maxSegment / AllFrame;

        m_ani.Play(PlayLayerName, -1, startTime);

        StopFrame = stopTime;

        m_ani.speed = 1;

        IsPlaying = true;
    }