Example #1
0
    void OnEnable()
    {
        inspectorValue inspectorValueIten = target as inspectorValue;

        ATKProp        = inspectorValueIten.ATK;
        LuckyPointProp = inspectorValueIten.LuckyPoint;
    }
Example #2
0
    public override void OnInspectorGUI()
    {
        item = target as inspectorValue;
        int width = EditorGUILayout.IntField("Width", item.width);           //编辑器对应的值重设为mono中类对象操作的值

        if (item.width != width)
        {
            item.width = width;
        }

        ATKProp = EditorGUILayout.IntSlider("ATK", ATKProp, 0, 100);
        ProgressBar((ATKProp / 100.0f), "ATK");

        LuckyPointProp = EditorGUILayout.IntSlider("Lucky Point", LuckyPointProp, 0, 5);
        ProgressBar((LuckyPointProp / 5.0f), "Lucky Point");


        base.DrawDefaultInspector();
    }