Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            if (CannotModifyInPlayMode())
            {
                GUI.enabled = false;
            }

            UpdatePrefabModifiedProperties();

            var defaultLabelStyle = EditorStyles.label.fontStyle;

            EditorStyles.label.fontStyle = viewEventPrefabModified
                                ? FontStyle.Bold
                                : defaultLabelStyle;

            ShowEventMenu(
                UnityEventWatcher.GetBindableEvents(targetScript.gameObject)
                .OrderBy(evt => evt.Name)
                .ToArray(),
                updatedValue => targetScript.ViewEventName = updatedValue,
                targetScript.ViewEventName
                );

            EditorStyles.label.fontStyle = viewModelMethodPrefabModified
                                ? FontStyle.Bold
                                : defaultLabelStyle;

            ShowMethodMenu(targetScript, TypeResolver.FindBindableMethods(targetScript));

            if (targetScript.ViewModelMethodName != null)
            {
                var methodName = targetScript.ViewModelMethodName.Split('.');
                if (methodName != null && methodName.Length > 1)
                {
                    var parametersInfos = TypeResolver.FindBindableMethodsParameters(targetScript, methodName[1]);
                    if (parametersInfos != null)
                    {
                        targetScript.Parameter = EditorGUILayout.TextField($"[string only] {parametersInfos.Name} : ", targetScript.Parameter);
                        UpdateProperty(updatedValue => targetScript.Parameter = updatedValue, targetScript.Parameter, targetScript.Parameter, "aezezaeza");
                    }
                }
            }


            EditorStyles.label.fontStyle = defaultLabelStyle;
        }