newzone command
Added newzone command and updated readme
This commit is contained in:
parent
e9b32dec0b
commit
588d89a5d0
12 changed files with 171 additions and 36 deletions
17
Assets/Scripts/ServerShared/Agents/AgentTask.cs
Normal file
17
Assets/Scripts/ServerShared/Agents/AgentTask.cs
Normal 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
|
||||
}
|
||||
11
Assets/Scripts/ServerShared/Agents/AgentTask.cs.meta
Normal file
11
Assets/Scripts/ServerShared/Agents/AgentTask.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 610ba26a0be594144b79c6206a0623ff
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ public class VelocityLimitData : IBehaviorData
|
|||
}
|
||||
}
|
||||
|
||||
[UpdateOrder(100)]
|
||||
public class VelocityLimit : IBehavior
|
||||
{
|
||||
public Entity Entity { get; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue