Weapons are now monolithic behaviors Various new weapon behavior types implemented All weapons have optional magazine and reload mechanic Visibility now decays globally
32 lines
879 B
C#
32 lines
879 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using MessagePack;
|
|
using Newtonsoft.Json;
|
|
using Unity.Mathematics;
|
|
using static Unity.Mathematics.math;
|
|
|
|
[InspectableField, MessagePackObject, JsonObject(MemberSerialization.OptIn), RuntimeInspectable]
|
|
public class AutoWeaponData : InstantWeaponData
|
|
{
|
|
public override IBehavior CreateInstance(ItemManager context, Entity entity, EquippedItem item)
|
|
{
|
|
return new AutoWeapon(context, this, entity, item);
|
|
}
|
|
}
|
|
|
|
public class AutoWeapon : InstantWeapon
|
|
{
|
|
|
|
public AutoWeapon(ItemManager context, InstantWeaponData data, Entity entity, EquippedItem item) : base(context, data, entity, item)
|
|
{
|
|
}
|
|
|
|
public override bool Execute(float delta)
|
|
{
|
|
if(_firing && _burstRemaining == 0 && _cooldown < 0)
|
|
Trigger();
|
|
return base.Execute(delta);
|
|
}
|
|
}
|
|
|