Ejemplo n.º 1
0
        /// <summary>
        /// 入力フィールドの表示 (Rect指定)
        /// </summary>
        private static object InputField(Rect labelRect, Rect fieldRect, string label, Type type, object _object)
        {
            object result = null;

            if (InputFieldActionDictOfRectWithLabel.ContainsKey(type))
            {
                result = InputFieldActionDictOfRectWithLabel[type].Invoke(labelRect, fieldRect, label, _object);
            }
            else
            if (InputFieldActionDictOfRect.ContainsKey(type))
            {
                EditorGUI.LabelField(labelRect, label);
                result = InputFieldInternal(fieldRect, type, _object);
            }
            else
            {
                EditorGUI.LabelField(labelRect, label);
                EditorGUI.BeginDisabledGroup(true);
                EditorGUI.TextField(fieldRect, "[not supported]");
                EditorGUI.EndDisabledGroup();
            }

            return(result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 入力フィールドロジックの登録 (Rect指定)
 /// </summary>
 private static void RegisterInputFieldAction(Type type, Func <Rect, object, object> func)
 {
     InputFieldActionDictOfRect.Add(type, func);
 }