当前位置:网站首页>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();
}
}
边栏推荐
- SQLite database operation
- Use and partial explanation of QDIR class
- Multithreading & high concurrency (the latest in the whole network: interview questions + map + Notes) the interviewer is calm
- Simple operation K6
- QT learning - using database singleton to complete login matching + registration function
- 2022 最 NB 的 JVM 基础到调优笔记, 吃透阿里 P6 小 case
- Pointers and arrays
- Piziheng embedded: the method of making source code into lib Library under MCU Xpress IDE and its difference with IAR and MDK
- Kubernetes application design guide
- How to make five kinds of data structures in redis
猜你喜欢

Leetcode 1260. two dimensional grid migration: two solutions (k simulations / one step)

C语言学习之分支与循环语句

Notes of Teacher Li Hongyi's 2020 in-depth learning series 5

Advanced function of postman

ROS机械臂 Movelt 学习笔记3 | kinect360相机(v1)相关配置

See project code Note 1

来自大佬洗礼!2022 头条首发纯手打 MySQL 高级进阶笔记, 吃透 P7 有望

Video chat source code - one-to-one live broadcast system source code

Let me introduce you to the partition automatic management of data warehouse

JS ------ Chapter II JS logic control
随机推荐
Architecture design of multi live shopping mall
HTB-Aragog
Use SQLite provided by the system
The use of where condition in MySQL is not equal to! = The problem that null values are filtered out occurs when in, etc
Qt学习-利用数据库单例完成 登录匹配 + 注册 功能实现
Analysis of WPF multi finger application development
Go基础笔记_4_map
Sql文件导入数据库-保姆级教程
每周小结(*66):下一个五年
Grafana - influxdb visual K6 output
C语言学习之分支与循环语句
Power consumption of chip
LP liquidity pledge mining system development detailed procedure
Zheng Huijuan: Research on application scenarios and evaluation methods of data assets based on the unified market
你还在使用System.currentTimeMillis()?来看看StopWatch吧
What are the meanings and application scenarios of the three giants of cloud computing: IAAs, PAAS and SaaS?
Efficiency increased by 98%! AI weapon behind operation and maintenance inspection of high altitude photovoltaic power station
数组中只出现一次的两个数字
Notes of Teacher Li Hongyi's 2020 in-depth learning series 9
Processing PDF and JPG files in VB6