Exemple #1
0
        // Show Window
        //--------------------------------------------------------------
        public static object ShowDialog(apEditor editor, apMeshGroup srcMeshGroup, FUNC_SELECT_TRANSFORM_RESULT funcResult)
        {
            CloseDialog();

            if (editor == null || editor._portrait == null)
            {
                return(null);
            }

            EditorWindow curWindow             = EditorWindow.GetWindow(typeof(apDialog_AddChildTransform), true, "Add Mesh/MeshGroup", true);
            apDialog_AddChildTransform curTool = curWindow as apDialog_AddChildTransform;

            object loadKey = new object();

            if (curTool != null && curTool != s_window)
            {
                s_window          = curTool;
                s_window.position = new Rect(100, 100, 250, 400);
                s_window.Init(editor, loadKey, srcMeshGroup, funcResult);

                return(loadKey);
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
        // Init
        //--------------------------------------------------------------------
        public void Init(apEditor editor, object loadKey, apMeshGroup srcMeshGroup, FUNC_SELECT_TRANSFORM_RESULT funcResult)
        {
            _editor  = editor;
            _loadKey = loadKey;
            //_srcMeshGroup = srcMeshGroup;
            _funcResult = funcResult;

            //타겟을 검색하자
            _meshes.Clear();
            _meshGroups.Clear();

            for (int i = 0; i < _editor._portrait._meshes.Count; i++)
            {
                _meshes.Add(_editor._portrait._meshes[i]);
            }


            for (int i = 0; i < _editor._portrait._meshGroups.Count; i++)
            {
                apMeshGroup meshGroup = _editor._portrait._meshGroups[i];
                if (meshGroup == srcMeshGroup)
                {
                    continue;
                }
                //재귀적으로 이미 포함된 MeshGroup인지 판단한다.
                //추가 12.03 : 그 반대도 포함해야 한다.
                apTransform_MeshGroup childMeshGroupTransform     = srcMeshGroup.FindChildMeshGroupTransform(meshGroup);
                apTransform_MeshGroup childMeshGroupTransform_Rev = meshGroup.FindChildMeshGroupTransform(srcMeshGroup);
                if (childMeshGroupTransform == null && childMeshGroupTransform_Rev == null)
                {
                    //child가 아닐때
                    _meshGroups.Add(meshGroup);
                }
            }
        }