void Start() { if (string.IsNullOrEmpty(CollectableID) || CollectableID.Equals("") || CollectableID == "" || CollectableID == null) { CollectableID = CollectableType.ToString() + "_" + transform.position; } GetComponent <Collider>().enabled = true; CollectableCollected = MainGameController.current.HasPlayerCollectedCollectable(CollectableID); GetComponent <Collider>().enabled = !CollectableCollected; gfxParent.SetActive(!CollectableCollected); }
public ScriptableBase CreateCollectable(CollectableType type) { switch (type) { case CollectableType.BUL_BIG: return(BigBullet); case CollectableType.BUL_BOOM: return(ExplodingBullet); case CollectableType.GUN_PISTOL: return(DefaultWeapon); case CollectableType.GUN_SHOTGUT: return(Shotgut); case CollectableType.GUN_MACHINE_GUN: return(MachineGun); case CollectableType.CORE_PLASMA: return(PlasmaCore); case CollectableType.CORE_VOLTAGE: return(VoltageCore); default: throw new UnityException("No creating for the item type: " + type.ToString() + " defined"); } }
public static CraftingType ConvertCollectableType(CollectableType collType) { switch (collType) { case CollectableType.BUL_BIG: case CollectableType.BUL_BOOM: case CollectableType.BUL_SPRAY: return(CraftingType.BULLET); case CollectableType.CORE_PLASMA: case CollectableType.CORE_VOLTAGE: return(CraftingType.CORE); case CollectableType.GUN_MACHINE_GUN: case CollectableType.GUN_PISTOL: case CollectableType.GUN_SHOTGUT: return(CraftingType.WEAPON); default: throw new NotImplementedException("No handling implemented for type: " + collType.ToString()); } }
// Start is called before the first frame update void Start() { posOffset = transform.position; Debug.Log("collectableType: " + collectableType); Debug.Log("Collectable type to string: " + collectableType.ToString()); }