Пример #1
0
        public override void OnAssert(bool alreadyUnlocked)
        {
            KeyItemInventory = GameObject.FindGameObjectWithTag(DataConsts.GLOBAL_CONTEXT_TAG)
                               .GetComponentInChildren <PlayerKeyItemInventory>();

            IsUnlocked = alreadyUnlocked && KeyItemInventory.HasItem(ExpectedObjectInInventory.Id);
        }
Пример #2
0
        public override void OnAssert(bool alreadyAcquired)
        {
            KeyItemInventory = GameObject.FindGameObjectWithTag(DataConsts.GLOBAL_CONTEXT_TAG)
                               .GetComponentInChildren <PlayerKeyItemInventory>();

            if (alreadyAcquired)
            {
                Destroy(gameObject);
            }

            /// Integrity check to see if we have the item yet if it's not set in save data (should never be a thing).
            if (!alreadyAcquired && KeyItemInventory.HasItem(CollectibleItemObject.Id) ||
                alreadyAcquired && !KeyItemInventory.HasItem(CollectibleItemObject.Id))
            {
                throw new System.Exception(ErrorConsts.KEY_ITEM_INTEGRITY_FAILUE);
            }
        }