Exemple #1
0
        public void InspectorInteractionAction()
        {
            EditorGUILayout.BeginVertical("box");

            interaction.ActiveParent = GUILayout.Toggle(interaction.ActiveParent, "激活【加入子父物体】功能");
            if (interaction.ActiveParent)
            {
                interaction.AddParent();

                interaction.interactionParent.IsSelf = EditorGUILayout.Toggle(new GUIContent("      本身:", "当进行交互时,交互是否这些本身,True为执行本身,对方不执行。反之同理!"), interaction.interactionParent.IsSelf);

                interaction.interactionParent.Parent        = EditorGUILayout.ObjectField(new GUIContent("      父对象:", "需要加入子父物体的父对象"), interaction.interactionParent.Parent, typeof(Transform), true) as Transform;
                interaction.interactionParent.localPosition = EditorGUILayout.Vector3Field("      局部坐标:", interaction.interactionParent.localPosition);
                interaction.interactionParent.localRotation = EditorGUILayout.Vector3Field("      局部旋转值:", interaction.interactionParent.localRotation);
            }
            else
            {
                interaction.RemoveParent();
            }

            GUILayout.Space(10);

            interaction.ActiveShadow = GUILayout.Toggle(interaction.ActiveShadow, "激活【虚影】功能");

            if (interaction.ActiveShadow)
            {
                interaction.AddShadow();
                interaction.interactionShadow.isLocal = EditorGUILayout.Toggle("    ·是否使用局部坐标:", interaction.interactionShadow.isLocal);
                interaction.interactionShadow.IsSelf  = EditorGUILayout.Toggle(new GUIContent("      本身:", "当进行交互时,交互是否执行本身,True为执行本身,对方不执行。反之同理!"), interaction.interactionShadow.IsSelf);

                interaction.interactionShadow.localPosition = EditorGUILayout.Vector3Field("      局部坐标:", interaction.interactionShadow.localPosition);
                interaction.interactionShadow.localRotation = EditorGUILayout.Vector3Field("      局部旋转值:", interaction.interactionShadow.localRotation);

                interaction.interactionShadow.type = (ShadowType)EditorGUILayout.EnumPopup("    ·虚影类型:", interaction.interactionShadow.type);
                if (interaction.interactionShadow.type == ShadowType.Manual)
                {
                    interaction.interactionShadow.traModelNode = EditorGUILayout.ObjectField("    ·虚影模型:", interaction.interactionShadow.traModelNode, typeof(Transform), true) as Transform;
                }
                //interaction.interactionShadow.localScale = EditorGUILayout.Vector3Field("局部大小:", shadow.localScale);

                interaction.interactionShadow.intension   = EditorGUILayout.Slider("    ·虚影透明度:", interaction.interactionShadow.intension, 0.1f, 0.9f);
                interaction.interactionShadow.renderQueue = EditorGUILayout.IntField("    ·Shader渲染层级:", interaction.interactionShadow.renderQueue);
                //interaction.interactionShadow.color=EditorGUILayout.ColorField("    ·虚影透明度:",interaction.interactionShadow.color);
                interaction.interactionShadow.shaderName = EditorGUILayout.TextField("    ·虚影shader名:", interaction.interactionShadow.shaderName);
                interaction.interactionShadow.isReUpdate = EditorGUILayout.Toggle("    ·每次交互更新虚影:", interaction.interactionShadow.isReUpdate);
            }
            else
            {
                interaction.RemoveShadow();
            }

            EditorGUILayout.EndVertical();
        }
        public void InspectorInteractionAction()
        {
            EditorGUILayout.BeginVertical("box");

            interaction.ActiveParent = GUILayout.Toggle(interaction.ActiveParent, "激活【加入子父物体】功能");
            if (interaction.ActiveParent)
            {
                interaction.AddParent();

                interaction.interactionParent.IsSelf = EditorGUILayout.Toggle(new GUIContent("      本身:", "当进行交互时,交互是否这些本身,True为执行本身,对方不执行。反之同理!"), interaction.interactionParent.IsSelf);

                interaction.interactionParent.Parent        = EditorGUILayout.ObjectField(new GUIContent("      父对象:", "需要加入子父物体的父对象"), interaction.interactionParent.Parent, typeof(Transform), true) as Transform;
                interaction.interactionParent.localPosition = EditorGUILayout.Vector3Field("      局部坐标:", interaction.interactionParent.localPosition);
                interaction.interactionParent.localRotation = EditorGUILayout.Vector3Field("      局部旋转值:", interaction.interactionParent.localRotation);
            }
            else
            {
                interaction.RemoveParent();
            }

            GUILayout.Space(10);

            interaction.ActiveShadow = GUILayout.Toggle(interaction.ActiveShadow, "激活【虚影】功能");

            if (interaction.ActiveShadow)
            {
                interaction.AddShadow();
                interaction.interactionShadow.IsSelf = EditorGUILayout.Toggle(new GUIContent("      本身:", "当进行交互时,交互是否执行本身,True为执行本身,对方不执行。反之同理!"), interaction.interactionShadow.IsSelf);

                interaction.interactionShadow.localPosition = EditorGUILayout.Vector3Field("      局部坐标:", interaction.interactionShadow.localPosition);
                interaction.interactionShadow.localRotation = EditorGUILayout.Vector3Field("      局部旋转值:", interaction.interactionShadow.localRotation);
                //interaction.interactionShadow.localScale = EditorGUILayout.Vector3Field("局部大小:", shadow.localScale);
            }
            else
            {
                interaction.RemoveShadow();
            }

            EditorGUILayout.EndVertical();
        }