2021-01-25 05:53:36 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using MessagePack;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Unity.Mathematics;
|
|
|
|
|
using static Unity.Mathematics.math;
|
|
|
|
|
|
2021-03-31 04:07:11 +01:00
|
|
|
[Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn), RuntimeInspectable]
|
2021-01-25 05:53:36 +00:00
|
|
|
public class AutoWeaponData : InstantWeaponData
|
|
|
|
|
{
|
2021-04-12 04:20:52 +01:00
|
|
|
public override IBehavior CreateInstance(EquippedItem item)
|
2021-01-25 05:53:36 +00:00
|
|
|
{
|
2021-04-12 04:20:52 +01:00
|
|
|
return new AutoWeapon(this, item);
|
2021-01-25 05:53:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class AutoWeapon : InstantWeapon
|
|
|
|
|
{
|
|
|
|
|
|
2021-04-12 04:20:52 +01:00
|
|
|
public AutoWeapon(InstantWeaponData data, EquippedItem item) : base(data, item)
|
2021-01-25 05:53:36 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Execute(float delta)
|
|
|
|
|
{
|
|
|
|
|
if(_firing && _burstRemaining == 0 && _cooldown < 0)
|
|
|
|
|
Trigger();
|
|
|
|
|
return base.Execute(delta);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|