Esempio n. 1
0
        public static void SetInteractInWorldIconType(InteractInWorldIconType type)
        {
            tweakableType = type;
            InteractInWorldIconController interactInWorldIconController = Object.FindObjectOfType <InteractInWorldIconController>();

            if (interactInWorldIconController != null)
            {
                interactInWorldIconController.setState(type);
            }
        }
        private void Start()
        {
            interactInWorldIconController = GetComponent <InteractInWorldIconController>();
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            DataEntityHandle       entityByType           = cPDataEntityCollection.GetEntityByType <ControlsScreenData>();

            controlsScreenData = cPDataEntityCollection.GetComponent <ControlsScreenData>(entityByType);
            interactInWorldIconController.SetEnabled(controlsScreenData.IsControlsScreenActive);
            controlsScreenData.OnControlsScreenActiveChanged += onControlsScreenActiveChanged;
            eventChannel = new EventChannel(Service.Get <EventDispatcher>());
            eventChannel.AddListener <ActionSequencerEvents.ActionSequenceStarted>(onActionSequenceStarted);
            eventChannel.AddListener <ActionSequencerEvents.ActionSequenceCompleted>(onActionSequenceCompleted);
            eventChannel.AddListener <TubeRaceEvents.LocalPlayerJoinedLobby>(onRaceLobbyEntered);
            eventChannel.AddListener <TubeRaceEvents.LocalPlayerLeftLobby>(onRaceLobbyLeft);
            eventChannel.AddListener <RaceGameEvents.Start>(onRaceGameStart);
            eventChannel.AddListener <RaceGameEvents.RaceFinished>(onRaceFinished);
        }