static int AddObstacle(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); PolyNav2D obj = (PolyNav2D)ToLua.CheckObject <PolyNav2D>(L, 1); PolyNavObstacle arg0 = (PolyNavObstacle)ToLua.CheckObject <PolyNavObstacle>(L, 2); obj.AddObstacle(arg0); return(0); } 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); } }
/// <summary> /// Called upon "death" of transport to make it into "clutter" or "trash" on the map. /// Removable by companion explosion<see cref="OnDestroy"/>. /// </summary> private void MakeIntoObstacle() { _navMapRef.AddObstacle(_myObstacle); }