add:添加伤害字体脚本,添加红蓝双方倒计时
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DamageNumbersPro;
|
||||
using DragonLi.Core;
|
||||
using DragonLi.Frame;
|
||||
using Mirror;
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR;
|
||||
@@ -35,7 +37,7 @@ public enum HandState
|
||||
HaveWeapon
|
||||
}
|
||||
|
||||
public class Player : NetworkRoomPlayer
|
||||
public class Player : NetworkRoomPlayer,IDamagable
|
||||
{
|
||||
public Transform LeftHand;
|
||||
public Transform RightHand;
|
||||
@@ -158,15 +160,28 @@ public class Player : NetworkRoomPlayer
|
||||
// NetworkServer.Destroy(other.gameObject);
|
||||
// GameManager.Ins.GameStart();
|
||||
teamType = TeamType.Red;
|
||||
GivePistol();
|
||||
}
|
||||
|
||||
if (other.tag == "BlueDoor")
|
||||
{
|
||||
Debug.Log("触碰开始");
|
||||
teamType = TeamType.Blue;
|
||||
GivePistol();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[ClientRpc]
|
||||
public void GivePistol()
|
||||
{
|
||||
if(NowHandState!= HandState.Empty)
|
||||
return;
|
||||
|
||||
Debug.Log("创建武器中...");
|
||||
|
||||
PickUpGun(GunType.Pistol, -999);
|
||||
}
|
||||
|
||||
#region 枪械系统
|
||||
|
||||
@@ -475,6 +490,14 @@ public class Player : NetworkRoomPlayer
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void ApplyDamage(float value, object info, Transform _sender)
|
||||
{
|
||||
DamageNumber prefab = MRDamage.Ins.GetCurrent();
|
||||
DamageNumber newDamageNumber = prefab.Spawn(Aim.position+new Vector3(0,2,0), value);
|
||||
}
|
||||
|
||||
public float Health { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user