private void Start() { photonview = this.transform.GetChild(0).GetComponent <PhotonView>(); PlayerObj.SetActive(true); //rvocontroller = GetComponentInChildren<Pathfinding.RVO.RVOController>(); seeker = GetComponentInChildren <Pathfinding.Seeker>(); aipath = GetComponentInChildren <Pathfinding.AIPath>(); funnelmodifier = GetComponentInChildren <Pathfinding.FunnelModifier>(); aidestinatonsetter = GetComponentInChildren <Pathfinding.AIDestinationSetter>(); playermouse = GetComponentInChildren <PlayerMouse>(); rigidbody = GetComponentInChildren <Rigidbody>(); WarFog = PlayerObj.GetComponent <FogOfWarEntity>(); forminimap = transform.GetChild(2).gameObject; astar_target = transform.GetChild(1).gameObject; splatmanager = transform.GetChild(0).GetChild(0).gameObject; rigidbody.isKinematic = true; WarFog.enabled = false; if (photonView.isMine) { PlayerObj.name = gameObject.name + "_" + PhotonNetwork.player.NickName; } else { PlayerObj.name = gameObject.name + photonView.owner.NickName; } SceneManager.activeSceneChanged += SceneLoaded; DontDestroyOnLoad(this); }
public override void Apply(Path p) { List<GraphNode> path = p.path; List<Vector3> vectorPath = p.vectorPath; if (path == null || path.Count == 0 || vectorPath == null || vectorPath.Count != path.Count) { return; } List<Vector3> list = ListPool<Vector3>.Claim(); List<Vector3> list2 = ListPool<Vector3>.Claim(path.Count + 1); List<Vector3> list3 = ListPool<Vector3>.Claim(path.Count + 1); list2.Add(vectorPath[0]); list3.Add(vectorPath[0]); for (int i = 0; i < path.Count - 1; i++) { if (!path[i].GetPortal(path[i + 1], list2, list3, false)) { list2.Add((Vector3)path[i].position); list3.Add((Vector3)path[i].position); list2.Add((Vector3)path[i + 1].position); list3.Add((Vector3)path[i + 1].position); } } list2.Add(vectorPath[vectorPath.Count - 1]); list3.Add(vectorPath[vectorPath.Count - 1]); if (!FunnelModifier.RunFunnel(list2, list3, list)) { list.Add(vectorPath[0]); list.Add(vectorPath[vectorPath.Count - 1]); } ListPool<Vector3>.Release(p.vectorPath); p.vectorPath = list; ListPool<Vector3>.Release(list2); ListPool<Vector3>.Release(list3); }