Example #1
0
    /// <summary>
    /// 頂点の削除
    /// </summary>
    private bool RemoveVertex(int index)
    {
        int size = polyLine.GetVertexCount();

        if (size == 0)
        {
            return(false);
        }

        Vector2 p1 = polyLine.GetVertex(index);

        polyLine.Remove(index);
        --size;

        //予告線と補助線の変更
        if (size == 0)
        {
            noticeLine.Clear();
        }
        else
        {
            Vector2 point = polyLine.GetVertex(size - 1);
            noticeLine.Change(0, point);

            //エフェクトの生成
            EmitRemoveEffect(point, p1, density);
        }

        //アニメーションの距離更新
        targetDistance = polyLine.TotalDistance;
        lerped         = true;

        //コールバック
        if (removeVertexCallback != null)
        {
            removeVertexCallback();
        }

        return(true);
    }
Example #2
0
 /// <summary>
 /// 頂点の消去
 /// </summary>
 public void Remove(int index)
 {
     mainLine.Remove(index);
     draw = true;
 }