void Awake(){ if (_current != null && _current != this){ //DestroyImmediate(gameObject, false); return; } _current = this; masterCollider.enabled = false; GenerateMap(); }
static int GetCloserEdgePoint(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); PolyNav2D obj = (PolyNav2D)ToLua.CheckObject <PolyNav2D>(L, 1); UnityEngine.Vector2 arg0 = ToLua.ToVector2(L, 2); UnityEngine.Vector2 o = obj.GetCloserEdgePoint(arg0); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int PointInsidePolygon(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.Vector2[] arg0 = ToLua.CheckStructArray <UnityEngine.Vector2>(L, 1); UnityEngine.Vector2 arg1 = ToLua.ToVector2(L, 2); bool o = PolyNav2D.PointInsidePolygon(arg0, arg1); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void Awake() { if (_current == null) { _current = this; } regenerateFlag = false; isProcessingPath = false; navObstacles = FindObjectsOfType <PolyNavObstacle>().Where(o => obstaclesMask == (obstaclesMask | 1 << o.gameObject.layer)).ToList(); PolyNavObstacle.OnObstacleStateChange += MonitorObstacle; if (masterCollider != null) { masterCollider.enabled = false; GenerateMap(true); } }
static int PointIsConcave(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.Vector2[] arg0 = ToLua.CheckStructArray <UnityEngine.Vector2>(L, 1); int arg1 = (int)LuaDLL.luaL_checknumber(L, 2); bool o = PolyNav2D.PointIsConcave(arg0, arg1); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int InflatePolygon(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.Vector2[] arg0 = ToLua.CheckStructArray <UnityEngine.Vector2>(L, 1); float arg1 = (float)LuaDLL.luaL_checknumber(L, 2); UnityEngine.Vector2[] o = PolyNav2D.InflatePolygon(arg0, arg1); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int PointIsValid(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); PolyNav2D obj = (PolyNav2D)ToLua.CheckObject <PolyNav2D>(L, 1); UnityEngine.Vector2 arg0 = ToLua.ToVector2(L, 2); bool o = obj.PointIsValid(arg0); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_navObstacles(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PolyNav2D obj = (PolyNav2D)o; System.Collections.Generic.List <PolyNavObstacle> ret = obj.navObstacles; ToLua.PushSealed(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index navObstacles on a nil value")); } }
static int get_inflateRadius(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PolyNav2D obj = (PolyNav2D)o; float ret = obj.inflateRadius; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index inflateRadius on a nil value")); } }
static int get_regenerateFlag(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PolyNav2D obj = (PolyNav2D)o; bool ret = obj.regenerateFlag; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index regenerateFlag on a nil value")); } }
static int get_nodesCount(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PolyNav2D obj = (PolyNav2D)o; int ret = obj.nodesCount; LuaDLL.lua_pushinteger(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index nodesCount on a nil value")); } }
static int get_polyNav(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PolyNavAgent obj = (PolyNavAgent)o; PolyNav2D ret = obj.polyNav; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index polyNav on a nil value")); } }
static int set_regenerateFlag(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PolyNav2D obj = (PolyNav2D)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.regenerateFlag = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index regenerateFlag on a nil value")); } }
static int FindPath(IntPtr L) { try { ToLua.CheckArgsCount(L, 4); PolyNav2D obj = (PolyNav2D)ToLua.CheckObject <PolyNav2D>(L, 1); UnityEngine.Vector2 arg0 = ToLua.ToVector2(L, 2); UnityEngine.Vector2 arg1 = ToLua.ToVector2(L, 3); System.Action <UnityEngine.Vector2[], bool> arg2 = (System.Action <UnityEngine.Vector2[], bool>)ToLua.CheckDelegate <System.Action <UnityEngine.Vector2[], bool> >(L, 4); obj.FindPath(arg0, arg1, arg2); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_inflateRadius(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PolyNav2D obj = (PolyNav2D)o; float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.inflateRadius = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index inflateRadius on a nil value")); } }
static int set_navObstacles(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PolyNav2D obj = (PolyNav2D)o; System.Collections.Generic.List <PolyNavObstacle> arg0 = (System.Collections.Generic.List <PolyNavObstacle>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <PolyNavObstacle>)); obj.navObstacles = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index navObstacles on a nil value")); } }
static int get_pendingRequest(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PolyNav2D obj = (PolyNav2D)o; bool ret = obj.pendingRequest; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index pendingRequest on a nil value")); } }
/// <summary> /// Instantiation of spawn logic per Transport /// </summary> private void Start() { // Grab the spawn point for this unit. _spawnController = gameObject.GetComponent <TransportSpawnController>(); _spawnPoint = _spawnController.GetSpawnPoint(); _destination = _spawnController.GetDestination(); _payloadMultiplier = _spawnController.PayloadMultiplier; _spawnController.TearDown(); _navMapRef = FindObjectOfType <PolyNav2D>(); _myObstacle = gameObject.GetComponent <PolyNavObstacle>(); // Move to spawn location. transform.position = _spawnPoint; // Apply movement towards destination. MoveToDestination(); }
static int SegmentsCross(IntPtr L) { try { ToLua.CheckArgsCount(L, 4); UnityEngine.Vector2 arg0 = ToLua.ToVector2(L, 1); UnityEngine.Vector2 arg1 = ToLua.ToVector2(L, 2); UnityEngine.Vector2 arg2 = ToLua.ToVector2(L, 3); UnityEngine.Vector2 arg3 = ToLua.ToVector2(L, 4); bool o = PolyNav2D.SegmentsCross(arg0, arg1, arg2, arg3); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void Start() { float fireSize = hasLargeFire ? 0.3f : 0.1f; if (particles != null) { GameObject parts = Instantiate(particles, transform); parts.transform.localPosition = Vector3.zero; parts.transform.localScale = new Vector3(fireSize, fireSize, fireSize); } else { Debug.Log("No particles associated with this debris controller."); } if (isPolyNav == true) { _myObstacle = gameObject.GetComponent <PolyNavObstacle>(); _navMapRef = FindObjectOfType <PolyNav2D>(); _navMapRef.AddObstacle(_myObstacle); } }
//some initializing void Awake() { _current = this; masterCollider.enabled = false; GenerateMap(true); }
void OnEnable() { _current = this; }
private void Awake() { polyNavAgent = GetComponent <PolyNavAgent>(); polyNav2D = FindObjectOfType <PolyNav2D>(); polyColl2D = GetComponent <PolygonCollider2D>(); }
public BaseEntity_State_Patrol(BaseEntity _entity) { entity = _entity; player = GameObject.FindObjectOfType <PlayerDamageable>(); polyNav = this.entity.agent.map; }
////// ////// void OnEnable() { _map = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PolyNav2D>(); allAgents.Add(this); }