Merge remote-tracking branch 'origin/main' into Huang

# Conflicts:
#	Assets/_MrCs/Scripts/Manager/GameLocal.cs
#	ProjectSettings/ProjectSettings.asset
This commit is contained in:
2026-01-20 18:01:58 +08:00
48 changed files with 122 additions and 32731 deletions

View File

@@ -1,6 +1,7 @@
fileFormatVersion: 2
guid: 1becc5b2e4b48c74a941f2abfebff177
PrefabImporter:
guid: 511a1ec77b61e6c48b73accc23ea433f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d1e65e8a848ab7b46a04c4e74642170b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e88a409e8f1f98f4c9e450a746a5cc1f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -170,7 +170,7 @@ Rigidbody:
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Bits: 8
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1

View File

@@ -170,7 +170,7 @@ Rigidbody:
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Bits: 8
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1

View File

@@ -170,7 +170,7 @@ Rigidbody:
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Bits: 8
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1

View File

@@ -170,7 +170,7 @@ Rigidbody:
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Bits: 8
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1

View File

@@ -170,7 +170,7 @@ Rigidbody:
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Bits: 8
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1

View File

@@ -170,7 +170,7 @@ Rigidbody:
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Bits: 8
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1

View File

@@ -170,7 +170,7 @@ Rigidbody:
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Bits: 8
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1

View File

@@ -170,7 +170,7 @@ Rigidbody:
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_Bits: 8
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1

File diff suppressed because it is too large Load Diff

View File

@@ -10610,7 +10610,7 @@ Rigidbody:
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 0
m_IsKinematic: 0
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0

View File

@@ -3813,7 +3813,6 @@ MonoBehaviour:
- {fileID: 905399022738026712, guid: 5495a17eb1e04dc42b68347dae126e2f, type: 3}
- {fileID: 8332491443137480012, guid: a2bbdb563004c454d93aaeeec296ba0c, type: 3}
- {fileID: 8963059409775886876, guid: 7f7495f450e5bd244be700f5a37528ef, type: 3}
- {fileID: 2201411466238183742, guid: 1becc5b2e4b48c74a941f2abfebff177, type: 3}
- {fileID: 4390428527419797527, guid: 4ea3ca0005fabd843a99827afdf1bd71, type: 3}
- {fileID: 5182545503591301674, guid: 4b336aa2da40fdb42a2fea2bf9cfc4de, type: 3}
- {fileID: 8963059409775886876, guid: b32b4959ddba878429a3529f931146ff, type: 3}
@@ -13790,6 +13789,8 @@ MonoBehaviour:
BGMState: {fileID: 541392504}
Version: 1.0.1
place: 0
vistAllTime: 900
curGameTime: 0
gameId: 0
Scene: {fileID: 0}
Settle: {fileID: 1209125662}

View File

@@ -1,98 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using DragonLi.Core;
using Mirror;
using UnityEngine;
public class Airdrop : Agent
{
/// <summary>
/// 怪物类型
/// </summary>
#if UNITY_EDITOR
[UnityEngine.DisplayOnly]
#endif
[SyncVar]
public EnemyType type;
[Header("等级")]
#if UNITY_EDITOR
[UnityEngine.DisplayOnly]
#endif
[SyncVar]
public int lvl = 0;
[Header("速度")]
#if UNITY_EDITOR
[UnityEngine.DisplayOnly]
#endif
[SyncVar]
public float speed = 0;
public GameObject kongtou_explosion_prefab;
[SerializeField] private Vector3 startPosition; // 初始位置
[SerializeField] private Vector3 endPosition; // 下落位置
[SerializeField] private float duration = 5.0f; // 下落时间
/// <summary>
/// 落地需要隐藏的节点
/// </summary>
public GameObject[] hideNodes;
private Transform _transform;
[Server]
public virtual void OnSpawn(EnemyType type, int lvl)
{
base.OnSpawn();
_transform = transform;
this.type = type;
this.lvl = lvl;
EnemyInfo enemyInfo = GameManager.Ins.EnemyInfos[type][lvl];
speed = enemyInfo.Speed;
health = enemyInfo.Hp;
originHealth = enemyInfo.Hp;
startPosition = transform.position;
endPosition = new Vector3(transform.position.x, 0, transform.position.z);
Fall();
}
public void Fall()
{
//模拟降落伞运动
transform.DOJump(endPosition, 1.0f, 1, duration).SetEase(Ease.Linear)
.OnComplete(() =>
{
for (int i = 0; i < hideNodes.Length; i++)
{
hideNodes[i].SetActive(false);
}
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
{
if (_transform != null)
{
Vector3 newEndPosition = endPosition + Vector3.down * 5.0f; // 示例:向下移动 10 个单位
_transform.DOJump(newEndPosition, 1.0f, 1, duration).SetEase(Ease.Linear)
.OnComplete(() =>
{
NetworkServer.Destroy(_transform.gameObject);
});
}
}, 2F);
});
}
public void CreatEexplosion()
{
GameObject explosion = Instantiate(kongtou_explosion_prefab);
NetworkServer.Spawn(explosion);
explosion.transform.position = transform.position;
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
{
NetworkServer.Destroy(explosion);
}, 2F);
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: d14e84c1429b12b42877d7e187e3fc45
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,20 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BLR02 : Enemy
{
public Launcher leftGun;
public Launcher rightGun;
public GameObject explosions_prefab;
public override void Shoot()
{
if (IsAlive)
{
// leftGun.Shoot();
rightGun.Shoot();
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 680cf5b3d1139344582906705661eecc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,13 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using Mirror;
using UnityEngine;
public class BloodPack : Airdrop
{
public override void OnDeath(object info, Transform _sender)
{
base.OnDeath(info, _sender);
CreatEexplosion();
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 93bf185846ee36f45a46720cf3a54a0a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,25 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DragonBoss : Enemy
{
public Launcher leftGun;
public override void UpdateRotation()
{
if (target != null)
{
Vector3 targetPos = new Vector3(target.transform.position.x, transform.position.y, target.transform.position.z);
transform.rotation = Quaternion.Lerp(transform.rotation, Quaternion.LookRotation(targetPos - transform.position), Time.deltaTime * 10);
}
}
public override void Shoot()
{
if (IsAlive)
{
leftGun.Shoot();
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: dab96e09b40ce01418b7c5c5383d17e4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,19 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GRMII : Enemy
{
public Launcher leftGun;
public Launcher rightGun;
public override void Shoot()
{
if (IsAlive)
{
leftGun.Shoot();
rightGun.Shoot();
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 64e86fe8174905e4682a11dfd1b94ae0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,37 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using DarkTonic.MasterAudio;
using DragonLi.Core;
using Mirror;
using Pathfinding;
using UnityEngine;
public class HR01 : Enemy
{
public Launcher leftLauncher;
public Launcher rightLauncher;
#if UNITY_EDITOR
[DisplayOnly]
#endif
public bool left = false;
public override void Shoot()
{
if (IsAlive)
{
if (left)
{
// Debug.Log("左边开火");
leftLauncher.Shoot();
}
else
{
// Debug.Log("右边开火");
rightLauncher.Shoot();
}
left = !left;
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 27612966c92c66a46bb7ba036c6f1f6b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,14 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using Mirror;
using UnityEngine;
public class JoinControl : Airdrop
{
public override void OnDeath(object info, Transform _sender)
{
base.OnDeath(info, _sender);
NetworkServer.Destroy(transform.gameObject);
CreatEexplosion();
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c628505e835917b4a9d2b3c5511e6b8f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,18 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MR3 : Enemy
{
public Launcher leftGun;
public Launcher rightGun;
public override void Shoot()
{
if (IsAlive)
{
leftGun.Shoot();
rightGun.Shoot();
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 6382ee37026bf8f4a9ced63de9d8c96e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,23 +0,0 @@
using System;
using UnityEngine;
public class NXR03 : Enemy
{
public GameObject bomb;
public void Start()
{
if (isServer)
{
behaviorTree.RegisterEvent("DelSelf", DelSelf2);
}
}
public override void UpdateRotation() { }
// 自毁
public void DelSelf2()
{
ApplyDamage(99999, null, null);
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ef5223b64e4d4ce44a6ef0cf2a156f4d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,16 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PHR01 : Enemy
{
public Launcher gun;
public override void Shoot()
{
if (IsAlive)
{
gun.Shoot();
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c2352ee10a4ed2a4299210625516f6f1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -16,11 +16,7 @@ public class AtkDummyGun : Launcher
userTime = gunInfo.Time;
curUserTime = gunInfo.Time;
waitBulletTime = gunInfo.CoolDown;
if (hand == HandType.Left)
{
MRInput.Ins.RegisterHoldPressLeftTrigger(ClickLeftTrigger);
}
else if (hand == HandType.Right)
if (hand == HandType.Right)
{
MRInput.Ins.RegisterHoldPressRightTrigger(ClickRrightTrigger);
}
@@ -40,11 +36,8 @@ public class AtkDummyGun : Launcher
// 从机自身
else if (isClient && isOwned)
{
if (hand == HandType.Left)
{
MRInput.Ins.RegisterHoldPressLeftTrigger(ClickLeftTrigger);
}
else if (hand == HandType.Right)
if (hand == HandType.Right)
{
MRInput.Ins.RegisterHoldPressRightTrigger(ClickRrightTrigger);
}
@@ -71,11 +64,10 @@ public class AtkDummyGun : Launcher
transform.rotation = GameLocal.Ins.self.RightHand.rotation;
}
}
[Client]
public void ClickLeftTrigger()
private void OnDestroy()
{
CmdShoot();
MRInput.Ins.UnregisterHoldPressRightTrigger(ClickRrightTrigger);
}
[Client]

View File

@@ -51,6 +51,11 @@ public class BombGun : Launcher
}
}
private void OnDestroy()
{
MRInput.Ins.UnregisterHoldPressRightTrigger(ClickRrightTrigger);
}
public void Update()
{
if (!isOwned)

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Mirror;
@@ -50,7 +51,12 @@ public class HpGun : Launcher
}
}
}
private void OnDestroy()
{
MRInput.Ins.UnregisterHoldPressRightTrigger(ClickRrightTrigger);
}
public void Update()
{
if (!isOwned)

View File

@@ -71,6 +71,10 @@ public class InvincibleGun : Launcher
transform.rotation = GameLocal.Ins.self.RightHand.rotation;
}
}
private void OnDestroy()
{
MRInput.Ins.UnregisterHoldPressRightTrigger(ClickRrightTrigger);
}
[Client]
public void ClickLeftTrigger()

View File

@@ -57,6 +57,11 @@ public class Pistol : Launcher
}
coolDownPre.SetActive(false);
}
private void OnDestroy()
{
MRInput.Ins.UnregisterHoldPressRightTrigger(ClickRrightTrigger);
}
public void Update()
{

View File

@@ -50,6 +50,10 @@ public class PoisonGun : Launcher
}
}
}
private void OnDestroy()
{
MRInput.Ins.UnregisterHoldPressRightTrigger(ClickRrightTrigger);
}
public void Update()
{

View File

@@ -71,6 +71,11 @@ public class ShieldGun : Launcher
transform.rotation = GameLocal.Ins.self.RightHand.rotation;
}
}
private void OnDestroy()
{
MRInput.Ins.UnregisterHoldPressRightTrigger(ClickRrightTrigger);
}
[Client]
public void ClickLeftTrigger()

View File

@@ -74,6 +74,11 @@ public class ShotGun : Launcher
transform.rotation = GameLocal.Ins.self.RightHand.rotation;
}
}
private void OnDestroy()
{
MRInput.Ins.UnregisterHoldPressRightTrigger(ClickRrightTrigger);
}
[Client]
public void ClickLeftTrigger()

View File

@@ -74,6 +74,11 @@ public class SmokeGun : Launcher
transform.rotation = GameLocal.Ins.self.RightHand.rotation;
}
}
private void OnDestroy()
{
MRInput.Ins.UnregisterHoldPressRightTrigger(ClickRrightTrigger);
}
[Client]
public void ClickLeftTrigger()

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using DragonLi.Frame;
@@ -41,6 +42,11 @@ public class StunGun : Launcher
}
}
private void OnDestroy()
{
MRInput.Ins.UnregisterHoldPressRightTrigger(ClickRightTrigger);
}
private void Update()
{
if (!isOwned) return;
@@ -68,8 +74,6 @@ public class StunGun : Launcher
[Command]
private void CmdShoot()
{
// 让所有客户端显示激光
RpcShowLaser();
@@ -114,24 +118,6 @@ public class StunGun : Launcher
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]

View File

@@ -128,6 +128,10 @@ public class GameLocal : MonoBehaviour
[Header("场地")]
public Place place = Place.Company1Floor;
// 总游玩时长
<<<<<<< HEAD
=======
[NonSerialized]
>>>>>>> origin/main
public int vistAllTime = (int)(60 * 10f);
public float curGameTime = 0;

View File

@@ -99,26 +99,9 @@ public class Player : NetworkRoomPlayer,IDamagable
/// </summary>
public HandState NowHandState = HandState.Empty;
/// <summary>
/// 手上的枪械
/// </summary>
private List<Launcher> Guns = new List<Launcher>();
/// <summary>
/// 现在手上的武器
/// </summary>
public int NowGunIndex = -1;
/// <summary>
/// 左手上的枪
/// </summary>
// private Transform leftGun;
/// <summary>
/// 右手上的枪
/// </summary>
private Launcher curGun;
private Transform rightGun;
public GameObject[] gunsPre;
#endregion
@@ -212,27 +195,16 @@ public class Player : NetworkRoomPlayer,IDamagable
{
AimVec = Aim.position;
}
if (IsUserAirdropItem && Guns[NowGunIndex].userTime > 0)
if (IsUserAirdropItem&& curGun!=null && curGun.userTime > 0)
{
Guns[NowGunIndex].curUserTime-=Time.deltaTime;
if (Guns[NowGunIndex].curUserTime < 0)
curGun.curUserTime-=Time.deltaTime;
if (curGun.curUserTime < 0)
{
IsUserAirdropItem = false;
Guns[NowGunIndex].bullet_amount = 0;
curGun.bullet_amount = 0;
DelWeapon();
}
}
if (Input.GetKeyDown(KeyCode.E))
{
int curIndex = NowGunIndex + 1>=gunsPre.Length? 0: NowGunIndex+1 ;
GiveAirdrop(connectionToClient,(GunType)curIndex,1);
}
if (Input.GetKeyDown(KeyCode.Q))
{
GiveAirdrop(connectionToClient,GunType.WuDiZhao,10);
}
}
invinciblePre.SetActive(isInvincible);
}
@@ -300,8 +272,7 @@ public class Player : NetworkRoomPlayer,IDamagable
Debug.Log("创建武器中...");
PickUpGun(GunType.Pistol, GameManager.Ins.GunInfos[GunType.Pistol][1].BulletAmount);
}
[ClientRpc]
public void ClearGun()
{
@@ -341,8 +312,7 @@ public class Player : NetworkRoomPlayer,IDamagable
dieArmorPre.SetActive(true);
dieHelmetPre.SetActive(true);
}
[ClientRpc]
public void RpcShowKillUI()
{
@@ -447,19 +417,6 @@ public class Player : NetworkRoomPlayer,IDamagable
return launcher;
}
[TargetRpc]
public void TriggerEvent(GunType gunType)
{
EventDispatcher.TriggerEvent("ChangeWeaponIcon", gunType, 0);
}
[TargetRpc]
public void TriggerEventAmount(float amount)
{
if (amount == -999) amount = 0;
EventDispatcher.TriggerEvent("ShowBulletAmount", amount);
}
/// <summary>
/// 拾取枪械
/// </summary>
@@ -468,225 +425,43 @@ public class Player : NetworkRoomPlayer,IDamagable
[Command(requiresAuthority = false)]
public void PickUpGun(GunType gunType, int amount)
{
Launcher find = null;
for (int i = 0; i < Guns.Count; i++)
{
Launcher launcher = Guns[i];
if (launcher != null && launcher.type == gunType)
{
find = launcher;
break;
}
}
if (find != null)
if (curGun != null&&gunType == curGun.type)
{
if(curGun.type== GunType.Pistol)
return;
Debug.Log("添加弹药 - " + gunType);
find.StuffBullet(amount);
Swith2TargetGun(gunType);
curGun.StuffBullet(amount);
}
else
{
if (curGun != null)
{
curGun.gameObject.SetActive(false);
NetworkServer.Destroy(curGun.gameObject);
curGun = null;
}
Debug.Log("增加新武器 - " + gunType);
Launcher left = null;
Launcher right = null;
right = LoadGun(HandType.Right, gunType);
right.SetBulletAmount(amount);
Guns.Add(right);
Swith2TargetGun(gunType);
NetworkServer.Spawn(right.gameObject,gameObject);
curGun = right;
}
if (gunType != GunType.Pistol)
IsUserAirdropItem = true;
}
/// <summary>
/// 切换到下个武器
/// </summary>
[Command]
public void Switch2NextWeaponCmd()
{
Switch2NextWeapon();
}
[Command]
public void Switch2BeforeWeaponCmd()
{
Switch2BeforeWeapon();
}
/// <summary>
/// 切换到下个武器
/// </summary>
[Server]
public void Switch2NextWeapon()
{
Debug.Log("切换到下个武器");
// 空手
if (NowHandState == HandState.Empty)
{
Debug.Log("空手->可有武器状态");
NowHandState = HandState.HaveWeapon;
}
// 无武器
if (Guns.Count <= 0)
{
Debug.Log("无武器");
return;
}
NowGunIndex++;
if (NowGunIndex > Guns.Count - 1)
{
NowGunIndex = 0;
}
UpdateWeapons();
}
/// <summary>
/// 切换到上个武器
/// </summary>
[Server]
public void Switch2BeforeWeapon()
{
Debug.Log("切换到下个武器");
// 空手
if (NowHandState == HandState.Empty)
{
Debug.Log("空手->可有武器状态");
NowHandState = HandState.HaveWeapon;
}
// 无武器
if (Guns.Count <= 0)
{
Debug.Log("无武器");
return;
}
NowGunIndex--;
if (NowGunIndex < 0)
{
NowGunIndex = Guns.Count - 1;
}
UpdateWeapons();
}
/// <summary>
/// 切换到指定枪械
/// </summary>
[Server]
public void Swith2TargetGun(GunType type)
{
Debug.Log("切换到指定枪械");
int find = -1;
for (int i = 0; i < Guns.Count; i++)
{
Launcher launcher = Guns[i];
if (launcher != null && launcher.type == type)
{
find = i;
break;
}
}
if (find != -1)
{
NowGunIndex = find;
}
UpdateWeapons();
}
[Command]
public void EntertTurret(NetworkIdentity turret)
{
turret.AssignClientAuthority(connectionToClient);
}
[Command]
public void ExitTurret(NetworkIdentity turret)
{
turret.RemoveClientAuthority();
}
/// <summary>
/// 武器更新
/// </summary>
[Server]
public void UpdateWeapons()
{
// if (leftGun != null)
// {
// leftGun.gameObject.SetActive(false);
// NetworkServer.UnSpawn(leftGun.gameObject);
// leftGun = null;
// }
if (rightGun != null)
{
rightGun.gameObject.SetActive(false);
NetworkServer.UnSpawn(rightGun.gameObject);
rightGun = null;
}
for (int i = 0; i < Guns.Count; i++)
{
if (i == NowGunIndex)
{
Launcher l1 = Guns[i];
if (l1 != null)
{
IsUserAirdropItem = l1.type != GunType.Pistol;
rightGun = l1.transform;
rightGun.gameObject.SetActive(true);
NetworkServer.Spawn(l1.gameObject, gameObject);
}
}
}
}
/// <summary>
/// 删除武器
/// </summary>
[Command(requiresAuthority = false)]
public void DelWeapon()
{
bool change = false;
for (int i = 0; i < Guns.Count; i++)
{
Launcher launcher = Guns[i];
if (launcher != null && launcher.bullet_amount <= 0)
{
change = true;
Guns[i] = null;
break;
}
}
if (change)
{
Guns.RemoveAll(x => x == null);
Switch2NextWeapon();
}
}
[Command]
public void Switch2EmptyCmd()
{
Switch2Empty();
}
/// <summary>
/// 切换为空手
/// </summary>
[Server]
public void Switch2Empty()
{
NowHandState = HandState.Empty;
NowGunIndex = -1;
UpdateWeapons();
GivePistol();
}
#endregion

View File

@@ -5,7 +5,7 @@ EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 0
- enabled: 1
path: Assets/_MrCs/Scenes/Company1Floor.unity
guid: 386a8fdea01af8a4e8d4a9835407ddec
- enabled: 0

View File

@@ -13,7 +13,11 @@ PlayerSettings:
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: pineappletech
<<<<<<< HEAD
productName: "\u706B\u529B\u5BF9\u51B3_\u77F3\u5634\u5C71"
=======
productName: "\u706B\u529B\u5BF9\u51B3_\u6D4B\u8BD5"
>>>>>>> origin/main
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
@@ -163,7 +167,11 @@ PlayerSettings:
androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier:
<<<<<<< HEAD
Android: com.pineappletech.mrcs.ningxiayinchuangshizuishanwandaguangchang
=======
Android: com.pineappletech.mrcs.gongsi1louceshi
>>>>>>> origin/main
Standalone: com.DefaultCompany.com.unity.template.ar
buildNumber:
Standalone: 0