/// <summary> /// 初始化剧情 /// </summary> public void InitStroy() { Vector3 target = Vector3.zero; Bounds bounds = Edge.Instance.Range; bounds.size -= new Vector3(30, 30, 0); float offset = 114; while (true) { target = m_Shoal.transform.position + new Vector3(0, offset, 0); if (bounds.Contains(target)) { break; } target = m_Shoal.transform.position + new Vector3(offset, 0, 0); if (bounds.Contains(target)) { break; } target = m_Shoal.transform.position + new Vector3(-offset, 0, 0); if (bounds.Contains(target)) { break; } target = m_Shoal.transform.position + new Vector3(0, -offset, 0); if (bounds.Contains(target)) { break; } break; } transform.position = target; m_Shoal.Move(0, 0); }
private void FixedUpdate() { if (m_IsCloseInput) { return; } float xMove = CrossPlatformInputManager.GetAxis("Horizontal"); float yMove = CrossPlatformInputManager.GetAxis("Vertical"); m_Character.Move(xMove, yMove); if (Input.GetKey(KeyCode.Alpha1)) { m_Character.SwitchFish(Shoal.FishEnum.Speed); } else if (Input.GetKey(KeyCode.Alpha2)) { m_Character.SwitchFish(Shoal.FishEnum.Hide); } else if (Input.GetKey(KeyCode.Alpha3)) { m_Character.SwitchFish(Shoal.FishEnum.GreatlyVision); } }