Ejemplo n.º 1
0
        //=============================================================================================
        /// <summary>
        /// ポイント選択開始
        /// </summary>
        /// <param name="pointSelector"></param>
        void StartEdit(PointSelector pointSelector)
        {
            // 毎回初期化する
            // 各ポイントのタイプ情報を設定
            pointSelector.AddPointType("Move Point", Color.green, SelectionData.Move);
            pointSelector.AddPointType("Fixed Point", Color.red, SelectionData.Fixed);
            pointSelector.AddPointType("Invalid Point", Color.gray, SelectionData.Invalid);

            // メッシュデータ
            List <Vector3> wposList;
            List <Vector3> wnorList;
            List <Vector3> wtanList;
            int            meshVertexCount = editorMesh.GetEditorPositionNormalTangent(out wposList, out wnorList, out wtanList);

            // 選択データ初期化
            selectorData.Clear();
            for (int i = 0; i < meshVertexCount; i++)
            {
                selectorData.Add(0); // Invalid
            }
            OnResetSelector(selectorData);

            if (meshVertexCount == 0)
            {
                return;
            }

            // 各ポイントデータをセレクタークラスへ流し込む
            for (int i = 0; i < meshVertexCount; i++)
            {
                pointSelector.AddPoint(wposList[i], i, selectorData[i]);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// ポイント選択終了
        /// </summary>
        /// <param name="pointSelector"></param>
        void EndEdit(PointSelector pointSelector)
        {
            // 現在のポイント内容をデータに反映
            var pointList = pointSelector.GetPointList();

            foreach (var p in pointList)
            {
                selectorData[p.index] = p.value;
            }

            // 確定
            OnFinishSelector(selectorData);
        }