newzone command

Added newzone command and updated readme
This commit is contained in:
hyperion51 2020-04-29 11:27:55 +01:00
commit 588d89a5d0
12 changed files with 171 additions and 36 deletions

View file

@ -0,0 +1,17 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class AgentTask
{
}
public enum AgentJob
{
Mine,
Haul,
Tow,
Defend,
Attack
}

View file

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

View file

@ -43,11 +43,11 @@ public class VelocityMatch : AgentBehavior
var velocity = length(_entity.Velocity);
var deltaV = Objective.Velocity - _entity.Velocity;
var stoppingTime = length(deltaV) / _entity.Context.Evaluate((_thrust.Data as ThrusterData).Thrust, _thrust.Item, _entity) * _entity.Mass;
var stoppingDistance = stoppingTime * velocity / 2;
var stoppingTime = length(deltaV) / (_entity.Context.Evaluate((_thrust.Data as ThrusterData).Thrust, _thrust.Item, _entity) / _entity.Mass);
var stoppingDistance = stoppingTime * (velocity / 2);
var angleDiff = _entity.Direction.AngleDiff(deltaV);
var turnaroundTime = angleDiff / _entity.Context.Evaluate((_turning.Data as TurningData).Torque, _turning.Item, _entity) * _entity.Mass;
var turnaroundTime = angleDiff / (_entity.Context.Evaluate((_turning.Data as TurningData).Torque, _turning.Item, _entity) / _entity.Mass);
var turnaroundDistance = turnaroundTime * velocity;
return float2(stoppingDistance + turnaroundDistance, stoppingTime + turnaroundTime);

View file

@ -15,6 +15,7 @@ public class VelocityLimitData : IBehaviorData
}
}
[UpdateOrder(100)]
public class VelocityLimit : IBehavior
{
public Entity Entity { get; }