(client) chore:Clean code
This commit is contained in:
@ -5,15 +5,15 @@ using UnityEngine.UI;
|
||||
|
||||
namespace Prefab
|
||||
{
|
||||
public class ButtonPrefab:MonoBehaviour
|
||||
public class ButtonPrefab : MonoBehaviour
|
||||
{
|
||||
public Button button;
|
||||
public TMP_Text text;
|
||||
|
||||
public string Label
|
||||
{
|
||||
get{return text.text;}
|
||||
set{text.text = value;}
|
||||
get { return text.text; }
|
||||
set { text.text = value; }
|
||||
}
|
||||
|
||||
public void AddListener(UnityAction callback)
|
||||
|
@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AI;
|
||||
using Base;
|
||||
using Data;
|
||||
using Entity;
|
||||
using Unity.VisualScripting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Prefab
|
||||
|
@ -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;
|
||||
|
@ -1,10 +1,9 @@
|
||||
using Base;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Prefab
|
||||
{
|
||||
|
||||
[RequireComponent(typeof(SpriteRenderer))]
|
||||
[RequireComponent(typeof(SpriteRenderer))]
|
||||
public class ImagePrefab : MonoBehaviour
|
||||
{
|
||||
public Sprite defaultSprite;
|
||||
|
@ -2,7 +2,7 @@ using UnityEngine;
|
||||
|
||||
namespace Prefab
|
||||
{
|
||||
public class ProgressBarPrefab:MonoBehaviour
|
||||
public class ProgressBarPrefab : MonoBehaviour
|
||||
{
|
||||
public GameObject _progress;
|
||||
public float Progress
|
||||
@ -10,7 +10,7 @@ namespace Prefab
|
||||
get => _progress.transform.localScale.x;
|
||||
set
|
||||
{
|
||||
var x=Mathf.Clamp01(value);
|
||||
var x = Mathf.Clamp01(value);
|
||||
_progress.transform.localScale = new Vector3(x, _progress.transform.localScale.y, _progress.transform.localScale.z);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ using UnityEngine.EventSystems;
|
||||
|
||||
namespace Prefab
|
||||
{
|
||||
public class RightMenuPrefab: MonoBehaviour,IPointerExitHandler
|
||||
public class RightMenuPrefab : MonoBehaviour, IPointerExitHandler
|
||||
{
|
||||
public GameObject menu;
|
||||
public ButtonPrefab buttonPrefab;
|
||||
|
@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using Base;
|
||||
using UnityEngine;
|
||||
|
||||
@ -26,7 +25,7 @@ namespace Prefab
|
||||
// ITick接口实现
|
||||
public void Tick()
|
||||
{
|
||||
var deltaTime=Time.deltaTime;
|
||||
var deltaTime = Time.deltaTime;
|
||||
if (_isPaused)
|
||||
{
|
||||
HandlePausedState();
|
||||
|
@ -6,11 +6,11 @@ namespace Prefab
|
||||
public class TextPrefab : MonoBehaviour
|
||||
{
|
||||
public TMP_Text text;
|
||||
|
||||
|
||||
public string Label
|
||||
{
|
||||
get{return text.text;}
|
||||
set{text.text = value;}
|
||||
get { return text.text; }
|
||||
set { text.text = value; }
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user