public void Does_not_deactivate_behaviour_when_authority_is_not_lost() { ActivationManager.AddComponent(PositionComponentId); ActivationManager.ChangeAuthority(PositionComponentId, Authority.Authoritative); ActivationManager.EnableSpatialOSBehaviours(); ActivationManager.DisableSpatialOSBehaviours(); Assert.IsTrue(TestGameObject.GetComponent <TestBehaviourWithReader>().enabled, "Behaviour should not be disabled if authority is not lost"); }
public void Does_not_deactivate_behaviour_when_authority_is_not_lost() { ActivationManager.AddComponent(ComponentId); ActivationManager.ChangeAuthority(ComponentId, Authority.Authoritative); ActivationManager.EnableSpatialOSBehaviours(); ActivationManager.DisableSpatialOSBehaviours(); Assert.IsTrue(TestGameObject.GetComponent <TBehaviour>().enabled, "Behaviour should not be disabled if authority is not lost"); ValidateRequirablesNotNull(); }
public void Deactivates_behaviour_when_authority_is_lost() { ActivationManager.AddComponent(ComponentId); ActivationManager.ChangeAuthority(ComponentId, Authority.Authoritative); ActivationManager.EnableSpatialOSBehaviours(); ActivationManager.ChangeAuthority(ComponentId, Authority.NotAuthoritative); Assert.IsTrue(TestGameObject.GetComponent <TBehaviour>().enabled, "Behaviour should not be disabled before DisableSpatialOSBehaviours is called" + " even if authority is lost"); ValidateRequirablesNotNull(); ActivationManager.DisableSpatialOSBehaviours(); Assert.IsFalse(TestGameObject.GetComponent <TBehaviour>().enabled, "Behaviour should be disabled after DisableSpatialOSBehaviours is called"); }
public void Does_not_deactivate_behaviour_when_authority_is_lost() { ActivationManager.AddComponent(ComponentId); ActivationManager.ChangeAuthority(ComponentId, Authority.Authoritative); ActivationManager.EnableSpatialOSBehaviours(); ActivationManager.ChangeAuthority(ComponentId, Authority.NotAuthoritative); Assert.IsTrue(TestGameObject.GetComponent <TestBehaviourWithCommandSender>().enabled, "Behaviour should not be disabled after DisableSpatialOSBehaviours is called" + " even if authority is lost"); ActivationManager.DisableSpatialOSBehaviours(); Assert.IsTrue(TestGameObject.GetComponent <TestBehaviourWithCommandSender>().enabled, "Behaviour should not be disabled after DisableSpatialOSBehaviours is called" + " even if authority is lost"); AssertRequirablesNotNull(); }
public void Does_not_deactivate_reader_behaviour_when_authority_is_lost() { ActivationManager.AddComponent(PositionComponentId); ActivationManager.ChangeAuthority(PositionComponentId, Authority.Authoritative); ActivationManager.EnableSpatialOSBehaviours(); ActivationManager.ChangeAuthority(PositionComponentId, Authority.NotAuthoritative); Assert.IsTrue(TestGameObject.GetComponent <ReaderBehaviour>().enabled, "Reader Behaviour should not be disabled before DisableSpatialOSBehaviours is called" + " even if authority is lost"); Assert.IsTrue(TestGameObject.GetComponent <WriterBehaviour>().enabled, "Writer Behaviour should not be disabled before DisableSpatialOSBehaviours is called" + " even if authority is lost"); ActivationManager.DisableSpatialOSBehaviours(); Assert.IsTrue(TestGameObject.GetComponent <ReaderBehaviour>().enabled, "Reader Behaviour should not be disabled after DisableSpatialOSBehaviours is called" + " even if authority is lost"); Assert.IsFalse(TestGameObject.GetComponent <WriterBehaviour>().enabled, "Writer Behaviour should not be disabled after DisableSpatialOSBehaviours is called" + " after authority is lost"); }