/// <summary> /// Spawns a new weapon. /// </summary> /// <param name="weaponId">The weaponId of the newly created weapon.</param> /// <param name="position">The position to where the weapon should spawn.</param> public void CreateWeapon(byte weaponId, Vector2 position) { CreateSyncable((byte)GameManager.playerLayer, out NetSyncComponent ncs); NetSyncComponent.TriggerClientEvent("CW", ncs.Id, weaponId); ComponentFactory.CreateWeapon(ncs.Id, weaponId); ncs.Actor.GetComponent <Transform2>().WorldPosition = position; }
public void CreateWeapon(byte netId, byte weaponId) { ComponentFactory.CreateWeapon(netId, weaponId); }