microgame progress
This commit is contained in:
parent
ecff3c6b69
commit
79fcc7ce34
16 changed files with 2008 additions and 13 deletions
34
Assets/Scripts/Microgame/Chemical.cs
Normal file
34
Assets/Scripts/Microgame/Chemical.cs
Normal 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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue