void Awake() { fpsi = (FPSInputController)FindObjectOfType(typeof(FPSInputController)); cc = (CharacterController)FindObjectOfType(typeof(CharacterController)); ml = (MouseLook)FindObjectOfType(typeof(MouseLook)); pc = (PlayerClicker)FindObjectOfType(typeof(PlayerClicker)); }
// Use this for initialization void Start() { if (keyCodes == null) { keyCodes = (KeyCode[])System.Enum.GetValues(typeof(KeyCode)); } var RH = (Equipment)Resources.Load("ProjectAssets/prefabs/RHand", typeof(Equipment)); var LH = (Equipment)Resources.Load("ProjectAssets/prefabs/LHand", typeof(Equipment)); //quickslots/equiptment equipmentHandler = gameObject.AddComponent <EquipmentHandler>(); equipmentHandler.RightHand = rightHand; equipmentHandler.LeftHand = leftHand; equipmentHandler.HandModelLeft = LH; equipmentHandler.HandModelRight = RH; waitingOnEquip = false; //hud hud = gameObject.AddComponent <HUD>(); hud.AddQuickItem(0, (Equipment)Resources.Load("ProjectAssets/prefabs/Flashlight", typeof(Equipment))); hud.AddQuickItem(1, (Equipment)Resources.Load("ProjectAssets/prefabs/SprayCan", typeof(Equipment))); hud.AddQuickItem(2, LH); hud.AddQuickItem(3, RH); hud.AddQuickItem(4, (Equipment)Resources.Load("ProjectAssets/prefabs/Aerosol_Can_2", typeof(Equipment))); //controllers _mouseLook = gameObject.AddComponent <MouseLook> (); _characterMotor = gameObject.AddComponent <CharacterMotor> (); _fpsController = gameObject.AddComponent <FPSInputController> (); }
void Update() { RaycastHit hit; bool isLookedAt = GetComponent <Collider>().Raycast(head.Gaze, out hit, Mathf.Infinity); // if looking at object for 2 seconds, enable/disable autowalk if (isLookedAt && Time.time > delay) { GameObject FPSController = GameObject.Find("Head"); FPSInputController autowalk = FPSController.GetComponent <FPSInputController>(); autowalk.checkAutoWalk = !autowalk.checkAutoWalk; delay = Time.time + 2.0f; } // currently looking at object else if (isLookedAt) { GetComponent <Renderer>().material.color = Color.yellow; } // not looking at object else if (!isLookedAt) { GetComponent <Renderer>().material.color = Color.red; delay = Time.time + 2.0f; } }
protected virtual void Awake() { agent = this.GetComponent <NavMeshAgent> (); player = GameObject.FindWithTag("Player"); motor = player.GetComponent <CharacterMotor> (); playerController = player.GetComponent <FPSInputController> (); playerLook = player.GetComponent <PlayerLook> (); playerHydraLook = player.GetComponent <HydraLook> (); playerHealth = player.GetComponent <PlayerHealth> (); playerSixenseHandControllers = player.GetComponentsInChildren <SixenseHandControllerExtender> (); leapGrabbable = GetComponent <LeapGrabbableExtender> (); startMarkerThrowPlayer = new GameObject(); endMarkerThrowPlayer = new GameObject(); startMarkerJump = new GameObject(); endMarkerJump = new GameObject(); spawnPosition = transform.position; spawnRotation = transform.rotation; defaultAnimationName = GetComponent <Animation>().clip.name; defaultHealth = health; defaultSpeed = agent.speed; defaultAngularSpeed = agent.angularSpeed; movement = Movement.Idle; defaultTag = gameObject.tag; }
// Use this for initialization void Start() { player = GameObject.Find("First Person Controller"); fps = player.GetComponent <FPSInputController>(); source = player.GetComponent <AudioSource>(); vignet = GameObject.Find("Vignet").renderer; }
void Awake() { fpsi=(FPSInputController)FindObjectOfType(typeof(FPSInputController)); cc=(CharacterController)FindObjectOfType(typeof(CharacterController)); ml=(MouseLook)FindObjectOfType(typeof(MouseLook)); pc = (PlayerClicker)FindObjectOfType(typeof(PlayerClicker)); }
// Token: 0x06000998 RID: 2456 RVA: 0x00040DF0 File Offset: 0x0003EFF0 private void _CacheScale() { GameObject gameObject = base.gameObject; this.originalLocalScale = gameObject.transform.localScale; FPSInputController component = gameObject.GetComponent <FPSInputController>(); this.crouchAmount = component.crouchAmount; this.runSpeed = component.runSpeed; this.walkSpeed = component.walkSpeed; CharacterMotor component2 = gameObject.GetComponent <CharacterMotor>(); this.jumpBaseHeight = component2.jumping.baseHeight; this.jumpExtraHeight = component2.jumping.extraHeight; this.gravity = component2.movement.gravity; this.maxGroundAcceleration = component2.movement.maxGroundAcceleration; this.maxAirAcceleration = component2.movement.maxAirAcceleration; CharacterController component3 = gameObject.GetComponent <CharacterController>(); this.stepOffset = component3.stepOffset; this.skinWidth = component3.skinWidth; PlayerMovementSoundController componentInChildren = gameObject.GetComponentInChildren <PlayerMovementSoundController>(); this.sizeRatio = componentInChildren.GetSizeRatio(); }
public static void AimAtVec3(this FPSInputController controller, Vector3 position) { var mouse = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y)); var target = position - mouse; var angle = Quaternion.LookRotation(target); controller.ResetViewAngle(angle); }
// Use this for initialization void Awake() { instance = this; Screen.lockCursor = true; mouseLookScripts = GameObject.FindGameObjectWithTag("Player").GetComponentsInChildren<MouseLook>(); inputController = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren<FPSInputController>(); LightSourceBehaviour.lightSources.Clear(); }
void Start() { if (m_data.isMainHero) { m_inputCtl = gameObject.AddComponent <FPSInputController>(); //transform.localScale = new Vector3(0.12f,0.12f,0.12f); //SetMainHero(); } }
protected void Resume() { Transform player = GameObject.FindGameObjectWithTag("Player").transform; GameObject menu = player.Find("Menu").gameObject; FPSInputController inputController = player.GetComponent <FPSInputController> (); menu.SetActive(false); inputController.enableMovement = true; }
void Awake() { controller = GetComponent <CharacterController>(); mLook = GetComponent <MouseLook>(); cMotor = GetComponent <CharacterMotor>(); fpsInputController = GetComponent <FPSInputController>(); spawnPoint = transform.position; spawnRotation = transform.rotation; myDirection = DIRECTION.NONE; }
// Use this for initialization void Start() { Screen.showCursor = false; playerObject = GameObject.FindWithTag("Player"); playerAudio = playerObject.GetComponent("AudioSource") as AudioSource; soundPlayer = GetComponent("SoundPlayer") as SoundPlayer; Student = playerObject.GetComponent("StudentModel") as StudentModel; newtonController = GameObject.Find("Newton").GetComponent("NewtonController") as NewtonController; FPSInput = playerObject.GetComponent("FPSInputController") as FPSInputController; }
public enum Positions { LAB=1, LEVEL1, LEVEL2, LEVEL3 }; // return "Level1", "Level2", Level3 or Main for lobby void Start() { state = States.LABINTRO; newtonPosition = Positions.LAB; fpsInput = GameObject.Find("Player").GetComponent("FPSInputController") as FPSInputController; consoleController = GameObject.Find("console").GetComponent("ConsoleController") as ConsoleController; gameController = GameObject.Find("Controller").GetComponent("GameController") as GameController; ramTrigger = GameObject.Find("ram").GetComponent("RamTrigger") as RamTrigger; Player = GameObject.Find("Player"); }
// Use this for initialization void Start() { characterMouseLook = GetComponent<MouseLook> (); mcamera = GameObject.Find("Main Camera").GetComponent<MouseLook> (); fpscontroller = GetComponent<FPSInputController> (); motion = GameObject.Find ("Arms").GetComponent<MotionScript> (); inventory = GameObject.Find ("Inventory").GetComponent<InventarScript> (); inventory.pausedTheGame (false); tutorial = GameObject.Find ("Tut").GetComponent<TutScript> (); }
void loadProblems() { FPSInputController json = GameObject.Find("Player").GetComponent("FPSInputController") as FPSInputController; TextAsset textFile = (TextAsset)Resources.Load("Level2Problems", typeof(TextAsset)); Hashtable[] parsed = (Hashtable[])json.parse(textFile.text); print(parsed.Length); foreach (Hashtable hash in parsed) { problemList.Add(Problem.deserialize(hash)); } }
private void Update() { #region FindingObjects if (ManagerPlayerOwner == null) { ManagerPlayerOwner = FindObjectOfType <NetworkEntityManagerPlayerOwner>(); } if (FpsInputController == null) { FpsInputController = FindObjectOfType <FPSInputController>(); } #endregion #region GUIKeys if (Input.GetKeyDown(KeyCode.Insert)) { BaseSettings.GetSettings.ShowEspMenu = !BaseSettings.GetSettings.ShowEspMenu; } #endregion #region Dodaj znajomych #endregion if (Input.GetMouseButton(1) && BaseSettings.GetSettings.AimBotSettings.IsEnabled) { if (_frameAimKey && Target != null) { HuamnAimbot(Target); } else { HuamnAimbot(); } } else { _frameAimKey = false; } if (Input.GetMouseButton(1)) { HuamnAimbot(); } }
protected void Start() { menu = transform.Find("Menu").gameObject; inputController = transform.GetComponent <FPSInputController> (); menu.SetActive(false); #if !UNITY_WEBPLAYER HMDPresent = OVRManager.display.isPresent; #else HMDPresent = false; #endif SetMenuPosition(); }
// Use this for initialization void Start() { mouseScript1 = player1.transform.gameObject.GetComponent <MouseLook>(); mouseCameraScript1 = camera1.transform.gameObject.GetComponent <MouseLook>(); moveScript1 = player1.transform.gameObject.GetComponent <FPSInputController>(); mouseScript2 = player2.transform.gameObject.GetComponent <MouseLook>(); mouseCameraScript2 = camera2.transform.gameObject.GetComponent <MouseLook>(); moveScript2 = player2.transform.gameObject.GetComponent <FPSInputController>(); pauseMenu.SetActive(false); paused = false; }
// Token: 0x06000117 RID: 279 RVA: 0x00014864 File Offset: 0x00012A64 public string GetVelocityString() { Vector3 velocity = this.motor.GetComponent <CharacterController>().velocity; return(string.Concat(new object[] { "Horizontal Velocity: ", FPSInputController.DoRound(Mathf.Sqrt(velocity.x * velocity.x + velocity.z * velocity.z)), " m/s \nVertical Velocity: ", FPSInputController.DoRound(velocity.y), " m/s" })); }
// Use this for initialization void Start() { mouseScript1 = player1.transform.gameObject.GetComponent<MouseLook>(); mouseCameraScript1 = camera1.transform.gameObject.GetComponent<MouseLook>(); moveScript1 = player1.transform.gameObject.GetComponent<FPSInputController>(); mouseScript2 = player2.transform.gameObject.GetComponent<MouseLook>(); mouseCameraScript2 = camera2.transform.gameObject.GetComponent<MouseLook>(); moveScript2 = player2.transform.gameObject.GetComponent<FPSInputController>(); pauseMenu.SetActive(false); paused = false; }
// Use this for initialization void Start() { if (!networkView.isMine) { this.gameObject.GetComponentInChildren <Camera>().enabled = false; this.gameObject.GetComponentInChildren <AudioListener>().enabled = false; CharacterMotor cm = (CharacterMotor)this.gameObject.GetComponent("CharacterMotor"); cm.enabled = false; MouseLook ml = (MouseLook)this.gameObject.GetComponent("MouseLook"); ml.enabled = false; FPSInputController fps = (FPSInputController)this.gameObject.GetComponent("FPSInputController"); fps.enabled = false; } }
// Use this for initialization void Awake() { movementScript = gameObject.GetComponent<CharacterMotor>(); mouseScript = gameObject.GetComponent<MouseLook>(); fpsScript = gameObject.GetComponent<FPSInputController>(); // Find the level manager object and script GameObject goLevelManager = GameObject.Find("Level Manager"); if(goLevelManager) { levelManagerScript = goLevelManager.GetComponent<LevelManager>(); } }
// Token: 0x0600011A RID: 282 RVA: 0x0001491C File Offset: 0x00012B1C public string GetPlayerRotationString() { Vector3 eulerAngles = this.motor.transform.localRotation.eulerAngles; return(string.Concat(new string[] { "Rotation: ", FPSInputController.DoRound(this.cameraObj.transform.rotation.eulerAngles.x), ", ", FPSInputController.DoRound(eulerAngles.y), ", ", FPSInputController.DoRound(eulerAngles.z) })); }
// Token: 0x06000116 RID: 278 RVA: 0x000147F8 File Offset: 0x000129F8 public string getLocationString() { Vector3 localPosition = this.motor.transform.localPosition; return(string.Concat(new object[] { "Position: ", FPSInputController.DoRound(localPosition.x), ", ", FPSInputController.DoRound(localPosition.y), ", ", FPSInputController.DoRound(localPosition.z) })); }
// Use this for initialization void Awake() { movementScript = gameObject.GetComponent <CharacterMotor>(); mouseScript = gameObject.GetComponent <MouseLook>(); fpsScript = gameObject.GetComponent <FPSInputController>(); // Find the level manager object and script GameObject goLevelManager = GameObject.Find("Level Manager"); if (goLevelManager) { levelManagerScript = goLevelManager.GetComponent <LevelManager>(); } }
void Update() { if (!magnetDetectionEnabled) { return; } if (Cardboard.SDK.CardboardTriggered) { GameObject FPSController = GameObject.Find("Head"); FPSInputController autowalk = FPSController.GetComponent <FPSInputController>(); autowalk.checkAutoWalk = !autowalk.checkAutoWalk; CardboardMagnetSensor.ResetClick(); } }
// Use this for initialization void Start() { mouseScript1 = player1.transform.gameObject.GetComponent<MouseLook>(); mouseCameraScript1 = camera1.transform.gameObject.GetComponent<MouseLook>(); moveScript1 = player1.transform.gameObject.GetComponent<FPSInputController>(); mouseScript2 = player2.transform.gameObject.GetComponent<MouseLook>(); mouseCameraScript2 = camera2.transform.gameObject.GetComponent<MouseLook>(); moveScript2 = player2.transform.gameObject.GetComponent<FPSInputController>(); redScore = 0; blueScore = 0; winnerDeclared = false; scoreLimit = 100; gameOverCamera.SetActive(false); gameOver.SetActive(false); winnerPanel.SetActive(false); }
// Use this for initialization void Start() { mouseScript1 = player1.transform.gameObject.GetComponent <MouseLook>(); mouseCameraScript1 = camera1.transform.gameObject.GetComponent <MouseLook>(); moveScript1 = player1.transform.gameObject.GetComponent <FPSInputController>(); mouseScript2 = player2.transform.gameObject.GetComponent <MouseLook>(); mouseCameraScript2 = camera2.transform.gameObject.GetComponent <MouseLook>(); moveScript2 = player2.transform.gameObject.GetComponent <FPSInputController>(); redScore = 0; blueScore = 0; winnerDeclared = false; scoreLimit = 100; gameOverCamera.SetActive(false); gameOver.SetActive(false); winnerPanel.SetActive(false); }
void Start() { //Grab a component and keep a reference to it cc = GetComponent <CharacterController> (); if (cc == null) { Debug.Log("No CharacterController found."); } rifleScript = gun.gameObject.GetComponent <Rifle>(); mouseScript = gameObject.GetComponent <MouseLook>(); mouseCameraScript = camera1.transform.gameObject.GetComponent <MouseLook>(); moveScript = gameObject.GetComponent <FPSInputController>(); try { if (mouseScript == null || mouseCameraScript == null || moveScript == null) { throw new ArgumentNullException("Missing scripts."); } } catch (ArgumentNullException e) { Debug.LogWarning(e.Message); } pauseMenu.SetActive(false); bulletsInClip = 30; bulletsRemaining = maxAmmo; playerHealth = 100; canFire = true; alive = true; doublePower = false; paused = false; invincible = false; healthSlider.value = playerHealth; SetAmmoText(); reloadText.SetActive(false); noAmmoText.SetActive(false); scoreScript = gameManager.GetComponent <GameManager>(); spawnScript = spawnManager.GetComponent <SpawnManager>(); if (gameObject.tag == "Player2") { team = "Red"; teamScore = scoreScript.redScore; gameObject.transform.position = redSpawn.position; } else { team = "Blue"; teamScore = scoreScript.blueScore; gameObject.transform.position = blueSpawn.position; } }
private void set_player_active(GameObject player, bool active) { FPSCamera fps_camera = player.GetComponent <FPSCamera>(); if (fps_camera != null) { fps_camera.enabled = active; } FPSMovement fps_movement = player.GetComponent <FPSMovement>(); if (fps_movement) { fps_movement.enabled = active; } player.transform.FindChild("camera").gameObject.SetActive(active); SeekerAttack seeker_attack = player.GetComponent <SeekerAttack>(); if (seeker_attack != null) { seeker_attack.enabled = active; } MouseLook mouse_look = player.GetComponent <MouseLook>(); if (mouse_look != null) { mouse_look.enabled = active; } CharacterMotor character_motor = player.GetComponent <CharacterMotor>(); if (character_motor != null) { character_motor.enabled = active; } FPSInputController fps_input_controller = player.GetComponent <FPSInputController>(); if (fps_input_controller != null) { fps_input_controller.enabled = active; } }
void Update() { gazeYPosition = head.Gaze.direction.y; GameObject FPSController = GameObject.Find("Head"); FPSInputController autowalk = FPSController.GetComponent <FPSInputController> (); // if looking at object for 2 seconds, enable/disable autowalk if (gazeYPosition < -.3 && !Interactable.interacting) { autowalk.checkAutoWalk = true; } else { autowalk.checkAutoWalk = false; } }
public void CreatePlayer(int player, GameObject spawn) { players[player - 1] = Instantiate(playerPrefab, spawn.transform.position, Quaternion.identity) as GameObject; FPSInputController controller = players[player - 1].GetComponent <FPSInputController>(); controller.horizontal = horizontal + player; controller.vertical = vertical + player; controller.jump = a + player; controller.attack = b + player; controller.shoot = x + player; controller.taunt = y + player; controller.run = rt + player; players[player - 1].transform.Find("Body").GetComponent <Animator>().runtimeAnimatorController = bodyControllers[player - 1]; players[player - 1].transform.Find("Arms").GetComponent <Animator>().runtimeAnimatorController = armControllers[player - 1]; players[player - 1].transform.Find("Legs").GetComponent <Animator>().runtimeAnimatorController = legControllers[player - 1]; }
// Use this for initialization void Start() { questionList = new ArrayList(); Controller = GameObject.Find("Controller").GetComponent("GameController") as GameController; FPSInputController json = GameObject.Find("Player").GetComponent("FPSInputController") as FPSInputController; TextAsset textFile = (TextAsset)Resources.Load(QuizName, typeof(TextAsset)); Hashtable[] parsed = (Hashtable[])json.parse(textFile.text); foreach (Hashtable hashQuest in parsed) { Question q = new Question(); q.question = (string)hashQuest["question"]; q.answers = (string[])hashQuest["answers"]; q.correctAnswer = (string)hashQuest["correct"]; q.hints = (string[])hashQuest["hints"]; questionList.Add(q); } }
protected void Death() { if (dead) { return; } dead = true; GetComponent <AudioSource>().clip = deathAudioClip; GetComponent <AudioSource>().Play(); FPSInputController playerInput = GetComponent <FPSInputController> (); if (playerInput) { playerInput.SetInputEnabled(false); } StartCoroutine(Respawn(respawnTime)); }
// Token: 0x0600099B RID: 2459 RVA: 0x00040F08 File Offset: 0x0003F108 public void Poke() { this._EnsureNearPlaneCached(); GameObject gameObject = base.gameObject; float num = gameObject.transform.localScale.x / this.originalLocalScale.x; FPSInputController component = gameObject.GetComponent <FPSInputController>(); component.crouchAmount = this.crouchAmount * num; component.runSpeed = this.runSpeed * num; component.walkSpeed = this.walkSpeed * num; CharacterMotor component2 = gameObject.GetComponent <CharacterMotor>(); component2.jumping.baseHeight = this.jumpBaseHeight * num; component2.jumping.extraHeight = this.jumpExtraHeight * num; component2.movement.gravity = this.gravity * num; component2.movement.maxGroundAcceleration = this.maxGroundAcceleration * num; component2.movement.maxAirAcceleration = this.maxAirAcceleration * num; CharacterController component3 = gameObject.GetComponent <CharacterController>(); component3.stepOffset = this.stepOffset * num; component3.skinWidth = this.skinWidth * num; GameManager.GM.playerCamera.nearClipPlane = this.nearPlane.Value * num; gameObject.GetComponentInChildren <PlayerMovementSoundController>().SetSizeRatio(this.sizeRatio * num); }
void Start() { state = States.LEVEL2; newtonPosition = Positions.LEVEL1; fpsInput = GameObject.Find("Player").GetComponent("FPSInputController") as FPSInputController; consoleController = GameObject.Find("console").GetComponent("ConsoleController") as ConsoleController; gameController = GameObject.Find("Controller").GetComponent("GameController") as GameController; ramTrigger = GameObject.Find("ram").GetComponent("RamTrigger") as RamTrigger; Player = GameObject.Find("Player"); }
/// <summary> /// Initializes the custom components. /// </summary> private void InitializeCustomComponents() { _thirdPersonController = personController.GetComponent<ThirdPersonController>(); _thirdPersonCameraController = personController.GetComponent<ThirdPersonCamera>(); _flyScan = personController.GetComponent<FlyScan>(); _characterMotor = personController.GetComponent<CharacterMotor>(); _fpsInputController = personController.GetComponent<FPSInputController>(); _rotationConstraint = eyesCamera.GetComponent<RotationConstraint>(); _myMouseLook = personController.GetComponent<MyMouseLook>(); }
void Start() { FPSInput = GetComponent<FPSInputController>(); inside = false; }
void Awake() { godInventory = GameObject.Find("GOD").GetComponent<PersistentInventory>(); playerInv = GameObject.FindWithTag("PlayerShip").GetComponent<PlayerInventory>(); player = GameObject.FindGameObjectWithTag("Player"); cameraMove = player.GetComponent<CameraMove>(); playerCharController = player.GetComponent<CharacterController>(); playerMotor = player.GetComponent<CharacterMotor>(); playerFPS = player.GetComponent<FPSInputController>(); playerMouseLook = player.GetComponent<MouseLook>(); }
void Awake() { controller = GetComponent<CharacterController>(); mLook = GetComponent<MouseLook>(); cMotor = GetComponent<CharacterMotor>(); fpsInputController = GetComponent<FPSInputController>(); spawnPoint = transform.position; spawnRotation = transform.rotation; myDirection = DIRECTION.NONE; }
void Start () { pMot = GetComponent<CharacterMotor> (); pInput = GetComponent<FPSInputController> (); pMov = pMot.movement; }
void Start() { //Grab a component and keep a reference to it cc = GetComponent<CharacterController> (); if (cc == null) { Debug.Log ("No CharacterController found."); } rifleScript = gun.gameObject.GetComponent<Rifle>(); mouseScript = gameObject.GetComponent<MouseLook>(); mouseCameraScript = camera1.transform.gameObject.GetComponent<MouseLook>(); moveScript = gameObject.GetComponent<FPSInputController>(); try { if (mouseScript == null || mouseCameraScript == null || moveScript == null) { throw new ArgumentNullException("Missing scripts."); } } catch (ArgumentNullException e) { Debug.LogWarning(e.Message); } pauseMenu.SetActive(false); bulletsInClip = 30; bulletsRemaining = maxAmmo; playerHealth = 100; canFire = true; alive = true; doublePower = false; paused = false; invincible = false; healthSlider.value = playerHealth; SetAmmoText(); reloadText.SetActive(false); noAmmoText.SetActive(false); scoreScript = gameManager.GetComponent<GameManager>(); spawnScript = spawnManager.GetComponent<SpawnManager>(); if (gameObject.tag == "Player2") { team = "Red"; teamScore = scoreScript.redScore; gameObject.transform.position = redSpawn.position; } else { team = "Blue"; teamScore = scoreScript.blueScore; gameObject.transform.position = blueSpawn.position; } }