29 lines
901 B
C#
29 lines
901 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 操作提示类
|
||
|
/// </summary>
|
||
|
public class OperateTips : MonoBehaviour
|
||
|
{
|
||
|
private GameObject y;
|
||
|
private GameObject sitckL;
|
||
|
private MyPlayer player;
|
||
|
void Start(){
|
||
|
y = transform.Find("Y").gameObject;
|
||
|
sitckL = transform.Find("转动摇杆").gameObject;
|
||
|
player = FindObjectOfType<MyPlayer>();
|
||
|
}
|
||
|
|
||
|
void Update(){
|
||
|
transform.position = player.transform.position;
|
||
|
//处理Y键显示
|
||
|
if(player.catching != null && !y.activeInHierarchy) y.SetActive(true);
|
||
|
if(player.catching == null && y.activeInHierarchy) y.SetActive(false);
|
||
|
//处理左摇杆显示
|
||
|
if(player.isCatching && !sitckL.activeInHierarchy) sitckL.SetActive(true);
|
||
|
if(!player.isCatching && sitckL.activeInHierarchy) sitckL.SetActive(false);
|
||
|
}
|
||
|
}
|