microgame progress

This commit is contained in:
myondev 2026-09-04 11:51:28 -07:00
parent ecff3c6b69
commit 79fcc7ce34
16 changed files with 2008 additions and 13 deletions

View file

@ -0,0 +1,34 @@
using System;
using Bremsengine;
using UnityEngine;
public class Chemical : MonoBehaviour
{
public string chemicalName;
public Sprite icon;
public LayerMask potLayer;
private void OnMouseDrag()
{
transform.position = GameManager.instance.GetMouseWorldPos();
}
private void OnMouseUp()
{
//we need to detect of the object is overlapping the pot!
//i guess doing an overlap circle will work, not too intensive so it doesn't make sense to do anything complex
Collider2D isOverlapPot = Physics2D.OverlapPoint(transform.position, potLayer);
Debug.Log(isOverlapPot);
if (isOverlapPot)
{
MarisaPotionMaker.instance.AddChemical(this);
Destroy(gameObject);
}
}
private void Break()
{
//if mouse not over pot, break lol
//gm explosion
}
}