mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 01:07:14 +08:00
(client) chore:Clean code
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -6,7 +5,7 @@ using UnityEngine.UI;
|
||||
namespace Prefab
|
||||
{
|
||||
// [RequireComponent(typeof(CircleCollider2D))]
|
||||
public class HoverButtonPrefab:MonoBehaviour
|
||||
public class HoverButtonPrefab : MonoBehaviour
|
||||
{
|
||||
public TMP_Text text;
|
||||
public Button button;
|
||||
@@ -23,8 +22,8 @@ namespace Prefab
|
||||
|
||||
public void OnMouseOver()
|
||||
{
|
||||
var dir= (Input.mousePosition - transform.position).magnitude;
|
||||
|
||||
var dir = (Input.mousePosition - transform.position).magnitude;
|
||||
|
||||
var color = button.image.color;
|
||||
color.a = Mathf.Min((startRadius - dir) / (startRadius - endRadius), 1);
|
||||
button.image.color = color;
|
||||
|
||||
Reference in New Issue
Block a user