Example #1
0
    /// <summary>
    /// 頂点Push処理
    /// </summary>
    protected void PushVertex()
    {
        Vector3 p = FuncBox.GetMousePoint(targetCamera);

        if (grid.WorldToGridCrossPosition(out p, p))
        {
            //頂点の数が2つ以下(三角形を作れる最低の頂点数)
            Push(p);
            if (posList.Count > 2)
            {
                //始点と終点が同じか
                if (ContainStartEndPos())
                {
                    //イベント送信(被っている終点を取り除いてから)
                    Vector3 pos = Pop();
                    if (target)
                    {
                        target.SendMessage(functionName, posList, SendMessageOptions.DontRequireReceiver);
                    }
                    if (flagGridEndWithReset)
                    {
                        OnReset();
                    }
                    else
                    {
                        Push(pos);
                    }
                }
            }
        }
    }
Example #2
0
 /// <summary>
 /// 頂点を動かす(マウス)
 /// </summary>
 public void MoveVertex(int index)
 {
     if (0 <= index || index < posList.Count)
     {
         var p = FuncBox.GetMousePoint(targetCamera);
         if (grid.WorldToGridCrossPosition(out p, p))
         {
             posList[index] = p;
         }
     }
 }
Example #3
0
    /// <summary>
    /// マウス移動処理
    /// </summary>
    protected void OnMouseMove()
    {
        var p = FuncBox.GetMousePoint(targetCamera);

        if (grid.WorldToGridCrossPosition(out p, p))
        {
            Push(p);
            //ラインレンダラに座標を設定
            line.CreateLine(posList);
            //FuncBox.SetLineRenderer(lineRenderer, posList, true);
            Pop();
        }
    }
Example #4
0
 //マウス座標をローカル座標に変換して取得
 protected Vector3 InverseMousePoint()
 {
     return(transform.InverseTransformPoint(FuncBox.GetMousePoint(targetCamera)));
 }
Example #5
0
    /// <summary>
    /// 最後の要素の座標をマウス座標をで変更する
    /// </summary>
    public void ChangeEndPosition_Mouse()
    {
        Vector3 pos = FuncBox.GetMousePoint(targetCamera);

        ChangeEndPosition(pos);
    }
Example #6
0
    /// <summary>
    /// マウス座標を最後の要素に挿入
    /// </summary>
    public void InsertEndPosition_Mouse()
    {
        Vector3 pos = FuncBox.GetMousePoint(targetCamera);

        InsertEndPosition(pos);
    }
Example #7
0
 /// <summary>
 /// マウスの座標をグリッド座標に直して取得する。戻り値はグリッド内の座標か
 /// </summary>
 public bool GetMouseGridPos(out Vector3 mPos)
 {
     mPos = FuncBox.GetMousePoint(targetCamera);
     return(grid.WorldToGridCrossPosition(out mPos, mPos));
 }
Example #8
0
    /// <summary>
    /// 一時的にマウス座標を追加して線を描画する
    /// </summary>
    public void FlashPosition_Mouse()
    {
        Vector3 pos = FuncBox.GetMousePoint(targetCamera);

        FlashPosition(pos);
    }
Example #9
0
    /// <summary>
    /// インデックスを指定して座標の変更をマウス座標で変更する
    /// </summary>
    public void ChangePosition_Mouse(int index)
    {
        Vector3 pos = FuncBox.GetMousePoint(targetCamera);

        ChangePosition(index, pos);
    }