private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag.Equals("Player")) { WrenchMageInventory.GetInstance().addItem(spawnablePrefab); Destroy(this.gameObject); } }
private void maybeUseSpawnableObject() { SpawnablePlatform platform = WrenchMageInventory.GetInstance().GetSpawnablePlatform(); if (platform != null) { anim.SetTrigger("spawning"); Instantiate(platform, transform.position, Quaternion.identity); } }
private void Awake() { if (INSTANCE != null) { Destroy(this); } else { INSTANCE = this; } }