コード例 #1
0
    public override void OnInspectorGUI()
    {
        UIView uiview = target as UIView;

        EditorTools.DrawEntityMark();

        EditorTools.DrawUpdateKeyTextField(uiview);

        UIView.ShowType viewType = (UIView.ShowType)EditorGUILayout.EnumPopup("视图类型", uiview.viewType);

        float releaseDelay = 0;
        int   orderIndex   = 2;

        if (uiview.viewType != UIView.ShowType.CONTENT)
        {
            orderIndex   = ViewOrderToIndex(uiview.viewOrder);
            orderIndex   = EditorGUILayout.Popup("渲染层级", orderIndex, hierarchyOptions);
            releaseDelay = EditorGUILayout.FloatField("延迟释放", uiview.releaseDelay);
        }

        if (Application.isPlaying && uiview.viewType != UIView.ShowType.CONTENT)
        {
            GUI.color = Color.yellow;
            EditorGUILayout.LabelField("渲染序号", (uiview.sortingOrder).ToString());
            GUI.color = Color.white;
        }

        if (GUI.changed)
        {
            EditorTools.RegisterUndo("UIView", uiview);
            uiview.viewType     = viewType;
            uiview.viewOrder    = IndexToViewOrder(orderIndex);
            uiview.releaseDelay = releaseDelay;
            EditorTools.SetDirty(uiview);
        }

        if (EditorTools.DrawHeader("逻辑绑定", false, false))
        {
            this.serializedObject.Update();
            //开始检查是否有修改
            EditorGUI.BeginChangeCheck();

            EditorGUILayout.PropertyField(this.m_EventOnShow, new GUILayoutOption[0]);
            EditorGUILayout.PropertyField(this.m_EventOnClose, new GUILayoutOption[0]);

            if (EditorGUI.EndChangeCheck())
            {
                this.serializedObject.ApplyModifiedProperties();
            }

            GUILayout.Space(10);
        }



        UIUpdateGroupEditor.DrawUpdateTree(uiview);
    }
コード例 #2
0
    public override void OnInspectorGUI()
    {
        FXController fx = target as FXController;

        EditorTools.DrawEntityMark();

        base.OnInspectorGUI();

        //GUI.backgroundColor = Color.yellow;
        //if (!CheckParticlePlayerExist(fx) && GUILayout.Button("添加粒子组件", GUILayout.Height(30)))
        //{

        //    EParticlePlayer particlePlayer = fx.gameObject.GetComponent<EParticlePlayer>();
        //    if(particlePlayer == null)
        //        particlePlayer=fx.gameObject.AddComponent<EParticlePlayer>();
        //    fx.effects.Add(particlePlayer);
        //    particlePlayer.particles.Clear();
        //    foreach (var v in fx.GetComponentsInChildren<ParticleSystem>(true))
        //    {
        //        if (v.emission.enabled)
        //            particlePlayer.particles.Add(v);
        //    }
        //}
        //GUI.backgroundColor = Color.white;

        if (!Application.isPlaying)
        {
            simProgress = EditorGUILayout.IntSlider("Sample Preview", simProgress, 0, 100);
            if (GUI.changed)
            {
                fx.GetComponentsInChildren <ParticleSystem>(false, tempList);
                foreach (var item in tempList)
                {
                    item.Simulate(simProgress / 100.0f);
                }
            }
        }

        if (GUILayout.Button("ScaleMode: Hierarchy"))
        {
            fx.GetComponentsInChildren <ParticleSystem>(false, tempList);
            foreach (var item in tempList)
            {
                item.scalingMode = ParticleSystemScalingMode.Hierarchy;
            }
        }

        GUILayout.Space(10);

        if (FXDrawBase.DrawFXEffects(fx, fx.effects))
        {
            EditorTools.SetDirty(fx);
        }
    }
コード例 #3
0
    public override void OnInspectorGUI()
    {
        UIItem uiitem = target as UIItem;

        EditorTools.DrawEntityMark();

        EditorTools.DrawUpdateKeyTextField(uiitem);

        UIItem updateGroup = target as UIItem;

        EditorTools.DrawGreyPreView(updateGroup);

        DrawUpdateTree(uiitem);
    }