fix:调整道具枪倒计时问题
This commit is contained in:
@@ -65,7 +65,6 @@ public class Pistol : Launcher
|
|||||||
|
|
||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
Debug.Log(isOwned);
|
|
||||||
if (!isOwned)
|
if (!isOwned)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -74,8 +74,6 @@ public class StunGun : Launcher
|
|||||||
[Command]
|
[Command]
|
||||||
private void CmdShoot()
|
private void CmdShoot()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// 让所有客户端显示激光
|
// 让所有客户端显示激光
|
||||||
RpcShowLaser();
|
RpcShowLaser();
|
||||||
|
|
||||||
@@ -120,24 +118,6 @@ public class StunGun : Launcher
|
|||||||
bullet_prefab.SetActive(false);
|
bullet_prefab.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ClientRpc]
|
|
||||||
// private void RpcSetLaserEndPoint(Vector3 endPos)
|
|
||||||
// {
|
|
||||||
// if (stunEffectPos.parent != null)
|
|
||||||
// {
|
|
||||||
// // 若 VFX 使用 local,需要转换
|
|
||||||
// var v3 = stunEffectPos.parent.InverseTransformPoint(endPos);
|
|
||||||
// v3 = new Vector3(0, 0, endPos.z);
|
|
||||||
// stunEffectPos.localPosition = v3;
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// // 若 VFX 使用 world space
|
|
||||||
// stunEffectPos.position = endPos;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// ====================== 服务器伤害计算 ======================
|
// ====================== 服务器伤害计算 ======================
|
||||||
|
|
||||||
[Server]
|
[Server]
|
||||||
|
|||||||
@@ -195,7 +195,6 @@ public class Player : NetworkRoomPlayer,IDamagable
|
|||||||
{
|
{
|
||||||
AimVec = Aim.position;
|
AimVec = Aim.position;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsUserAirdropItem&& curGun!=null && curGun.userTime > 0)
|
if (IsUserAirdropItem&& curGun!=null && curGun.userTime > 0)
|
||||||
{
|
{
|
||||||
curGun.curUserTime-=Time.deltaTime;
|
curGun.curUserTime-=Time.deltaTime;
|
||||||
@@ -273,8 +272,7 @@ public class Player : NetworkRoomPlayer,IDamagable
|
|||||||
Debug.Log("创建武器中...");
|
Debug.Log("创建武器中...");
|
||||||
PickUpGun(GunType.Pistol, GameManager.Ins.GunInfos[GunType.Pistol][1].BulletAmount);
|
PickUpGun(GunType.Pistol, GameManager.Ins.GunInfos[GunType.Pistol][1].BulletAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[ClientRpc]
|
[ClientRpc]
|
||||||
public void ClearGun()
|
public void ClearGun()
|
||||||
{
|
{
|
||||||
@@ -314,8 +312,7 @@ public class Player : NetworkRoomPlayer,IDamagable
|
|||||||
dieArmorPre.SetActive(true);
|
dieArmorPre.SetActive(true);
|
||||||
dieHelmetPre.SetActive(true);
|
dieHelmetPre.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[ClientRpc]
|
[ClientRpc]
|
||||||
public void RpcShowKillUI()
|
public void RpcShowKillUI()
|
||||||
{
|
{
|
||||||
@@ -451,6 +448,9 @@ public class Player : NetworkRoomPlayer,IDamagable
|
|||||||
NetworkServer.Spawn(right.gameObject,gameObject);
|
NetworkServer.Spawn(right.gameObject,gameObject);
|
||||||
curGun = right;
|
curGun = right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gunType != GunType.Pistol)
|
||||||
|
IsUserAirdropItem = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user