public void HandleCommand(TwitchCommandData data) { Panzee panzee = null; PanzeeManager.Instance.panzeeDict.TryGetValue(data.Author, out panzee); if (panzee != null) { panzee.SetCommand(Panzee.Command.Stop); } }
public void HandleCommand(TwitchCommandData data) { Panzee panzee = null; PanzeeManager.Instance.panzeeDict.TryGetValue(data.Author, out panzee); if (panzee != null) { bool success = float.TryParse(data.Message.Substring(0 + (TwitchCommands.CmdPrefix + TwitchCommands.CmdRight).Length).TrimStart(' '), out panzee.cmdTimer); if (!success) { panzee.cmdTimer = 9999; } panzee.SetCommand(Panzee.Command.Right); } }
private void Update() { if (!isDebug) { return; } if (Input.GetKeyDown(KeyCode.P)) { if (!Input.GetKey(KeyCode.LeftShift)) { Debug.Log("DEBUG:Spawn UNKNOWN Panzee"); for (int i = 0; i < PanzeeManager.Instance.panzeeArray.Length - 1; i++) { Panzee panzee = PanzeeManager.Instance.panzeeArray[i]; if (panzee == null) { PanzeeManager.Instance.SpawnPanzee(); break; } } } else { Debug.Log("DEBUG:Remove Last Panzee"); for (int i = PanzeeManager.Instance.panzeeArray.Length - 1; i >= 0; i--) { if (PanzeeManager.Instance.panzeeArray[i] != null) { PanzeeManager.Instance.panzeeArray[i].Damage(9999); break; } } } } if (Wakta.Instance.selected != null && !Wakta.Instance.selected.Equals(Wakta.Instance)) { Panzee panzee = (Wakta.Instance.selected as MonoBehaviour).GetComponent <Panzee>(); panzee.cmdTimer = 9999; if (Input.GetKeyDown(KeyCode.A)) { panzee.SetCommand(!Input.GetKey(KeyCode.RightShift) ? Panzee.Command.Left : Panzee.Command.LeftRun); } else if (Input.GetKeyDown(KeyCode.D)) { panzee.SetCommand(!Input.GetKey(KeyCode.RightShift) ? Panzee.Command.Right : Panzee.Command.RightRun); } else if (Input.GetKeyDown(KeyCode.W)) { if (Input.GetKey(KeyCode.RightShift)) { panzee.jumpTimerSet = 0.5f; panzee.SetCommand(Panzee.Command.JumpAuto); } else { panzee.jumpTimer = 0; panzee.jumpTimerSet = 9999; panzee.SetCommand(Panzee.Command.Jump); } } else if (Input.GetKeyDown(KeyCode.S)) { if (Input.GetKey(KeyCode.RightShift)) { panzee.cmdTimer = 1; } panzee.SetCommand(Panzee.Command.Stop); } else if (Input.GetKeyDown(KeyCode.Q)) { panzee.cmdTimer = 9999; panzee.SetCommand(!Input.GetKey(KeyCode.RightShift) ? Panzee.Command.LeftJump : Panzee.Command.LeftJumpRun); } else if (Input.GetKeyDown(KeyCode.E)) { panzee.cmdTimer = 9999; panzee.SetCommand(!Input.GetKey(KeyCode.RightShift) ? Panzee.Command.RightJump : Panzee.Command.RightJumpRun); } if (Input.GetKeyDown(KeyCode.T)) { panzee.SetText("채팅 테스트"); } } }
private IEnumerator Start() { yield return(null); PanzeeManager.Instance.AddPanzee("yangkiru", yangkiru); yangkiru.cmdTimer = 0.01f; yangkiru.SetCommand(Panzee.Command.Left); yangkiru.SetText("이번엔 팬치들의 다양한 동작을 알려줄게"); yield return(wait3); yangkiru.jumpTimer = 0; yangkiru.jumpTimerSet = 9999; yangkiru.SetText("!w를 입력하면 점프할 수 있고"); yield return(wait4); yangkiru.jumpTimer = 0; yangkiru.jumpTimerSet = 0; yangkiru.SetText("!W를 입력하면 계속 점프할 수 있어"); yield return(wait4); yangkiru.SetCommand(Panzee.Command.Stop); yield return(wait3); yangkiru.cmdTimer = 9999; yangkiru.SetCommand(Panzee.Command.RightJump); yangkiru.SetText("!q나 !e를 입력하면 좌우로 점프 할 수 있어"); yield return(wait4); yangkiru.SetCommand(Panzee.Command.Stop); yangkiru.SetText("!s를 입력하면 멈출 수 있어"); yield return(wait4); yangkiru.cmdTimer = 2.5f; yangkiru.SetCommand(Panzee.Command.Left); yangkiru.SetText("!a 2.5 같이 숫자와 함께 이동 명령을 내리면"); yield return(wait4); yangkiru.SetText("그만큼만 움직이고 멈춰"); yield return(wait3); yangkiru.jumpTimer = 3; yangkiru.jumpTimerSet = 9999; yangkiru.SetCommand(Panzee.Command.Jump); yangkiru.SetText("!w 3 같이 숫자와 함께 점프 명령을 내리면"); yield return(wait4); yangkiru.SetText("그만큼 기다렸다가 점프를 해"); yield return(wait3); yangkiru.jumpTimer = 0; yangkiru.jumpTimerSet = 2; yangkiru.SetCommand(Panzee.Command.JumpAuto); yangkiru.SetText("!W 2 같이 숫자와 함께 점프 반복 명령을 내리면"); yield return(wait4); yangkiru.SetText("그만큼의 공백을 갖고 점프를 해"); yield return(wait3); yangkiru.SetText("!q나 !e를 숫자와 함께 명령을 내리면"); yangkiru.cmdTimer = 3f; yangkiru.SetCommand(Panzee.Command.LeftJump); yield return(wait4); yangkiru.SetText("이동으로 간주해서, 그만큼 이동하고 멈춰"); yield return(wait4); yangkiru.SetText("자세한 조작법은 로딩 씬에 적혀있어"); yield return(wait4); yangkiru.SetText("형, 이제 팬치를 조련하는 법을 알려줄게"); yield return(wait3); yangkiru.SetText("날 포커싱하고 연결해봐"); yangkiru.keyButton.transform.parent.gameObject.SetActive(true); while (!yangkiru.joint.enabled) { yield return(null); } yield return(wait1); yangkiru.SetText("연결한 상태에서 스페이스 바를 눌러봐"); while (!Input.GetKeyDown(KeyCode.Space)) { yield return(null); } yield return(wait3); yangkiru.SetText("연결 안 해도 때릴 수 있긴 해"); yield return(wait3); yangkiru.SetText("팬돌프는 최대 5번까지 맞을 수 있고"); yield return(wait4); yangkiru.SetText("형은 A와 D를 눌러서 팬치가 날아갈 방향을 정할 수 있어"); yield return(wait4); yangkiru.SetText("날 때려서 반대편으로 날려봐"); }
private void ReadChat() { if (twitchClient.Available > 0) { readedChat.text = (++readed).ToString(); var message = reader.ReadLine(); if (message.Contains("PRIVMSG")) { Panzee panzee = null; var splitPoint = message.IndexOf("!", 1); var chatName = message.Substring(1, splitPoint - 1); PanzeeManager.Instance.panzeeDict.TryGetValue(chatName, out panzee); splitPoint = message.IndexOf(":", 1); message = message.Substring(splitPoint + 1); if (chatName.CompareTo("yangkiru") == 0) { PanzeeManager.Instance.panzeeDict.TryGetValue(chatName, out panzee); if (panzee == null) { splitPoint = message.IndexOf(":", 1); var temp = message.Substring(splitPoint + 1); Join(chatName, temp); } } if (panzee != null && message[0].CompareTo('!') == 0) { char command = message[1]; message = message.Substring(2); bool success; switch (command) { case 'd': success = float.TryParse(message.TrimStart(' '), out panzee.cmdTimer); if (!success) { panzee.cmdTimer = 9999; } panzee.SetCommand(Panzee.Command.Right); return; case 'D': success = float.TryParse(message.TrimStart(' '), out panzee.cmdTimer); if (!success) { panzee.cmdTimer = 9999; } panzee.SetCommand(Panzee.Command.RightRun); return; case 'a': success = float.TryParse(message.TrimStart(' '), out panzee.cmdTimer); if (!success) { panzee.cmdTimer = 9999; } panzee.SetCommand(Panzee.Command.Left); return; case 'A': success = float.TryParse(message.TrimStart(' '), out panzee.cmdTimer); if (!success) { panzee.cmdTimer = 9999; } panzee.SetCommand(Panzee.Command.LeftRun); return; case 'w': success = float.TryParse(message.TrimStart(' '), out panzee.jumpTimer); if (!success) { panzee.jumpTimer = 0; } panzee.jumpTimerSet = 9999; panzee.SetCommand(Panzee.Command.Jump); return; case 'W': success = float.TryParse(message.TrimStart(' '), out panzee.jumpTimerSet); if (!success) { panzee.jumpTimerSet = 0.5f; } panzee.jumpTimer = 0; panzee.SetCommand(Panzee.Command.JumpAuto); return; case 's': case 'S': panzee.SetCommand(Panzee.Command.Wait); return; case 'q': success = float.TryParse(message.TrimStart(' '), out panzee.cmdTimer); if (!success) { panzee.cmdTimer = 9999; } panzee.jumpTimer = 0; panzee.jumpTimerSet = 9999; panzee.SetCommand(Panzee.Command.LeftJump); return; case 'Q': success = float.TryParse(message.TrimStart(' '), out panzee.cmdTimer); if (!success) { panzee.cmdTimer = 9999; } panzee.jumpTimer = 0; panzee.jumpTimerSet = 9999; panzee.SetCommand(Panzee.Command.LeftJumpRun); return; case 'e': success = float.TryParse(message.TrimStart(' '), out panzee.cmdTimer); if (!success) { panzee.cmdTimer = 9999; } panzee.jumpTimer = 0; panzee.jumpTimerSet = 9999; panzee.SetCommand(Panzee.Command.RightJump); return; case 'E': success = float.TryParse(message.TrimStart(' '), out panzee.cmdTimer); if (!success) { panzee.cmdTimer = 9999; } panzee.jumpTimer = 0; panzee.jumpTimerSet = 9999; panzee.SetCommand(Panzee.Command.RightJumpRun); return; default: message = string.Format("{0}은/는 명령어를 칠 줄 몰라요!", chatName); break; } if (message.CompareTo(string.Empty) != 0) { panzee.SetText(message); } } else if (panzee != null) { panzee.SetText(message); } else if (PanzeeManager.Instance.panzeeDict.Count - (PanzeeManager.Instance.panzeeArray[5] != null ? 1 : 0) < 5) { Join(chatName, message); } } } }
private IEnumerator Start() { PanzeeManager.Instance.AddPanzee("yangkiru", yangkiru); CameraManager.Instance.cineGroup.AddMember(house.transform, 1f, 3f); // 튜토리얼 끝날 때 빼줘야함 CameraManager.Instance.cineGroup.AddMember(btn.transform, 1f, 3f); // 튜토리얼 끝날 때 빼줘야함 yangkiru.SetCommand(Panzee.Command.LeftJump); yield return(wait1); yangkiru.SetCommand(Panzee.Command.Stop); yangkiru.SetText("팬돌프들 집중!!"); for (int i = 0; i < tutorialTalk.Length; i++) { yield return(wait3); yangkiru.SetText(tutorialTalk[i]); } while (!(Input.GetKeyDown(KeyCode.KeypadMinus) || Input.GetKeyDown(KeyCode.KeypadPlus) || Input.GetKeyDown(KeyCode.Minus) || Input.GetKeyDown(KeyCode.Equals))) { yield return(null); } yangkiru.SetText("이제 내 밑에 있는 숫자키 눌러볼래?"); yangkiru.keyButton.transform.parent.gameObject.SetActive(true); while (!Input.GetKeyDown(KeyCode.Alpha6)) { yield return(null); } yangkiru.SetText("이렇게 팬치 밑에 있는 숫자 버튼을 누르면"); yield return(wait3); yangkiru.SetText("해당 팬치를 포커싱 할 수 있어"); yield return(wait3); yangkiru.SetText("이제 포커싱한 채로 왼쪽 쉬프트 키를 눌러볼래?"); while (!Input.GetKeyDown(KeyCode.LeftShift) || Wakta.Instance.selected == null) { yield return(null); } yield return(wait1); yangkiru.SetText("왁타는 팬치를 포커싱하고 왼쪽 쉬프트를 누르면"); yield return(wait3); yangkiru.SetText("팬돌프와 연결되어서 이동할 수 있어"); yield return(wait3); CameraManager.Instance.Focus(house.transform); yangkiru.SetText("집의 문이 열렸을 때 왁타가 집에 도착하면"); yield return(wait3); yangkiru.SetText("다음 스테이지로 넘어갈 수 있어"); yield return(wait3); yangkiru.SetText("그리고 누군가가 버튼을 누르면 문이 열려"); CameraManager.Instance.Focus(btn.transform); yield return(wait3); yangkiru.SetText("팬돌프들은 !a !d로 좌우로 움직일 수 있어"); yangkiru.SetCommand(Panzee.Command.Left); while (!btn.IsPush) { yield return(null); } CameraManager.Instance.FocusOut(); yangkiru.SetText("형을 집으로 데려가줄게!"); yield return(wait2); yangkiru.SetCommand(Panzee.Command.RightRun); yangkiru.SetText("팬돌프들은 !A !D로 빨리 갈 수 있어"); CameraManager.Instance.cineGroup.RemoveMember(house.transform); CameraManager.Instance.cineGroup.RemoveMember(btn.transform); }