Exemple #1
0
    private void OnEnable()
    {
        // Find variables
        m_TextScript         = serializedObject.FindProperty("DisplayText");
        m_EdgeSize           = serializedObject.FindProperty("EdgePixelSize");
        m_BufferSize         = serializedObject.FindProperty("TitleBufferSize");
        m_TextStr            = serializedObject.FindProperty("DisplayStr");
        m_ButtonScript       = serializedObject.FindProperty("DisplayButton");
        m_ButtonActive       = serializedObject.FindProperty("DisplayButtonActive");
        m_ButtonInteractable = serializedObject.FindProperty("DisplayButtonInteractable");
        m_Center             = serializedObject.FindProperty("Center");
        m_CenterAt           = serializedObject.FindProperty("CenterAt");

        // Get Target entity
        myTD = (TextDisplay)target;
        // Get children
        Children = myTD.GetComponentsInChildren <RectTransform>();
        foreach (RectTransform RT in Children)
        {
            if (RT.name == "Edge")
            {
                EdgeChild = RT;
            }
            else if (RT.name == "Background")
            {
                BackgroundChild = RT;
            }
            else if (RT.name == "Text")
            {
                TextChild = RT;
            }
            else if (RT.name == "Button")
            {
                ButtonChild = RT;
            }
        }
    }