1ea616dd60
Enemy balance, added upgrades, added score, added menu
30 lines
692 B
C#
30 lines
692 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class MouseCursor : MonoBehaviour
|
|
{
|
|
private SpriteRenderer rend;
|
|
public Sprite clickedCursor;
|
|
public Sprite normalCursor;
|
|
|
|
void Start()
|
|
{
|
|
Cursor.visible = false;
|
|
rend = GetComponent<SpriteRenderer>();
|
|
}
|
|
void Update()
|
|
{
|
|
Vector2 cursorPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
|
transform.position = cursorPos;
|
|
if (Input.GetMouseButtonDown(0))
|
|
{
|
|
rend.sprite = clickedCursor;
|
|
}
|
|
else if (Input.GetMouseButtonUp(0))
|
|
{
|
|
rend.sprite = normalCursor;
|
|
}
|
|
}
|
|
}
|