// Start is called before the first frame update
 void Start()
 {
     uniqueID           = GetComponent <UniqueID>();
     database           = FindObjectOfType <ItemDatabase>();
     collectibleItemSet = FindObjectOfType <CollectibleItemSet>();
     if (collectibleItemSet.CollectedItems.Contains(uniqueID.ID))
     {
         Destroy(this.gameObject);
         return;
     }
 }
예제 #2
0
    private void Start()
    {
        healthBar.SetHealth(maxHealth);
        god            = GameObject.Find("QuestGiverShop");
        collectedItems = FindObjectOfType <CollectibleItemSet>();

        for (int i = attributes.Length - 1; i >= 0; i--)
        {
            attributes[i].SetParent(this);
        }

        for (int i = equipment.GetSlots.Length - 1; i >= 0; i--)
        {
            equipment.GetSlots[i].OnBeforUpdate += OnBeforeSlotsUpdate;
            equipment.GetSlots[i].OnAfterUpdate += OnAfterSlotsUpdate;
        }

        for (int i = shop.GetSlots.Length - 1; i >= 0; i--)
        {
            shop.GetSlots[i].OnBeforUpdate += OnBeforeSlotsUpdate;
            shop.GetSlots[i].OnAfterUpdate += OnAfterSlotsUpdate;
        }
    }