Exemplo n.º 1
0
    /// <summary>
    /// 
    /// </summary>
    public override void OnInspectorGUI()
    {
        Undo.RecordObject(target, "HUD Anchor Snapshot");

        GUI.color = Color.white;

        GUILayout.Space(10);

        m_Component.Side = (vp_UIAnchor.vp_UIAnchorSide)EditorGUILayout.EnumPopup("Side", m_Component.Side);
        if(m_Component.Side != m_OldSide)
        {
            m_Component.RefreshUI();
            m_OldSide = m_Component.Side;
        }

        GUILayout.Space(10);

        // update
        if (GUI.changed)
        {

            EditorUtility.SetDirty(target);

        }
    }
Exemplo n.º 2
0
    /// <summary>
    ///
    /// </summary>
    public override void OnInspectorGUI()
    {
        Undo.SetSnapshotTarget(target, "HUD Anchor Snapshot");
        Undo.CreateSnapshot();

        GUI.color = Color.white;

        GUILayout.Space(10);

        m_Component.Side = (vp_UIAnchor.vp_UIAnchorSide)EditorGUILayout.EnumPopup("Side", m_Component.Side);
        if (m_Component.Side != m_OldSide)
        {
            m_Component.RefreshUI();
            m_OldSide = m_Component.Side;
        }

        GUILayout.Space(10);

        // update
        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
            Undo.RegisterSnapshot();
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// hooks up the component object as the inspector target
    /// </summary>
    public virtual void OnEnable()
    {
        m_Component = (vp_UIAnchor)target;

        if(m_Component.Manager == null)
            m_Component.Manager = m_Component.transform.root.GetComponent<vp_UIManager>();

        m_Component.Manager.ForceUIRefresh();

        m_OldSide = m_Component.Side;
    }
Exemplo n.º 4
0
    /// <summary>
    /// hooks up the component object as the inspector target
    /// </summary>
    public virtual void OnEnable()
    {
        m_Component = (vp_UIAnchor)target;

        if (m_Component.Manager == null)
        {
            m_Component.Manager = m_Component.transform.root.GetComponent <vp_UIManager>();
        }

        m_Component.Manager.ForceUIRefresh();

        m_OldSide = m_Component.Side;
    }