This commit is contained in:
Benjamín 2021-07-23 17:00:30 +02:00
parent ebc97d0d2b
commit 4d0551d339
3 changed files with 30 additions and 12 deletions

@ -226,6 +226,7 @@ MonoBehaviour:
m_Bits: 32 m_Bits: 32
sfx: {fileID: 1499575167} sfx: {fileID: 1499575167}
mouse: {fileID: 1949375702} mouse: {fileID: 1949375702}
sr: {fileID: 231727548}
--- !u!50 &231727551 --- !u!50 &231727551
Rigidbody2D: Rigidbody2D:
serializedVersion: 4 serializedVersion: 4

@ -8,6 +8,9 @@ public class MenuPlay : MonoBehaviour
public LayerMask contactFilter; public LayerMask contactFilter;
public AudioSource sfx; public AudioSource sfx;
public MenuMouse mouse; public MenuMouse mouse;
public SpriteRenderer sr;
private bool hover = false;
private bool previous_hover = false;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
@ -17,11 +20,25 @@ public class MenuPlay : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() 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(); sfx.Play();
SceneManager.LoadScene("Tutorial"); 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);
}
} }
} }
} }

@ -9,32 +9,32 @@ EditorUserSettings:
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
flags: 0 flags: 0
RecentlyUsedScenePath-1: RecentlyUsedScenePath-1:
value: 22424703114646680e0b0227036c72151802563f22213229
flags: 0
RecentlyUsedScenePath-2:
value: 22424703114646680e0b0227036c731500121478623d28393930 value: 22424703114646680e0b0227036c731500121478623d28393930
flags: 0 flags: 0
RecentlyUsedScenePath-3: RecentlyUsedScenePath-2:
value: 22424703114646680e0b0227036c731500121479623d28393930 value: 22424703114646680e0b0227036c731500121479623d28393930
flags: 0 flags: 0
RecentlyUsedScenePath-4: RecentlyUsedScenePath-3:
value: 22424703114646680e0b0227036c73150012147f623d28393930 value: 22424703114646680e0b0227036c73150012147f623d28393930
flags: 0 flags: 0
RecentlyUsedScenePath-5: RecentlyUsedScenePath-4:
value: 22424703114646680e0b0227036c73150012147c623d28393930 value: 22424703114646680e0b0227036c73150012147c623d28393930
flags: 0 flags: 0
RecentlyUsedScenePath-6: RecentlyUsedScenePath-5:
value: 22424703114646680e0b0227036c7919181e0b22623d28393930 value: 22424703114646680e0b0227036c7919181e0b22623d28393930
flags: 0 flags: 0
RecentlyUsedScenePath-7: RecentlyUsedScenePath-6:
value: 22424703114646680e0b0227036c6b0502180a232d2468252320092a value: 22424703114646680e0b0227036c6b0502180a232d2468252320092a
flags: 0 flags: 0
RecentlyUsedScenePath-8: RecentlyUsedScenePath-7:
value: 22424703114646680e0b0227036c73150012147b623d28393930 value: 22424703114646680e0b0227036c73150012147b623d28393930
flags: 0 flags: 0
RecentlyUsedScenePath-9: RecentlyUsedScenePath-8:
value: 22424703114646680e0b0227036c73150012147e623d28393930 value: 22424703114646680e0b0227036c73150012147e623d28393930
flags: 0 flags: 0
RecentlyUsedScenePath-9:
value: 22424703114646680e0b0227036c72151802563f22213229
flags: 0
UnityRemoteCompression: UnityRemoteCompression:
value: 337f73 value: 337f73
flags: 0 flags: 0