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

61 lines
1.4 KiB
C#

using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// ÓÒ²àÃæ°å
/// </summary>
public class UI_RightBgPanel : BasePanel
{
private Button RightOpen_Btn;
public bool isRight;
protected override void Awake()
{
base.Awake();
RightOpen_Btn = GetControl<Button>("RightOpen_Btn");
}
protected override void OnClick(string btnPath)
{
base.OnClick(btnPath);
switch (btnPath)
{
case "RightOpen_Btn":
Debug.Log(btnPath);
if (!isRight)
{
gameObject.transform.DOLocalMove(new Vector3(490, 0, 0), 1f);
isRight = true;
//RightOpen_Btn.GetComponent<Image>().sprite = ;
}
else
{
gameObject.transform.DOLocalMove(new Vector3(960, 0, 0), 1f);
isRight = false;
//RightOpen_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()
{
}
}