_
This commit is contained in:
@@ -226,6 +226,7 @@ MonoBehaviour:
|
||||
m_Bits: 32
|
||||
sfx: {fileID: 1499575167}
|
||||
mouse: {fileID: 1949375702}
|
||||
sr: {fileID: 231727548}
|
||||
--- !u!50 &231727551
|
||||
Rigidbody2D:
|
||||
serializedVersion: 4
|
||||
|
@@ -8,6 +8,9 @@ public class MenuPlay : MonoBehaviour
|
||||
public LayerMask contactFilter;
|
||||
public AudioSource sfx;
|
||||
public MenuMouse mouse;
|
||||
public SpriteRenderer sr;
|
||||
private bool hover = false;
|
||||
private bool previous_hover = false;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
@@ -17,11 +20,25 @@ public class MenuPlay : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0)){
|
||||
if(Physics2D.CircleCast(mouse.pos, 1f, Vector2.zero, 0f, contactFilter)){
|
||||
if(Physics2D.CircleCast(mouse.pos, 1f, Vector2.zero, 0f, contactFilter)){
|
||||
if (Input.GetMouseButtonDown(0)){
|
||||
sfx.Play();
|
||||
SceneManager.LoadScene("Tutorial");
|
||||
}
|
||||
|
||||
previous_hover = hover;
|
||||
hover = true;
|
||||
} else {
|
||||
previous_hover = hover;
|
||||
hover = false;
|
||||
}
|
||||
|
||||
if (hover != previous_hover) {
|
||||
if(hover) {
|
||||
sr.color = new Color(202f / 255f, 202f / 255f, 242f / 255f, 201f / 255f);
|
||||
} else {
|
||||
sr.color = new Color(149f / 255f, 189f / 255f, 253f / 255f, 201f / 255f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user