public DataEntityHandle GetActiveHandle()
        {
            DataEntityHandle dataEntityHandle = dataEntityCollection.FindEntityByName("ActiveSceneData");

            if (dataEntityHandle.IsNull)
            {
                dataEntityHandle = dataEntityCollection.AddEntity("ActiveSceneData");
            }
            return(dataEntityHandle);
        }
        protected override void OnEnter()
        {
            DataEntityHandle handle = dataEntityCollection.FindEntityByName("ActiveSceneData");

            if (dataEntityCollection.TryGetComponent <SceneStateData>(handle, out var component))
            {
                previousState   = component.State;
                component.State = State;
            }
        }
 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 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);
        }
Beispiel #5
0
        private bool onEntityAdded(DataEntityEvents.EntityAddedEvent evt)
        {
            DataEntityHandle dataEntityHandle = dataEntityCollection.FindEntityByName("LocalPlayer");

            if (!dataEntityHandle.IsNull)
            {
                dataEntityCollection.EventDispatcher.RemoveListener <DataEntityEvents.EntityAddedEvent>(onEntityAdded);
                onLocalPlayerHandleAdded(dataEntityHandle);
            }
            return(false);
        }
    private string getIglooOwnerName()
    {
        string           result           = "";
        DataEntityHandle dataEntityHandle = dataEntityCollection.FindEntityByName("ActiveSceneData");

        if (!dataEntityHandle.IsNull && dataEntityCollection.TryGetComponent(dataEntityHandle, out SceneOwnerData component))
        {
            result = component.Name;
        }
        return(result);
    }
Beispiel #7
0
    public void LoadIgloo(ZoneId zoneId, Language language, SceneStateData.SceneState sceneState, string transitionScene = null, string onJoinNotificationTag = null)
    {
        ZoneDefinition zone = GetZone(zoneId.name);

        if (isSceneTransitionValid(zone.SceneName))
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();
            dictionary.Add(SceneTransitionService.SceneArgs.LoadingScreenOverride.ToString(), IglooSplashScreen.Key);
            sceneTransition(zone.SceneName, transitionScene, dictionary);
            connectToIgloo(zoneId, zone, language, onJoinNotificationTag);
        }
        DataEntityHandle dataEntityHandle = dataEntityCollection.FindEntityByName("ActiveSceneData");

        if (dataEntityHandle.IsNull)
        {
            dataEntityHandle = dataEntityCollection.AddEntity("ActiveSceneData");
        }
        if (!dataEntityCollection.TryGetComponent(dataEntityHandle, out SceneStateData component))
        {
            component = dataEntityCollection.AddComponent <SceneStateData>(dataEntityHandle);
        }
        component.State = sceneState;
    }
    public void Awake()
    {
        eventDispatcher       = Service.Get <EventDispatcher>();
        dataEntityCollection  = Service.Get <CPDataEntityCollection>();
        sceneDataEntityHandle = dataEntityCollection.FindEntityByName("ActiveSceneData");
        lightingController    = base.gameObject.AddComponent <LightingController>();
        IGameData gameData = Service.Get <IGameData>();

        lightingDefs   = gameData.Get <Dictionary <int, LightingDefinition> >();
        musicDefs      = gameData.Get <Dictionary <int, MusicTrackDefinition> >();
        decorationDefs = gameData.Get <Dictionary <int, DecorationDefinition> >();
        structureDefs  = gameData.Get <Dictionary <int, StructureDefinition> >();
        eventDispatcher.AddListener <SceneTransitionEvents.SceneSwapLoadStarted>(onSceneSwapLoadStarted);
    }
Beispiel #9
0
        public FindFour()
        {
            dataEntityCollection  = Service.Get <CPDataEntityCollection>();
            disablerManager       = Service.Get <UIElementDisablerManager>();
            dispatcher            = Service.Get <EventDispatcher>();
            jsonService           = Service.Get <JsonService>();
            localPlayerSessionId  = dataEntityCollection.LocalPlayerSessionId;
            localPlayerGameObject = SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject;
            localPlayerParticipationController = localPlayerGameObject.GetComponent <ParticipationController>();
            DataEntityHandle handle = dataEntityCollection.FindEntityByName("ControlsScreenData");

            controlsData = dataEntityCollection.GetComponent <ControlsScreenData>(handle);
            addListeners();
            getDefinitions();
        }
Beispiel #10
0
        private void createLocalPlayer(GameObject playerGameObject, DataEntityHandle playerdataHandle)
        {
            bool             flag             = true;
            DataEntityHandle dataEntityHandle = dataEntityCollection.FindEntityByName("ActiveSceneData");

            if (!dataEntityHandle.IsNull && dataEntityCollection.TryGetComponent <SceneStateData>(dataEntityHandle, out var component) && component.State != 0)
            {
                flag = false;
            }
            if (flag)
            {
                playerGameObject.AddComponent <LocomotionBroadcaster>();
            }
            setInitialPosition(playerGameObject, playerdataHandle);
            localPlayerCreated = true;
        }
        private void Awake()
        {
            dataEntityCollection       = Service.Get <CPDataEntityCollection>();
            eventDispatcher            = Service.Get <EventDispatcher>();
            decorationInventoryService = Service.Get <DecorationInventoryService>();
            sceneHandle = dataEntityCollection.FindEntityByName("ActiveSceneData");
            awakeEvents = new EventChannel(eventDispatcher);
            awakeEvents.AddListener <SceneTransitionEvents.LayoutGameObjectsLoaded>(onLayoutGameObjectsLoaded);
            sceneModifiers = new ISceneModifier[1]
            {
                new EditModeModifier(this)
            };
            IGameData gameData = Service.Get <IGameData>();

            decorationDefinitions = gameData.Get <Dictionary <int, DecorationDefinition> >();
            structureDefinitions  = gameData.Get <Dictionary <int, StructureDefinition> >();
            SceneRefs.Set(this);
        }