Пример #1
0
        void GUITargetMethodArgs()
        {
            ParameterInfo[] parameterInfoList = _targetMethodInfo.GetParameters();
            EditorGUILayout.LabelField(string.Format("methodArgsSize:{0}", parameterInfoList.Length));
            using (new EditorGUIIndentLevelScope())
            {
                for (int i = 0; i < parameterInfoList.Length; i++)
                {
                    ParameterInfo parameterInfo = parameterInfoList[i];
                    using (new EditorGUILayoutBeginHorizontalScope())
                    {
                        EditorGUILayout.LabelField(parameterInfo.Name, GUILayout.Width(100));
                        if (_targetMethodInfoArgList.Count <= i || _targetMethodInfoArgList[i] == null ||
                            parameterInfo.ParameterType != _targetMethodInfoArgList[i].GetType())
                        {
                            _targetMethodInfoArgList[i] = parameterInfo.DefaultValue;
                            if (_targetMethodInfoArgList[i] == null)
                            {
                                _targetMethodInfoArgList[i] = parameterInfo.ParameterType.DefaultValue();
                            }
                        }

                        _targetMethodInfoArgList[i] =
                            EditorGUILayoutUtil.Field("", parameterInfo.ParameterType, _targetMethodInfoArgList[i]);
                    }
                }

                _self.targetMethodArgsJsonString = _targetMethodInfoArgList.Count == 0
                                        ? ""
                                        : JsonSerializer.Serialize(_targetMethodInfoArgList);
            }
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            _self = target as TransformTweenClip;


            using (new EditorGUILayoutBeginHorizontalScope())
            {
                if (EditorGUILayoutUtil.Toggle("UseTarget(T)", ref _self.template.isUsePositionTarget))
                {
                    _self.template.positionTarget = EditorGUILayout.Vector3Field("", _self.template.positionTarget);
                }
            }

            using (new EditorGUILayoutBeginHorizontalScope())
            {
                if (EditorGUILayoutUtil.Toggle("UseTarget(R)", ref _self.template.isUseRotationTarget))
                {
                    _self.template.rotationTarget = EditorGUILayout.Vector3Field("", _self.template.rotationTarget);
                }
            }


            using (new EditorGUILayoutBeginHorizontalScope())
            {
                if (EditorGUILayoutUtil.Toggle("UseTarget(S)", ref _self.template.isUseScaleTarget))
                {
                    _self.template.scaleTarget = EditorGUILayout.Vector3Field("", _self.template.scaleTarget);
                }
            }

            EditorGUILayoutUtil.Space(4);

            using (new EditorGUILayoutBeginHorizontalScope())
            {
                _self.template.positionMultiply =
                    EditorGUILayout.Vector3Field("Mutiply(T)", _self.template.positionMultiply);
            }

            using (new EditorGUILayoutBeginHorizontalScope())
            {
                _self.template.rotationMultiply =
                    EditorGUILayout.Vector3Field("Mutiply(R)", _self.template.rotationMultiply);
            }

            using (new EditorGUILayoutBeginHorizontalScope())
            {
                _self.template.scaleMultiply = EditorGUILayout.Vector3Field("Mutiply(S)", _self.template.scaleMultiply);
            }
        }