Files
PrinceOfGlory/Assets/Scripts/Hand/HandPosPlamUpManage.cs
kridoo 6e91a0c7f0 111
2025-09-15 17:32:08 +08:00

53 lines
1009 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HandPosPlamUpManage : MonoBehaviour
{
public GameObject cub;
public GameObject plam;
public Transform lookatPosition;
//¼ÆÊ±Ïà¹Ø
bool isRun = false;
float waitTime = 1f;
float runTime = 0;
private void Start()
{
cub.SetActive(false);
}
private void Update()
{
if (isRun)
{
runTime += Time.deltaTime;
if (runTime >= waitTime)
{
isRun = false;
runTime = 0;
cub.SetActive(true);
}
}
cub.transform.position = plam.transform.position;
cub.transform.LookAt(lookatPosition);
}
public void SetShowBackPack(bool isShow)
{
if (isShow)
{
isRun = true;
}
else
{
cub.SetActive(false);
isRun = false;
runTime = 0;
}
}
}