public override void OnAssert(bool alreadyUnlocked) { KeyItemInventory = GameObject.FindGameObjectWithTag(DataConsts.GLOBAL_CONTEXT_TAG) .GetComponentInChildren <PlayerKeyItemInventory>(); IsUnlocked = alreadyUnlocked && KeyItemInventory.HasItem(ExpectedObjectInInventory.Id); }
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); } }
public void Use(Collider2D collider, INPUT_TYPE inputType) { IsUnlocked = KeyItemInventory.HasItem(ExpectedObjectInInventory.Id); UpdateBoolState(IsUnlocked); if (IsUnlocked) { RemotePrefabInstance.StartInteraction(); } }