GoodNoodle

ID System

Feb 19th, 2024
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEditor;
  4. using UnityEngine;
  5.  
  6. public class IDSystem : MonoBehaviour
  7. {
  8.     public List<CreatureBase> IDs = new List<CreatureBase>();
  9.  
  10.     CreatureBase creature;
  11.     [SerializeField] CreatureBase testCreature;
  12.  
  13.     Beastiery bestiery;
  14.     int creatureid;
  15.     // Start is called before the first frame update
  16.     void Start()
  17.     {
  18.        
  19.        
  20.     }
  21.  
  22.     // Update is called once per frame
  23.     void Update()
  24.     {
  25.        
  26.         if (Input.GetKeyDown(KeyCode.N))
  27.         {
  28.             addIDs(testCreature);
  29.         }
  30.     }
  31.  
  32.     public void addIDs(CreatureBase idtoAdd)
  33.     {
  34.        
  35.  
  36.         if (!IDs.Contains(idtoAdd))
  37.         {
  38.            
  39.             IDs.Add(idtoAdd);
  40.             creatureid = creature.ID;
  41.             //bestiery.EnableEntryButton(1);
  42.  
  43.         }
  44.  
  45.     }
  46. }
  47.  
Add Comment
Please, Sign In to add comment