// Show Window
        //--------------------------------------------------------------
        public static object ShowDialog(apEditor editor, PARAM_TYPE paramTypeFilter, FUNC_SELECT_CONTROLPARAM_RESULT funcResult)
        {
            CloseDialog();

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

            EditorWindow curWindow = EditorWindow.GetWindow(typeof(apDialog_SelectControlParam), true, "Select Control Param", true);
            apDialog_SelectControlParam curTool = curWindow as apDialog_SelectControlParam;

            object loadKey = new object();

            if (curTool != null && curTool != s_window)
            {
                int width  = 250;
                int height = 400;
                s_window          = curTool;
                s_window.position = new Rect((editor.position.xMin + editor.position.xMax) / 2 - (width / 2),
                                             (editor.position.yMin + editor.position.yMax) / 2 - (height / 2),
                                             width, height);
                s_window.Init(editor, loadKey, paramTypeFilter, funcResult);

                return(loadKey);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        public object Convert(object value, Type TargetType, object parameter, CultureInfo culture)
        {
            string file = null;

            if (value != null)
            {
                file = value.ToString();
            }

            if (String.IsNullOrEmpty(file) == false)
            {
                PARAM_TYPE param = PARAM_TYPE.FILE;

                if (parameter != null && parameter.Equals("directory"))
                {
                    param = PARAM_TYPE.DIRECTORY;
                }

                switch (param)
                {
                case PARAM_TYPE.FILE:
                    file = Path.GetFileName(file);
                    break;

                case PARAM_TYPE.DIRECTORY:
                    file = Path.GetDirectoryName(file);
                    break;
                }
            }

            return(file);
        }
        // Init
        //--------------------------------------------------------------
        public void Init(apEditor editor, object loadKey, PARAM_TYPE paramTypeFilter, FUNC_SELECT_CONTROLPARAM_RESULT funcResult)
        {
            _editor  = editor;
            _loadKey = loadKey;
            //_paramTypeFilter = paramTypeFilter;



            _funcResult = funcResult;

            _controlParams.Clear();

            List <apControlParam> cParams = _editor._portrait._controller._controlParams;

            for (int i = 0; i < cParams.Count; i++)
            {
                apControlParam.TYPE paramType = cParams[i]._valueType;
                bool isAdded = false;
                switch (paramType)
                {
                //case apControlParam.TYPE.Bool:
                //	if((int)(paramTypeFilter & PARAM_TYPE.Bool) != 0) { isAdded = true; }
                //	break;

                case apControlParam.TYPE.Int:
                    if ((int)(paramTypeFilter & PARAM_TYPE.Int) != 0)
                    {
                        isAdded = true;
                    }
                    break;

                case apControlParam.TYPE.Float:
                    if ((int)(paramTypeFilter & PARAM_TYPE.Float) != 0)
                    {
                        isAdded = true;
                    }
                    break;

                case apControlParam.TYPE.Vector2:
                    if ((int)(paramTypeFilter & PARAM_TYPE.Vector2) != 0)
                    {
                        isAdded = true;
                    }
                    break;

                    //case apControlParam.TYPE.Vector3:
                    //	if((int)(paramTypeFilter & PARAM_TYPE.Vector3) != 0) { isAdded = true; }
                    //	break;

                    //case apControlParam.TYPE.Color:
                    //	if((int)(paramTypeFilter & PARAM_TYPE.Color) != 0) { isAdded = true; }
                    //	break;
                }

                if (isAdded)
                {
                    _controlParams.Add(cParams[i]);
                }
            }
        }
Esempio n. 4
0
            public SubParameter()
            {
                _paramType = PARAM_TYPE.Integer;

                _boolValue  = false;
                _intValue   = 0;
                _floatValue = 0.0f;
                _vec2Value  = Vector2.zero;
                _strValue   = "";              //<<이건 보간이 안된다.

                _intValue_End   = 0;
                _floatValue_End = 0.0f;
                _vec2Value_End  = Vector2.zero;
            }