protected void HadleInputs() { Vertical = Input.GetAxis("Vertical"); Horizontal = Input.GetAxis("Horizontal"); HorizonalMouse = Input.GetAxis("Mouse X"); VerticalMouse = Input.GetAxis("Mouse Y"); if (Input.GetKey(KeyCode.LeftShift)) { PressShift?.Invoke(); } if (Input.GetKey(KeyCode.E)) { StartAction?.Invoke(true); } if (Input.GetMouseButton(0)) { FireMachineGun?.Invoke(); } if (Input.GetMouseButton(1)) { FireRocket?.Invoke(); } }
private void BotControlled() { if (gameObject.GetComponent("GUIPlayer")) { Destroy(gameObject.GetComponent("GUIPlayer")); } fireRocketData = hatchControl.AddComponent("LaunchRocket") as LaunchRocket; fireShellData = gun.AddComponent("LaunchShell") as LaunchShell; movement = gameObject.AddComponent("SetPosition") as SetPosition; positionCursorData = gunShieldControl.AddComponent("SetCursor") as SetCursor; lazerDetectorData = GameObject.Find(user + "Lazer").AddComponent("LazerDetector") as LazerDetector; gameObject.tag = "Bot"; }
private void PlayerControlled() { gameObject.tag = "Player"; //Player Modules if (!gameObject.GetComponent("GUIPlayer")) { playerGUI = gameObject.AddComponent("GUIPlayer") as GUIPlayer; } if (!gameObject.GetComponent("GUITexture")) { playerGuiTexture = gameObject.AddComponent("GUITexture") as GUITexture; } fireRocketData = hatchControl.AddComponent("PlayerLaunchRocket") as PlayerLaunchRocket; fireShellData = gun.AddComponent("PlayerLaunchShell") as PlayerLaunchShell; movement = gameObject.AddComponent("PlayerMovement") as PlayerMovement; positionCursorData = gunShieldControl.AddComponent("FollowCursor") as FollowCursor; AudioListener playerAudioListener = gameObject.AddComponent("AudioListener") as AudioListener; }
private void BotControlled() { if(gameObject.GetComponent("GUIPlayer")) { Destroy(gameObject.GetComponent("GUIPlayer")); } fireRocketData = hatchControl.AddComponent("LaunchRocket") as LaunchRocket; fireShellData = gun.AddComponent("LaunchShell") as LaunchShell; movement = gameObject.AddComponent("SetPosition") as SetPosition; positionCursorData = gunShieldControl.AddComponent("SetCursor") as SetCursor; lazerDetectorData = GameObject.Find(user + "Lazer").AddComponent("LazerDetector") as LazerDetector; gameObject.tag = "Bot"; }
private void PlayerControlled() { gameObject.tag = "Player"; //Player Modules if(!gameObject.GetComponent("GUIPlayer")) { playerGUI = gameObject.AddComponent("GUIPlayer") as GUIPlayer; } if(!gameObject.GetComponent("GUITexture")) { playerGuiTexture = gameObject.AddComponent("GUITexture") as GUITexture; } fireRocketData = hatchControl.AddComponent("PlayerLaunchRocket") as PlayerLaunchRocket; fireShellData = gun.AddComponent("PlayerLaunchShell") as PlayerLaunchShell; movement = gameObject.AddComponent("PlayerMovement") as PlayerMovement; positionCursorData = gunShieldControl.AddComponent("FollowCursor") as FollowCursor; AudioListener playerAudioListener = gameObject.AddComponent("AudioListener") as AudioListener; }