76 lines
1.8 KiB
C#
76 lines
1.8 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
public class PlayerState : MonoBehaviour
|
|
{
|
|
|
|
PlayerJoinResponse playerJoinResponse;
|
|
string UserName;// 用户名
|
|
string RoomId;// 房间Id
|
|
int Status;//扶态日特加入 1进行中 2已结束
|
|
string RoleName;// 角色名
|
|
int IsLeadingNPC;//1=此职业有分管NPC的功
|
|
bool Online;// 判断是否在线 true 在线 false 离线
|
|
int RoleId =7;// 角色id
|
|
int GroupLeader = 8;// 是否是组长 0 组员 1 组长 2 总指挥 3 主持人
|
|
int ActionHode;//0=主持人1=指令式行动2=自由行动
|
|
int Group =10;//小组归属 -1 无归属 有值有归属
|
|
double X = 11;// 坚标X
|
|
double Y = 12;// 坚标Y
|
|
double Z = 13;// 坚标Z
|
|
string OverseeCond;// 分管区域ID
|
|
int SendFraneCount=15;//玩家发送的帧数
|
|
int HovespeedFirst;//移动速度1
|
|
int Movespeedsecond = 17;//移动速度2
|
|
int MoveSpeedThird = 18;//移动速度3
|
|
int BearLoad = 19;// 负重
|
|
int Protection = 20;//防护值
|
|
int Health = 100;//健康值 100
|
|
int Rolestatus = 22;//角色扶态 0正常 1行动受限 2负伤 3昏速 4手变伤
|
|
int UserId = 23;// 用户id
|
|
|
|
|
|
[Header("玩家总血量")]
|
|
public float totalHp = 100;
|
|
[Header("玩家当前血量")]
|
|
public float currentHp;
|
|
[Header("抵抗力")]
|
|
public float defend;
|
|
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
currentHp = totalHp;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void beHurt(float hurt)
|
|
{
|
|
if(currentHp >0)
|
|
{
|
|
currentHp -= hurt;
|
|
Debug.Log(currentHp);
|
|
//这里加上屏幕闪红
|
|
ScreenRed.instance.ShowRed();
|
|
}
|
|
if(currentHp <= 0)
|
|
{
|
|
Debug.Log("你死了");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|