public void Start() { _race = transform.parent.GetComponent<Barrack>().getRace(); _collider = GetComponent<SphereCollider>(); _collider.radius = 0; _status = Status.CLOSE; _animator = transform.parent.GetComponent<Animator>(); transform.parent.GetComponent<Barrack>().register(Barrack.Actions.BUILDING_FINISHED, OnBuildingFinished); _blocking_gate = transform.parent.GetComponent<DetourFlag>(); }
public void AddAreaFlags(DetourFlag flag) { Assert.IsTrue(_tileCacheHandle.Handle.ToInt64() != 0); Assert.IsTrue(DetourCrowd.Instance.CrowdHandle.Handle.ToInt64() != 0); Vector3[] flagVertices = flag.Vertices(); float[] vertices = { flagVertices[0].x, flagVertices[0].y - 3.0f, flagVertices[0].z, flagVertices[1].x, flagVertices[1].y - 3.0f, flagVertices[1].z, flagVertices[2].x, flagVertices[2].y - 3.0f, flagVertices[2].z, flagVertices[3].x, flagVertices[3].y - 3.0f, flagVertices[3].z, }; Debug.Log("Setting flags " + flag.Flags); flag.ID = addAreaFlags(_tileCacheHandle.Handle, DetourCrowd.Instance.CrowdHandle.Handle, flag.Center.ToFloat(), vertices, 4, flag.Size.y, flag.Flags); }
public void RemoveAreaFlag(DetourFlag flag) { Assert.IsTrue(_tileCacheHandle.Handle.ToInt64() != 0); removeAreaFlags(_tileCacheHandle.Handle, flag.ID); }