当前位置:网站首页>Unity+photon self made multiplayer TPS game
Unity+photon self made multiplayer TPS game
2022-07-24 23:59:00 【I want to take a very, very, very long name】
Recently, I made one TPS game .
however , Not yet tested (
therefore
I hope someone can help me test ( Server pressure / How to play the game /bug)
Or make suggestions
test :610478514
Screenshot of the game :



Part of the code is public :
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();
}
}
边栏推荐
- Transmission download list, download file migration machine guide
- Zheng Huijuan: Research on application scenarios and evaluation methods of data assets based on the unified market
- Notes of Teacher Li Hongyi's 2020 in-depth learning series 9
- 91. (leaflet chapter) leaflet situation plotting - offensive direction drawing
- Code coverage
- Xiezhendong: Exploration and practice of digital transformation and upgrading of public transport industry
- Bug summary
- UART
- Beisen prospectus: the advantages of the track are prominent, and integration + medium and large customers are plus points
- Js----- Chapter 4 array
猜你喜欢

Paper time review MB2: build a behavior model for autonomous databases
Simple message queue implementation nodejs + redis =mq

EF core :自引用的组织结构树

Opengauss kernel analysis: query rewriting

Branch and loop statements in C language learning

SQL file import database - Nanny level tutorial

Qt项目-安防监控系统(各个界面功能实现)

云计算三类巨头:IaaS、PaaS、SaaS,分别是什么意思,应用场景是什么?

UART

ES6 adds -iterator traversal, for..Of loop
随机推荐
Transmission download list, download file migration machine guide
Paper notes: accurate causal influence on discrete data
Upload and download filask files
What are the meanings and application scenarios of the three giants of cloud computing: IAAs, PAAS and SaaS?
Branch and loop statements in C language learning
QT learning - using database singleton to complete login matching + registration function
Are you still using system. Currenttimemillis()? Take a look at stopwatch
Install K6 test tool
2022 the most NB JVM foundation to tuning notes, thoroughly understand Alibaba P6 small case
Processing PDF and JPG files in VB6
QT project - security monitoring system (function realization of each interface)
Analyzing the principle of DNS resolution in kubernetes cluster
痞子衡嵌入式:MCUXpresso IDE下将源码制作成Lib库方法及其与IAR,MDK差异
LeetCode_ 6124_ The first letter that appears twice
.net redis client newlife.redis.core library usage
UART
Redis6.2 SYSTEMd startup prompt redis service: Failed with result ‘protocol‘.
ROS机械臂 Movelt 学习笔记3 | kinect360相机(v1)相关配置
MySQL common basic commands
Shardingsphere database sub database sub table introduction