public static void SetupSim(string _instanceName, Vector3 _side, Vector3 _fwd) { var inst = RVOUnityMgr.GetInstance(_instanceName); inst.m_side = _side; inst.m_fwd = _fwd; }
public static void AddObstacle(string _instanceName, Vector3 _pos, Vector3 _extents) { var inst = RVOUnityMgr.GetInstance(_instanceName); inst.m_obstacles.Add(new RVOUnityInstance.RVOObstacle(_pos, _extents)); inst.m_forceRefresh = true; }
public static void CheckMe() { if (Me == null) { var go = new GameObject("RVOMgr"); Me = go.AddComponent <RVOUnityMgr>(); } }
public void Add() { if (m_instance == null) { m_instance = RVOUnityMgr.GetInstance(m_instanceName); } m_id = m_instance.m_instance.addAgent(transform.position.XZ()); if (m_radius != 0) { m_instance.m_instance.setAgentRadius(m_id, m_radius); } ClearVelocity(); }
// Use this for initialization void Start() { SetUpRoute(); m_prevWaypoint = m_currentWaypoint; m_desiredDirection = m_direction = GlobalScript.GetDirection(transform.position, m_currentWaypoint); m_animationScript = GetComponent <WNS_AnimationControllerScript> (); m_rvoScript = GetComponent <RVOUnity> (); m_maxSpeed = m_speed; if (m_animationScript == null) { print("Animation script it detached"); } if (m_rvoScript == null) { print("RVO script it detached"); } else { RVOUnityMgr.GetInstance("").SetCheckMoveFn(HandleCheckMoveFn); } }
public static int NumObstacles(string _instanceName) { var inst = RVOUnityMgr.GetInstance(_instanceName); return(inst.m_obstacles.Count); }
public static bool InstanceExists(string _instanceName) { return(RVOUnityMgr.InstanceExists(_instanceName)); }
public static void SetMoveCheck(string _instanceName, RVOUnityInstance.CheckMoveFn _fn) { var inst = RVOUnityMgr.GetInstance(_instanceName); inst.SetCheckMoveFn(_fn); }
public static void SetSimDefaults(string _instanceName, float _neighbourDistance, int _maxNeighbours, float _defaultRadius, float _maxSpeed) { var inst = RVOUnityMgr.GetInstance(_instanceName); inst.m_instance.setAgentDefaults(_neighbourDistance, _maxNeighbours, 10.0f, 10.0f, _defaultRadius, _maxSpeed, new RVO.Vector2()); }