Example #1
0
        public static DisplayObj GetDisplayObj(this GameObject go)
        {
            DisplayBehaviour vo = go.GetComponent <DisplayBehaviour>();

            if (vo != null)
            {
                return(vo.disObj);
            }
            return(null);
        }
Example #2
0
        public static object GetData(this GameObject go)
        {
            DisplayBehaviour vo = go.GetComponent <DisplayBehaviour>();

            if (vo != null)
            {
                return(vo.data);
            }
            return(null);
        }
Example #3
0
        /// <summary>
        /// Update this button to match the current event listening and display requirements.
        /// </summary>
        /// <remarks>
        /// This is called when some button state is changed or if the underlying virtual environment object changes
        /// and needs to be resynchronized.
        /// </remarks>
        protected void Update()
        {
            if (m_enabled)
            {
                EnableEvents();
            }
            else
            {
                DisableEvents();
            }

            DisplayBehaviour.UpdateAppearance();
            LabelBehaviour.UpdateAppearance();
        }
Example #4
0
        public static void SetDisplayObj(this GameObject go, ref DisplayObj disObj)
        {
            DisplayBehaviour vo = go.GetComponent <DisplayBehaviour>() ?? go.AddComponent <DisplayBehaviour>();

            vo.disObj = disObj;
        }
Example #5
0
        public static void SetData(this GameObject go, object data)
        {
            DisplayBehaviour vo = go.GetComponent <DisplayBehaviour>() ?? go.AddComponent <DisplayBehaviour>();

            vo.data = data;
        }