最近自制了一款TPS游戏。👀
但是,还没测试(
于是😃
希望有人可以帮我测试(服务器压力/游戏玩法/bug)👍
或提出建议😉
测试:610478514
游戏内截图:
部分代码公开:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using UnityEngine.UI;
public class PlayerHealth : MonoBehaviour
{
public float maxhp = 100;
public float hp = 100;
public Canvas minecanvas;
public Slider Hpslider;
public PhotonManager PM;
public Animator playerAni;
private PhotonView pv;
// Start is called before the first frame update
void Start()
{
pv = GetComponent<PhotonView>();
if (!pv.IsMine || !PhotonNetwork.IsConnected) return;
hp = maxhp;
PM = GameObject.Find("GameManager").GetComponent<PhotonManager>();
minecanvas.gameObject.SetActive(true);
}
// Update is called once per frame
void Update()
{
if (!pv.IsMine || !PhotonNetwork.IsConnected) return;
Hpslider.value = hp / 100;
if(hp<=0)
{
playerAni.SetBool("dead", true);
playerAni.SetBool("Idle", false);
playerAni.SetBool("jumping", false);
playerAni.SetBool("Stabbing", false);
hp = maxhp;
StartCoroutine("fuhuo");
}
}
IEnumerator fuhuo()
{
yield return new WaitForSeconds(2.45f);
playerAni.SetBool("dead", false);
transform.position = PM.getstartpos();
}
}