Exemplo n.º 1
0
        public void Hide()
        {
            if (text == null)
            {
                return;
            }

            subscription.Unsubscribe();
            application.UI.Root.RemoveChild(text, 0);

            text         = null;
            subscription = null;
        }
Exemplo n.º 2
0
        public override void OnSceneSet(Scene scene)
        {
            if (scene != null)
            {
                if (ReceiveFixedUpdates)
                {
                    var physicsWorld = scene.GetComponent <PhysicsWorld>();
                    if (physicsWorld == null)
                    {
                        throw new InvalidOperationException("Scene must have PhysicsWorld component in order to receive FixedUpdates");
                    }
                    physicsPreStepSubscription = physicsWorld.SubscribeToPhysicsPreStep(OnFixedUpdate);
                }

                if (ReceiveFixedPostUpdates)
                {
                    var physicsWorld = scene.GetComponent <PhysicsWorld>();
                    if (physicsWorld == null)
                    {
                        throw new InvalidOperationException("Scene must have PhysicsWorld component in order to receive FixedUpdates");
                    }
                    physicsPostStepSubscription = physicsWorld.SubscribeToPhysicsPostStep(OnFixedPostUpdate);
                }

                if (ReceivePostUpdates)
                {
                    scenePostUpdateSubscription = scene.SubscribeToScenePostUpdate(OnPostUpdate);
                }
            }
            else
            {
                physicsPreStepSubscription?.Unsubscribe();
                physicsPostStepSubscription?.Unsubscribe();
                scenePostUpdateSubscription?.Unsubscribe();
            }
        }
Exemplo n.º 3
0
 void UnsubscribeFromAppEvents()
 {
     updateSubscription?.Unsubscribe();
 }