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

            IsUnlocked = alreadyUnlocked && KeyItemInventory.HasItem(ExpectedObjectInInventory.Id);
        }
Beispiel #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);
            }
        }
Beispiel #3
0
        public void Use(Collider2D collider, INPUT_TYPE inputType)
        {
            IsUnlocked = KeyItemInventory.HasItem(ExpectedObjectInInventory.Id);
            UpdateBoolState(IsUnlocked);

            if (IsUnlocked)
            {
                RemotePrefabInstance.StartInteraction();
            }
        }