NanDaEnvironmentalProtection/Assets/Scripts/UI/UIPanel/UI_LeftBgPanel.cs

62 lines
1.4 KiB
C#

using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// ×ó²àÃæ°å
/// </summary>
public class UI_LeftBgPanel : BasePanel
{
private Button LeftOpen_Btn;
public bool isLeft;
protected override void Awake()
{
base.Awake();
LeftOpen_Btn = GetControl<Button>("LeftOpen_Btn");
}
protected override void OnClick(string btnPath)
{
base.OnClick(btnPath);
switch (btnPath)
{
case "LeftOpen_Btn":
Debug.Log(btnPath);
if (!isLeft)
{
gameObject.transform.DOLocalMove(new Vector3(-490, 0, 0), 1f);
isLeft = true;
//LeftOpen_Btn.GetComponent<Image>().sprite = ;
}
else
{
gameObject.transform.DOLocalMove(new Vector3(-960, 0, 0), 1f);
isLeft = false;
//LeftOpen_Btn.GetComponent<Image>().sprite = ;
}
break;
}
}
public override void ShowMe()
{
base.ShowMe();
Debug.Log("UI_LoadingPanel ShowMe");
}
public override void HideMe()
{
base.HideMe();
Debug.Log("UI_LoadingPanel HideMe");
}
private void Update()
{
}
}