Beispiel #1
0
 private void checkTutorial()
 {
     if (savedIgloosMetaData.IsFirstIglooLoad())
     {
         TutorialManager tutorialManager = Service.Get <TutorialManager>();
         if (!tutorialManager.IsTutorialRunning() && tutorialManager.IsTutorialAvailable(IglooButtonUtils.IGLOO_TUTORIAL_ID) && !tutorialManager.TryStartTutorial(IglooButtonUtils.IGLOO_TUTORIAL_ID, "BaseIgloo"))
         {
             Log.LogErrorFormatted(this, "An error occurred trying to start the igloo tutorial.");
         }
     }
 }
 private bool onIglooJoined(WorldServiceEvents.SelfRoomJoinedEvent evt)
 {
     if (!string.IsNullOrEmpty(evt.Room.zoneId.instanceId))
     {
         DataEntityHandle activeHandle = layoutManager.GetActiveHandle();
         if (!dataEntityCollection.TryGetComponent <SceneOwnerData>(activeHandle, out var component))
         {
             component = dataEntityCollection.AddComponent <SceneOwnerData>(activeHandle);
         }
         component.Name    = evt.RoomOwnerName;
         component.IsOwner = evt.IsRoomOwner;
         if (layoutManager.IsInOwnIgloo())
         {
             SavedIgloosMetaData savedIgloosMetaData = getSavedIgloosMetaData();
             if (savedIgloosMetaData.ActiveIglooId.HasValue)
             {
                 updateSavedIglooMetaData(savedIgloosMetaData.ActiveIglooId.Value, evt.ExtraLayoutData);
             }
             if (savedIgloosMetaData.IsFirstIglooLoad())
             {
                 layoutManager.AddNewActiveLayout();
                 savedIgloosMetaData.IglooVisibility = IglooVisibility.PUBLIC;
                 LocomotionActionEvent locomotionActionEvent = default(LocomotionActionEvent);
                 locomotionActionEvent.Type      = LocomotionAction.Move;
                 locomotionActionEvent.Position  = Vector3.zero;
                 locomotionActionEvent.Direction = Vector3.zero;
                 LocomotionActionEvent action = locomotionActionEvent;
                 networkServicesManager.PlayerActionService.LocomotionAction(action);
             }
             else
             {
                 layoutManager.CacheLayoutFromSceneLayout(savedIgloosMetaData.ActiveIglooId.Value, evt.ExtraLayoutData);
             }
         }
         else
         {
             layoutManager.CacheLayoutFromSceneLayout(0L, evt.ExtraLayoutData);
         }
         DataEntityHandle activeHandle2 = layoutManager.GetActiveHandle();
         stateListener = dataEntityCollection.Whenever <SceneStateData>(activeHandle2, onStateAdded, onStateRemoved);
     }
     return(false);
 }
Beispiel #3
0
 private void onSavedIgloosAdded(SavedIgloosMetaData savedIgloosMetaData)
 {
     this.savedIgloosMetaData = savedIgloosMetaData;
     this.savedIgloosMetaData.SavedIgloosUpdated += onSavedIgloosUpdated;
     isFirstIglooLoad = savedIgloosMetaData.IsFirstIglooLoad();
 }