示例#1
0
 private void Update()
 {
     if (setup)
     {
         int           roundNumber = gameMode.RoundNumber;
         PlayerManager manager     = gameMode.GetPlayerManager(playerNumber);
         if (instantiatedPrefabs.Length != gameMode.GetPlayerManager(playerNumber).GetMaxEquipment(roundNumber))
         {
             ReloadDisplay();
         }
         for (int i = 0; i < instantiatedPrefabs.Length; i++)
         {
             int colorIndex = 0;
             if (i >= manager.GetProjectedEquipmentRemaining(0, gameMode.GameState.StepNumber))
             {
                 colorIndex++;
             }
             if (i >= manager.GetAvailableEquipment(roundNumber))
             {
                 colorIndex++;
             }
             spriteRenderers[i].color = colorSelections[i].colors[colorIndex];
         }
     }
 }
示例#2
0
    public void Update()
    {
        int roundNumber             = attachedGameMode.RoundNumber;
        int step                    = attachedGameMode.GameState.StepNumber;
        int maxShots                = attachedGameMode.GetPlayerManager(playerNumber).GetMaxProjectiles(roundNumber);
        int shotsRemaining          = attachedGameMode.GetPlayerManager(playerNumber).GetAvailableProjectiles(roundNumber);
        int projectedShotsRemaining = attachedGameMode.GetPlayerManager(playerNumber).GetProjectedProjectilesRemaining(step);

        float shotsScalar     = shotsRemaining / (float)maxShots;
        float projectedScalar = projectedShotsRemaining / (float)maxShots;

        imageActualShots.transform.localScale    = new Vector3(shotsScalar, 1, 1);
        imageProjectedShots.transform.localScale = new Vector3(projectedScalar, 1, 1);

        textAmmo.text = shotsRemaining + "/" + maxShots;
    }