예제 #1
0
        /// <summary>
        ///     Unsubscribe from the specified eventHelper.
        /// </summary>
        /// <param name="eventHelper">Event helper.</param>
        private void Unsubscribe(HydraMonoBehaviour eventHelper)
        {
            if (eventHelper == null)
            {
                return;
            }

            eventHelper.onWillRenderObjectCallback -= OnChildWillRenderObject;
        }
예제 #2
0
        /// <summary>
        ///     Called when the parent is enabled.
        /// </summary>
        protected override void OnEnable(HydraMonoBehaviour parent)
        {
            if (m_Points == null)
            {
                m_Points = new BezierPointAttribute[0];
            }

            base.OnEnable(parent);
        }
예제 #3
0
        /// <summary>
        ///     Called when the object goes out of scope.
        /// </summary>
        protected override void OnDisable(HydraMonoBehaviour parent)
        {
            Unsubscribe(m_EventHelper);

            base.OnDisable(parent);
        }
        /// <summary>
        ///     Called when the object is about to be destroyed.
        /// </summary>
        protected override void OnDestroy(HydraMonoBehaviour parent)
        {
            base.OnDestroy(parent);

            DestroyChild();
        }
        /// <summary>
        ///     Called when the object is loaded.
        /// </summary>
        protected override void OnEnable(HydraMonoBehaviour parent)
        {
            base.OnEnable(parent);

            InstantiateChild();
        }
        /// <summary>
        ///     Called when the parent updates.
        /// </summary>
        /// <param name="parent">Parent.</param>
        protected override void OnUpdate(HydraMonoBehaviour parent)
        {
            base.OnUpdate(parent);

            SetLayer(parent.gameObject.layer);
        }