資源簡介
UI界面處理過渡
比如 點擊開始游戲按鈕 界面就滑動離開讓其他界面上來
代碼片段和文件信息
using?System.Collections;
using?System.Collections.Generic;
using?UnityEngine;
public?class?SwitchClick?:?MonoBehaviour
{
????///?
????///?自身的坐標
????///?
????private?RectTransform?_Rect;
????///?
????///?判斷開啟
????///?
????private?bool?IsClick?=?false;
????///?
????///?左右判斷
????///?
????private?bool?ToOrOut?=?true;
????///?
????///?速度
????///?
????private?int?Speed;
????///?
????///?距離
????///?
????private?int?Distance;
????void?Start()
????{
????????Init();
????}
????void?Update()
????{
????????Click();
????}
????///?
????///?初始化
????///?
????public?void?Init()
????{
????????_Rect?=?transform.GetComponent();
????????Speed?=?50;
????????Distance?=?100;
????}
????///?
????///?進入
????///?
????public?void?GetInto()///從右邊到左邊
????{
????????_Rect.anchoredPosition?=?new?Vector2(Distance?0);
????????IsClick?=?true;
????????ToOrOut?=?true;
????}
??
- 上一篇:C#垃圾代碼生成器.rar
- 下一篇:C#開發大全(基礎卷)源碼
評論
共有 條評論