示例#1
0
        protected override void startGame()
        {
            hideRemotePlayers();
            loadAudioPrefab(partyGameDefinition);
            changeState(FindFourState.Intro);
            PartyGameUtils.AddParticipationFilter(localPlayerParticipationController);
            PartyGameUtils.AddActionConfirmationFilter(partyGameDefinition);
            PartyGameUtils.DisableMainNavigation();
            PartyGameUtils.DisableLocomotionControls();
            Vector3          position = default(Vector3);
            DataEntityHandle handle   = Service.Get <CPDataEntityCollection>().FindEntity <SessionIdData, long>(base.players[0].UserSessionId);

            if (dataEntityCollection.TryGetComponent <GameObjectReferenceData>(handle, out var component))
            {
                position = component.GameObject.transform.position;
            }
            CoroutineRunner.Start(createBoard(position), this, "CreateFindFourBoard");
            Content.LoadAsync(onHudPrefabLoaded, HUD_UI_PREFAB_KEY);
            dispatcher.AddListener <InputEvents.ActionEvent>(onActionEvent);
            changeControlState(ControlsState.Disabled);
            if (base.players[0].UserSessionId == localPlayerSessionId)
            {
                PartyGameUtils.LogGameStartBi(partyGameDefinition.name, base.players.Count);
                PartyGameUtils.StartBiTimer(partyGameDefinition.name, base.sessionId);
            }
            if (!disablerManager.IsUIElementDisabled("CellphoneButton"))
            {
                PartyGameUtils.DisableCellPhoneButton();
            }
            Service.Get <EventDispatcher>().DispatchEvent(new PartyGameEvents.PartyGameStarted(partyGameDefinition));
            dispatcher.DispatchEvent(new PlayerCardEvents.SetEnablePlayerCard(enable: false));
        }
示例#2
0
 public void EnableElementGroup()
 {
     for (int i = 0; i < groupElementsList.Count; i++)
     {
         if (groupElementsList[i] != null && !disablerManager.IsUIElementDisabled(groupElementsList[i].UIElementID))
         {
             groupElementsList[i].EnableElement();
         }
     }
     IsEnabled = true;
 }
    protected void handleLocomotionInput(LocomotionInputResult locomotionInputResult)
    {
        bool flag = disablerManager.IsUIElementDisabled("Joystick");

        eventDispatcher.DispatchEvent(new InputEvents.MoveEvent(flag ? Vector2.zero : locomotionInputResult.Direction));
        if (!flag && locomotionInputResult.Rotation.sqrMagnitude > 0f)
        {
            eventDispatcher.DispatchEvent(new InputEvents.RotateEvent(locomotionInputResult.Rotation));
        }
        if (!flag && locomotionInputResult.Direction.sqrMagnitude > 0f)
        {
            logLocomotionAction(locomotionInputResult.LogType);
        }
    }