GoodNoodle

Bestiery

Jan 18th, 2024 (edited)
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.58 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class Beastiery : MonoBehaviour
  7. {
  8.     public GameObject beastiery;
  9.     public GameObject[] entries;
  10.     public GameObject[] theHabitates;
  11.  
  12.     public Button[] buttons;
  13.  
  14.     CreatureBase creatureBase;
  15.  
  16.     public List<int> IDs = new List<int>();
  17.  
  18.    
  19.     public void EnableEntryButton(int id)
  20.     {
  21.         buttons[id - 1].interactable = true;
  22.  
  23.     }
  24.     public void EnableEntry(int id)
  25.     {
  26.        
  27.        
  28.         for (int i = 0; i < entries.Length; i++)
  29.         {
  30.             entries[i].SetActive(false);
  31.            
  32.         }
  33.  
  34.         // only enable coosen creature.
  35.         entries[id].SetActive(true);
  36.     }
  37.  
  38.     public void OpenBeasteary()
  39.     {
  40.         beastiery.SetActive(true);
  41.     }
  42.  
  43.     public void addIDs(int idtoAdd)
  44.     {
  45.         for (int i = 0; i < IDs.Count; i++)
  46.         {
  47.            
  48.  
  49.             if (IDs == null)
  50.             {
  51.                
  52.                   IDs.Add(idtoAdd);
  53.  
  54.             }
  55.            
  56.  
  57.         }
  58.  
  59.     }
  60.  
  61.     public void OpenEarthHabitate()
  62.     {
  63.         theHabitates[0].SetActive(true);
  64.     }
  65.     public void OpenWaterHabitate()
  66.     {
  67.         theHabitates[1].SetActive(true);
  68.     }
  69.  
  70.     public void OpenFireHabitate()
  71.     {
  72.         theHabitates[2].SetActive(true);
  73.     }
  74.  
  75.  
  76.    public void OpenDarknessHabitate()
  77.     {
  78.         theHabitates[3].SetActive(true);
  79.     }
  80.  
  81.     public void OpenEtharealHabitate()
  82.     {
  83.         theHabitates[4].SetActive(true);
  84.     }
  85.  
  86.    
  87.    
  88. }
  89.  
Add Comment
Please, Sign In to add comment