Example #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag.Equals("Player"))
     {
         WrenchMageInventory.GetInstance().addItem(spawnablePrefab);
         Destroy(this.gameObject);
     }
 }
Example #2
0
    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;
     }
 }