IEnumerator StartingWall_Off() { yield return(new WaitForSeconds(WaitingT)); for (int i = 0; i < StartingWall.transform.childCount - 1; i++) { Destroy(StartingWall); StartingWall.GetComponentInChildren <Pathfinding.NavmeshCut>().enabled = false; } Destroy(Logo); Invoke("Annoucement", 3f); PhotonNetwork.automaticallySyncScene = false; // 로딩이끝나면 카메라를 다시 나에게로 돌려줌 if (PhotonNetwork.player.GetTeam().ToString().Equals("red")) { foreach (GameObject go in redTeamPlayer) { if (go.GetPhotonView().owner.Equals(PhotonNetwork.player)) { mainCam.SetTarget(go.transform); break; } } } else { foreach (GameObject go in blueTeamPlayer) { if (go.GetPhotonView().owner.Equals(PhotonNetwork.player)) { mainCam.SetTarget(go.transform); break; } } } yield return(new WaitForSeconds(2.0f)); mainCam.ResetTarget(); yield return(null); }
// Update is called once per frame void Update() { if (Input.GetKeyUp(KeyCode.E)) { editMode = !editMode; if (editMode) { modoActual.text = "Modo Editar"; } else { modoActual.text = "Modo Mover"; } } if (Input.GetKeyUp(KeyCode.H)) { instrucciones.SetActive(!instrucciones.gameObject.active); } if (Input.GetKeyUp(KeyCode.R)) { camara.ResetTarget(); Informacion.text = "NULL"; Informacion.color = Color.white; Informacion.GetComponentInParent <UnityEngine.UI.Image>().color = Color.black; unidadActual = null; diagnostico.text = ""; } if (Input.GetKeyUp(KeyCode.Q)) { reiniciaMapa(); } if (Input.GetKey(KeyCode.Escape)) { Application.Quit(); } }
//타겟팅 점화, 강타, private void Update() { if (isInGameScene) { if (chat.chatInput.IsActive()) { return; } if (isIgniteClick) { if (isSmiteClick || isTeleportClick || Input.GetMouseButton(1)) { cursor.SetCursor(0, Vector2.zero); isIgniteClick = false; splatmanager.Cancel(); return; } else if (Input.GetMouseButtonDown(0)) { splatmanager.Cancel(); isIgniteClick = false; Ignite(); cursor.SetCursor(0, Vector2.zero); } } if (isSmiteClick) { if (isIgniteClick || isTeleportClick || Input.GetMouseButton(1)) { cursor.SetCursor(0, Vector2.zero); isSmiteClick = false; splatmanager.Cancel(); return; } else if (Input.GetMouseButtonDown(0)) { splatmanager.Cancel(); isSmiteClick = false; Smite(); cursor.SetCursor(0, Vector2.zero); } } if (isTeleportClick) { if (isIgniteClick || isSmiteClick || Input.GetMouseButton(1)) { cursor.SetCursor(0, Vector2.zero); isTeleportClick = false; return; } else if (Input.GetMouseButtonDown(0)) { TeleportDestinationSet(); isTeleportClick = false; cursor.SetCursor(0, Vector2.zero); } } } if (isIgnite) { ImOnFire = true; IgnteTime += Time.deltaTime; if (IgnteTime >= 1.0f) { IgnteTime = 0; IgnteDam += Mathf.FloorToInt(55 + (25 * Attackerlevel)) / 5; if (mybehav.HitMe((float)Mathf.FloorToInt(55 + (25 * Attackerlevel)) / 5, "FD", IgniteAtker, IgniteAtker.gameObject.name)) { if (ImOnFire) { ImOnFire = false; IgnteTime = 0; IgnteDam = 0; ChampionData chdata = IgniteAtker.GetComponent <ChampionData>(); chdata.Kill_CS_Gold_Exp("", 0, this.transform.position); } } } if (IgnteDam >= Mathf.FloorToInt(55 + (25 * Attackerlevel))) { IgnteDam = 0; IgnteTime = 0; isIgnite = false; } } if (isTeleportDestSet)//목표 설정후에 { if (!Once) { curhp = ChampData.totalstat.Hp; Once = true; SendEffect("Teleport", Player.transform.position, team, photonview.viewID); Ping.GetFxPool("Going", TeleportDestPos, false); if (Target.GetComponent <PhotonView>() != null) { SendEffect("Teleport", Target.transform.position, team, photonview.viewID); } else { SendEffect("Teleport", Target.transform.position, team); } AIPath.isStopped = true; if (Target.transform.name.Contains("Minion")) { Target.GetComponent <Pathfinding.AIPath>().isStopped = true; } } TeleportTime -= Time.deltaTime; if (curhp > ChampData.totalstat.Hp) { if (fog.Count > 0) { for (int i = 0; i < fog.Count; i++) { fog[i].stopParticle(); } } fog.Clear(); cursor.SetCursor(cursor.PreCursor, Vector2.zero); isTeleportDestSet = false; TeleportTime = 4.5f; Once = false; cam.ResetTarget(); AIPath.isStopped = false; if (Target.transform.name.Contains("Minion")) { Target.GetComponent <Pathfinding.AIPath>().isStopped = false; } return; } else if (Input.GetKeyDown(KeyCode.D)) { if (fog.Count > 0) { for (int i = 0; i < fog.Count; i++) { fog[i].stopParticle(); } } fog.Clear(); cursor.SetCursor(cursor.PreCursor, Vector2.zero); if (Spell_D == 6) { ChampData.current_Cooldown_D = 1; } else if (Spell_F == 6) { ChampData.current_Cooldown_F = 1; } isTeleportDestSet = false; TeleportTime = 4.5f; Once = false; cam.ResetTarget(); cursor.SetCursor(0, Vector3.zero); AIPath.isStopped = false; if (Target.transform.name.Contains("Minion")) { Target.GetComponent <Pathfinding.AIPath>().isStopped = false; } return; } else if (TeleportTime <= 0) { cam.SetTarget(Player.transform); TeleportTime = 4.5f; TeleportDestPos.y = Player.transform.position.y; Player.transform.position = TeleportDestPos; //AstarTarget.transform.position = Player.transform.position; isTeleportDestSet = false; Once = false; Invoke("TeleportEnd", 0.5f); } } if (isGhost) //유체화 켜졌을때 { if (!aiPath) { return; } GhostAcceleration -= Time.deltaTime; if (GhostAcceleration >= 8.0f) { MaxSpeed = aiPath.maxSpeed + (aiPath.maxSpeed * (0.27f + (0.01f * (float)Playerlevel))); aiPath.maxSpeed += (aiPath.maxSpeed * (0.27f + (0.01f * Playerlevel))) * Time.deltaTime; if (aiPath.maxSpeed >= MaxSpeed) { aiPath.maxSpeed = MaxSpeed; } //27% + (1% * level) } if (GhostAcceleration <= 0) { Ghost(false); } } if (Input.GetKeyDown(KeyCode.J)) { ChampData.current_Cooldown_D = 1; ChampData.current_Cooldown_F = 1; } }
private void TeleportCheck() { if (isTeleportClick) //텔레포트 시전 { if (isIgniteClick || isSmiteClick || Input.GetMouseButton(1)) { cursor.SetCursor(0, Vector2.zero); isTeleportClick = false; return; } else if (Input.GetMouseButtonDown(0)) { TeleportDestinationSet(); isTeleportClick = false; cursor.SetCursor(0, Vector2.zero); } } if (isTeleportDestSet)//목표 설정후에 { if (!TeleportingOnce) { curhp = ChampData.totalstat.Hp; TeleportingOnce = true; SendEffect("Teleport", Player.transform.position, team, photonview.viewID); Ping.GetFxPool("Going", TeleportDestPos, false); if (Target.GetComponent <PhotonView>() != null) { SendEffect("Teleport", Target.transform.position, team, photonview.viewID); } else { SendEffect("Teleport", Target.transform.position, team); } AIPath.isStopped = true; if (Target.transform.name.Contains("Minion")) { Target.GetComponent <Pathfinding.AIPath>().isStopped = true; } } TeleportTime -= Time.deltaTime; if (curhp > ChampData.totalstat.Hp) { if (fog.Count > 0) { for (int i = 0; i < fog.Count; i++) { if (fog[i].gameObject.GetActive()) { fog[i].stopParticle(); } } } fog.Clear(); cursor.SetCursor(cursor.PreCursor, Vector2.zero); isTeleportDestSet = false; TeleportTime = 4.5f; TeleportingOnce = false; cam.ResetTarget(); AIPath.isStopped = false; if (Target.transform.name.Contains("Minion")) { Target.GetComponent <Pathfinding.AIPath>().isStopped = false; } return; } else if (Input.GetKeyDown(KeyCode.D)) { if (fog.Count > 0) { for (int i = 0; i < fog.Count; i++) { if (fog[i].gameObject.GetActive()) { fog[i].stopParticle(); } } } fog.Clear(); cursor.SetCursor(cursor.PreCursor, Vector2.zero); if (Spell_D == 6) { ChampData.current_Cooldown_D = 1; } else if (Spell_F == 6) { ChampData.current_Cooldown_F = 1; } isTeleportDestSet = false; TeleportTime = 4.5f; TeleportingOnce = false; cam.ResetTarget(); cursor.SetCursor(0, Vector3.zero); AIPath.isStopped = false; if (Target.transform.name.Contains("Minion")) { Target.GetComponent <Pathfinding.AIPath>().isStopped = false; } return; } else if (TeleportTime <= 0) { cam.SetTarget(Player.transform); TeleportTime = 4.5f; TeleportDestPos.y = Player.transform.position.y; Player.transform.position = TeleportDestPos; //AstarTarget.transform.position = Player.transform.position; isTeleportDestSet = false; TeleportingOnce = false; Invoke("TeleportEnd", 0.5f); } } }