Наследование: tk2dUIBaseItemControl
Пример #1
0
 // Use this for initialization
 void OnEnable()
 {
     if (m_uiUpDownButton == null)
     {
         m_uiUpDownButton = GetComponent <tk2dUIUpDownButton> ();
     }
     if (m_uiUpDownButton != null)
     {
         if (m_uiUpDownButton.upStateGO != null)
         {
             m_uiUpDownButton.upStateGO.SetActive(true);
         }
         if (m_uiUpDownButton.downStateGO != null)
         {
             m_uiUpDownButton.downStateGO.SetActive(false);
         }
     }
 }
    public override void OnInspectorGUI()

    {
        base.OnInspectorGUI();



        tk2dUIUpDownButton upDownButton = (tk2dUIUpDownButton)target;



        upDownButton.upStateGO = tk2dUICustomEditorGUILayout.SceneObjectField("Up State GameObject", upDownButton.upStateGO, target);

        upDownButton.downStateGO = tk2dUICustomEditorGUILayout.SceneObjectField("Down State GameObject", upDownButton.downStateGO, target);



        tk2dGuiUtility.LookLikeControls(200);



        bool newUseOnReleaseInsteadOfOnUp = EditorGUILayout.Toggle("Use OnRelease Instead of OnUp", upDownButton.UseOnReleaseInsteadOfOnUp);

        if (newUseOnReleaseInsteadOfOnUp != upDownButton.UseOnReleaseInsteadOfOnUp)

        {
            upDownButton.InternalSetUseOnReleaseInsteadOfOnUp(newUseOnReleaseInsteadOfOnUp);

            GUI.changed = true;
        }



        if (GUI.changed)

        {
            tk2dUtil.SetDirty(upDownButton);
        }
    }