Exemplo n.º 1
0
 public override void OnEnter()
 {
     sceneLayoutListener = dataEntityCollection.When <SceneLayoutData>(stateController.DataManager.LayoutManager.GetActiveHandle(), onSceneLayoutData);
     eventChannel.AddListener <IglooUIEvents.SetStateButtonPressed>(onSceneStateButton);
     SuspendActiveQuest();
     inventoryService.onInventoryLoaded += onDecorationsLoaded;
 }
    private IEnumerator Start()
    {
        yield return(null);

        CPDataEntityCollection dataEntityCollection = Service.Get <CPDataEntityCollection>();

        sceneStateDataListener = dataEntityCollection.When <SceneStateData>("ActiveSceneData", onSceneDataAdded);
    }
 private void Awake()
 {
     layoutManager       = Service.Get <SceneLayoutDataManager>();
     syncService         = Service.Get <SceneLayoutSyncService>();
     iglooService        = Service.Get <INetworkServicesManager>().IglooService;
     eventChannel        = new EventChannel(Service.Get <EventDispatcher>());
     savedIgloosListener = Service.Get <CPDataEntityCollection>().When <SavedIgloosMetaData>(Service.Get <CPDataEntityCollection>().LocalPlayerHandle, onSavedIgloosMetaData);
 }
 protected virtual void Awake()
 {
     eventDispatcher         = Service.Get <EventDispatcher>();
     dataEntityCollection    = Service.Get <CPDataEntityCollection>();
     sceneDataHandle         = dataEntityCollection.FindEntityByName("ActiveSceneData");
     sceneStateDataListener  = dataEntityCollection.When <SceneStateData>("ActiveSceneData", onSceneDataAdded);
     sceneLayoutDataListener = dataEntityCollection.Whenever <SceneLayoutData>("ActiveSceneData", onSceneLayoutDataAdded, onSceneLayoutDataRemoved);
 }
    private void Start()
    {
        isSetup = false;
        skipUnloadUnusedResources = false;
        CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

        sceneStateDataListener = cPDataEntityCollection.When <SceneStateData>("ActiveSceneData", onSceneDataAdded);
    }
    private void Awake()
    {
        musicDefs = Service.Get <IGameData>().Get <Dictionary <int, MusicTrackDefinition> >();
        setupEventListeners();
        CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

        sceneLayoutListener = cPDataEntityCollection.Whenever <SceneLayoutData>("ActiveSceneData", onLayoutAdded, onLayoutRemoved);
    }
Exemplo n.º 7
0
 private void Start()
 {
     profileListener     = dataEntityCollection.When <ProfileData>(dataEntityCollection.LocalPlayerHandle, onProfileData);
     membershipListener  = dataEntityCollection.When <MembershipData>(dataEntityCollection.LocalPlayerHandle, onMembershipData);
     sceneStateListener  = dataEntityCollection.When <SceneStateData>(Service.Get <SceneLayoutDataManager>().GetActiveHandle(), onSceneStateData);
     savedIgloosListener = dataEntityCollection.When <SavedIgloosMetaData>(dataEntityCollection.LocalPlayerHandle, onSavedIgloosMetaData);
     Service.Get <MembershipService>().OnPurchaseSuccess += onMembershipPurchased;
     eventDispatcher.DispatchEvent(new UIDisablerEvents.DisableUIElement("Joystick"));
 }
Exemplo n.º 8
0
 private bool onZoneTransition(ZoneTransitionEvents.ZoneTransition evt)
 {
     if (evt.State == ZoneTransitionEvents.ZoneTransition.States.Begin && stateListener != null)
     {
         stateListener.StopListening();
         stateListener = null;
     }
     return(false);
 }
 protected virtual void Awake()
 {
     dataEntityCollection = Service.Get <CPDataEntityCollection>();
     layoutManager        = Service.Get <SceneLayoutDataManager>();
     eventDispatcher      = Service.Get <EventDispatcher>();
     contextListener      = GetComponent <StateMachineContextListener>();
     stateDataListener    = dataEntityCollection.When <SceneStateData>(layoutManager.GetActiveHandle(), onSceneStateData);
     eventChannel         = new EventChannel(eventDispatcher);
 }
Exemplo n.º 10
0
    private void Start()
    {
        musicDefinitions = Service.Get <IGameData>().Get <Dictionary <int, MusicTrackDefinition> >();
        musicGenres      = Service.Get <IGameData>().Get <Dictionary <int, MusicGenreDefinition> >();
        setupListeners();
        CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

        sceneLayoutListener = cPDataEntityCollection.When <SceneLayoutData>("ActiveSceneData", onLayoutAdded);
    }
Exemplo n.º 11
0
 private void loadProfileData(DataEntityHandle handle)
 {
     isInOwnIgloo  = IglooButtonUtils.SetButtonState(handle, LocalIglooButton);
     isLocalPlayer = handle == dataEntityCollection.LocalPlayerHandle;
     if (isLocalPlayer)
     {
         savedIglooListener = dataEntityCollection.When <SavedIgloosMetaData>(handle, onSavedIgloosAdded);
     }
     profileDataListener = dataEntityCollection.When <ProfileData>(handle, onProfileDataAdded);
 }
Exemplo n.º 12
0
    public void Start()
    {
        Assert.IsNotNull(depthMapCreator);
        CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

        dataEventListener = cPDataEntityCollection.When <SceneStateData>("ActiveSceneData", onSceneStateDataAdded);
        eventChannel      = new EventChannel(Service.Get <EventDispatcher>());
        eventChannel.AddListener <SceneTransitionEvents.LayoutGameObjectsLoaded>(onLayoutGameObjectsLoaded);
        eventChannel.AddListener <IglooLightingEvents.RenderIglooDynamicLightmap>(onRenderIglooDynamicLightmap);
    }
        private void Awake()
        {
            initStandardButtons();
            dictionaryOfDecorationDefinitions = Service.Get <IGameData>().Get <Dictionary <int, DecorationDefinition> >();
            decorationInventoryService        = Service.Get <DecorationInventoryService>();
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle       handle = cPDataEntityCollection.FindEntityByName("ActiveSceneData");

            sceneLayoutListener = cPDataEntityCollection.Whenever <SceneLayoutData>(handle, onLayoutAdded, onLayoutRemoved);
        }
Exemplo n.º 14
0
        private void Start()
        {
            dataEntityCollection = Service.Get <CPDataEntityCollection>();
            dataEntityCollection.EventDispatcher.AddListener <DataEntityEvents.ComponentAddedEvent <ProfileData> >(onProfileDataAdded);
            dataEntityCollection.EventDispatcher.AddListener <DataEntityEvents.ComponentAddedEvent <MembershipData> >(onMembershipDataAdded);
            friendAvatarRenderer = GetComponent <AvatarImageComponent>();
            AvatarImageComponent avatarImageComponent = friendAvatarRenderer;

            avatarImageComponent.OnImageReady = (Action <DataEntityHandle, Texture2D>)Delegate.Combine(avatarImageComponent.OnImageReady, new Action <DataEntityHandle, Texture2D>(onImageReady));
            ownerDataLoader = dataEntityCollection.When <SceneOwnerData>("ActiveSceneData", showOwner);
        }
 private void Awake()
 {
     Assert.IsNotNull(EditCameraTarget, "EditCameraTarget required.");
     eventDispatcher = Service.Get <EventDispatcher>();
     eventDispatcher.AddListener <InputEvents.ZoomEvent>(onInputZoom);
     boundsForCameraTarget         = BoundsForCameraTarget.bounds;
     BoundsForCameraTarget.enabled = false;
     dataEntityCollection          = Service.Get <CPDataEntityCollection>();
     iglooCameraLotStateListener   = dataEntityCollection.Whenever <IglooCameraOverrideStateData>("ActiveSceneData", onOverrideStateDataAdded, onOverrideStateDataRemoved);
     sceneStateDataListener        = dataEntityCollection.When <SceneStateData>("ActiveSceneData", onSceneDataAdded);
     wasCameraTargetReset          = false;
 }
Exemplo n.º 16
0
 protected override void Awake()
 {
     CreateStateController.Init(this);
     EditStateController.Init(this);
     PreviewStateController.Init(this);
     PlayStateController.Init(this);
     uiEventQueue         = new Queue <ExternalEvent>();
     dataEntityCollection = Service.Get <CPDataEntityCollection>();
     savedIglooListener   = dataEntityCollection.When <SavedIgloosMetaData>(dataEntityCollection.LocalPlayerHandle, onSavedIgloosAdded);
     base.Awake();
     ContextListener.OnContextAdded += onContextAdded;
     eventChannel.AddListener <IglooUIEvents.OpenManageIglooPopup>(onOpenManageIglooPopup);
     ClubPenguin.Core.SceneRefs.Set(this);
 }
Exemplo n.º 17
0
 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);
 }
Exemplo n.º 18
0
    protected void Start()
    {
        CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();

        dataEventListener = cPDataEntityCollection.When <MembershipData>(cPDataEntityCollection.LocalPlayerHandle, onMembershipDataAdded);
    }
Exemplo n.º 19
0
 public virtual void SetPlayer(DataEntityHandle handle)
 {
     this.handle          = handle;
     dataEntityCollection = Service.Get <CPDataEntityCollection>();
     profileDataListener  = dataEntityCollection.When <ProfileData>(handle, onProfileDataAdded);
 }
Exemplo n.º 20
0
 public void Awake()
 {
     dataEntityCollection = Service.Get <CPDataEntityCollection>();
     sceneStateListener   = dataEntityCollection.When <SceneStateData>("ActiveSceneData", onSceneStateData);
 }
 private void Awake()
 {
     dataEntityCollection = Service.Get <CPDataEntityCollection>();
     savedIglooListener   = dataEntityCollection.When <SavedIgloosMetaData>(dataEntityCollection.LocalPlayerHandle, onSavedIgloosAdded);
 }
Exemplo n.º 22
0
 protected virtual void Awake()
 {
     eventDispatcher   = Service.Get <EventDispatcher>();
     eventChannel      = new EventChannel(eventDispatcher);
     stateDataListener = dataEntityCollection.When <SceneStateData>(Service.Get <SceneLayoutDataManager>().GetActiveHandle(), onSceneStateData);
 }
 private void Start()
 {
     prefabCacheTracker  = SceneRefs.Get <PrefabCacheTracker>();
     sceneLayoutListener = dataEntityCollection.Whenever <SceneLayoutData>(sceneDataEntityHandle, onLayoutAdded, onLayoutRemoved);
 }