Advertisement
Guest User

henk2

a guest
Mar 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.19 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class ShowPanels : MonoBehaviour
  5. {
  6.  
  7.     public GameObject optionsPanel;                         //Store a reference to the Game Object OptionsPanel
  8.     public GameObject optionsTint;                          //Store a reference to the Game Object OptionsTint
  9.     public GameObject menuPanel;                            //Store a reference to the Game Object MenuPanel
  10.     public GameObject pausePanel;                           //Store a reference to the Game Object PausePanel
  11.     public GameObject BuyCardsPanel;                        //Store a reference to the Game Object BuyCardsPanel
  12.     public GameObject CardCollectionPanel;                  //Store a reference to the Game Object CardCollectionPanel
  13.     public GameObject PackPanel;                            //Store a reference to the Game Object PackPanel
  14.    
  15.     public void ShowOptionsPanel()
  16.     {
  17.         optionsPanel.SetActive(true);
  18.         optionsTint.SetActive(true);
  19.     }
  20.  
  21.     //Call this function to deactivate and hide the Options panel during the main menu
  22.     public void HideOptionsPanel()
  23.     {
  24.         optionsPanel.SetActive(false);
  25.         optionsTint.SetActive(false);
  26.     }
  27.  
  28.     //Call this function to activate and display the main menu panel during the main menu
  29.     public void ShowBuyCardsPanel()
  30.     {
  31.         BuyCardsPanel.SetActive(true);
  32.     }
  33.  
  34.     //Call this function to deactivate and hide the main menu panel during the main menu
  35.     public void HideBuyCardsPanel()
  36.     {
  37.         BuyCardsPanel.SetActive(false);
  38.     }
  39.  
  40.     public void ShowCardCollectionPanel()
  41.     {
  42.         CardCollectionPanel.SetActive(true);
  43.     }
  44.  
  45.    
  46.     public void HideCardCollectionPanel()
  47.     {
  48.         CardCollectionPanel.SetActive(false);
  49.     }
  50.  
  51.     public void ShowPackPanel(int PackType)
  52.     {
  53.  
  54.         switch ((CardType)PackType)
  55.         {
  56.             case CardType.Normal:
  57.                 if(BuyCards.Money >=500)
  58.                 {
  59.                     PackPanel.SetActive(true);
  60.                 }
  61.                 break;
  62.  
  63.             case CardType.Rare:
  64.                 if (BuyCards.Money >= 2500)
  65.                 {
  66.                     PackPanel.SetActive(true);
  67.                 }
  68.                 break;
  69.  
  70.             case CardType.Epic:
  71.                 if (BuyCards.Money >= 4000)
  72.                 {
  73.                     PackPanel.SetActive(true);
  74.                 }
  75.                 break;
  76.         }
  77.     }
  78.    
  79.     //Call this function to deactivate and hide the main menu panel during the main menu
  80.     public void HidePackPanel()
  81.     {
  82.         PackPanel.SetActive(false);
  83.     }
  84.  
  85.     //Call this function to activate and display the main menu panel during the main menu
  86.     public void ShowMenu()
  87.     {
  88.         menuPanel.SetActive (true);
  89.     }
  90.  
  91.     //Call this function to deactivate and hide the main menu panel during the main menu
  92.     public void HideMenu()
  93.     {
  94.         menuPanel.SetActive (false);
  95.     }
  96.    
  97.     //Call this function to activate and display the Pause panel during game play
  98.     public void ShowPausePanel()
  99.     {
  100.         pausePanel.SetActive (true);
  101.         optionsTint.SetActive(true);
  102.     }
  103.  
  104.     //Call this function to deactivate and hide the EndGamePanel during game play
  105.     public void HidePausePanel()
  106.     {
  107.         pausePanel.SetActive (false);
  108.         optionsTint.SetActive(false);
  109.  
  110.     }
  111.  
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement