Ejemplo n.º 1
0
        //=========================================================================================
        void CreateData()
        {
            MagicaBoneCloth scr = target as MagicaBoneCloth;

            Debug.Log("Started creating. [" + scr.name + "]");

            // 共有選択データが存在しない場合は作成する
            if (scr.ClothSelection == null)
            {
                InitSelectorData();
            }

            // チームハッシュ設定
            scr.TeamData.ValidateColliderList();

            // メッシュデータ作成
            CreateMeshData(scr);

            // クロスデータ作成
            CreateClothdata(scr);

            // 検証
            scr.CreateVerifyData();
            serializedObject.ApplyModifiedProperties();

            if (scr.VerifyData() == Define.Error.None)
            {
                Debug.Log("Creation completed. [" + scr.name + "]");
            }
            else
            {
                Debug.LogError("Creation failed.");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// データ検証
        /// </summary>
        private void VerifyData()
        {
            MagicaBoneCloth scr = target as MagicaBoneCloth;

            if (scr.VerifyData() != Define.Error.None)
            {
                // 検証エラー
                serializedObject.ApplyModifiedProperties();
            }
        }
Ejemplo n.º 3
0
        //[DrawGizmo(GizmoType.Selected | GizmoType.Active)]
        static void DrawGizmo(MagicaBoneCloth scr, GizmoType gizmoType)
        {
            bool selected = (gizmoType & GizmoType.Selected) != 0 || (ClothMonitorMenu.Monitor != null && ClothMonitorMenu.Monitor.UI.AlwaysClothShow);

            if (scr.VerifyData() != Define.Error.None)
            {
                DrawRootLine(scr);
                return;
            }

            if (PointSelector.EditEnable)
            {
                DrawRootLine(scr);
                return;
            }

            if (ClothMonitorMenu.Monitor == null)
            {
                return;
            }

            if (selected == false)
            {
                return;
            }


            // デフォーマーギズモ
            DeformerGizmoDrawer.DrawDeformerGizmo(scr, scr, 0.015f);

            if (ClothMonitorMenu.Monitor.UI.DrawCloth)
            {
                // クロスギズモ
                ClothGizmoDrawer.DrawClothGizmo(
                    scr,
                    scr.ClothData,
                    scr.Params,
                    scr.Setup,
                    scr,
                    scr
                    );
            }
            else
            {
                DrawRootLine(scr);
            }
        }