Beispiel #1
0
        public static void UpdateTeamWidget(Process process, ulong playerDamageCollectionAddress, ulong playerNameCollectionAddress)
        {
            List <Player> updatedPlayers = new List <Player>();

            for (int playerIndex = 0; playerIndex < DataOffsets.PlayerDamageCollection.MaxPlayerCount; ++playerIndex)
            {
                var player = UpdateAndGetTeamPlayer(process, playerIndex, playerDamageCollectionAddress, playerNameCollectionAddress);
                if (player != null)
                {
                    updatedPlayers.Add(player);
                }
            }

            if (updatedPlayers.Any())
            {
                OverlayViewModel.Instance.TeamWidget.Context.UpdateFractions();

                OnMissionStart?.Invoke(updatedPlayers); // Firing MissionStart Event
            }
            else if (OverlayViewModel.Instance.TeamWidget.Context.Players.Any())
            {
                OverlayViewModel.Instance.TeamWidget.Context.Players.Clear();

                OnMissionEnd?.Invoke(); // Firing MissionEnd Event
            }
        }
Beispiel #2
0
    public void StartMission()
    {
        int currentEnergy = DataAPIController.instance.GetCurrentEnergy();

        if (currentEnergy >= 5 && !isDownPanelOpen)
        {
            OnMissionStart?.Invoke();
            StartCoroutine(StartWave());
            DataAPIController.instance.SubstractEnergy(5);
            ConfigPlayerCoinValueRecord coinValueCf = ConfigurationManager.instance.playerCoinValue.GetRecordByKeySearch(DataAPIController.instance.GetCurrentGoldValueLevel());
            goldValue      = coinValueCf.Value;
            isStartMission = true;
            ViewManager.instance.OnSwitchView(ViewIndex.IngameView);
            InputManager.instance.OnControlDownWithOutParam -= StartMission;
        }
        else
        {
            //
        }
    }