Пример #1
0
 private void ShowChosenOption(CombatOptionButton.CombatOptions chosenOption)
 {
     // Setting the appropriate image
     foreach (var combatOptionData in _CombatOptionsData)
     {
         if (combatOptionData.CombatOption == chosenOption)
         {
             _Image.sprite = combatOptionData.Image;
             _OnShowCombatOptionEvent.Invoke();
             return;
         }
     }
 }
Пример #2
0
    private void OnShowCombatResults(object data)
    {
        int[] combatData   = (int[])data;
        int   playerViewID = combatData[0];

        CombatOptionButton.CombatOptions chosenOption = (CombatOptionButton.CombatOptions)combatData[1];

        // Show the option chosen by the net player
        NetPlayerController player = PhotonView.Find(playerViewID).GetComponent <NetPlayerController>();

        if (player == null)
        {
            return;
        }

        // Update the UI with the chosen option
        ShowChosenOption(chosenOption);
    }
Пример #3
0
    private void OnShowLocalCombatOption(object data)
    {
        Debug.Log("Showing local combat option");
        int[] combatData   = (int[])data;
        int   playerViewID = combatData[0];

        CombatOptionButton.CombatOptions chosenOption = (CombatOptionButton.CombatOptions)combatData[1];

        // Show the option chosen by the local player
        LocalPlayerController player = PhotonView.Find(playerViewID).GetComponent <LocalPlayerController>();

        if (player == null)
        {
            return;
        }

        // Update the UI with the chosen option
        ShowChosenOption(chosenOption);
    }