// Use this for initialization void Start() { mouseLookX = GetComponent <MouseLook>(); mouseLookY = gameObject.GetComponentInChildren <Camera>().GetComponent <MouseLook>(); mouseLock = gameObject.GetComponentInChildren <Camera>().GetComponent <LockCursorOnClickScript>(); aimDown = gameObject.GetComponentInChildren <Camera>().GetComponent <AimDown>(); playerShooting = GetComponent <PlayerShooting>(); if (PlayerPrefs.HasKey("velMagX")) { mouseLookX.velMagX = PlayerPrefs.GetFloat("velMagX"); } else { PlayerPrefs.SetFloat("velMagX", mouseLookX.velMagX); } if (PlayerPrefs.HasKey("velMagY")) { mouseLookY.velMagY = PlayerPrefs.GetFloat("velMagY"); } else { PlayerPrefs.SetFloat("velMagY", mouseLookY.velMagY); } }
private void SetupDefaultBindings() { MoveLeft.AddDefaultBinding(InputControlType.LeftStickLeft); MoveLeft.AddDefaultBinding(InputControlType.DPadLeft); MoveRight.AddDefaultBinding(InputControlType.LeftStickRight); MoveRight.AddDefaultBinding(InputControlType.DPadRight); Jump.AddDefaultBinding(InputControlType.LeftBumper); IgniteJetpack.AddDefaultBinding(InputControlType.LeftTrigger); RotateLeft.AddDefaultBinding(InputControlType.LeftStickLeft); RotateRight.AddDefaultBinding(InputControlType.LeftStickRight); Shoot.AddDefaultBinding(InputControlType.RightTrigger); AimUp.AddDefaultBinding(InputControlType.RightStickUp); AimDown.AddDefaultBinding(InputControlType.RightStickDown); AimLeft.AddDefaultBinding(InputControlType.RightStickLeft); AimRight.AddDefaultBinding(InputControlType.RightStickRight); }
// Use this for initialization void Start() { currentBullets = clipSize; gun = GameObject.FindGameObjectWithTag("Gun"); aimDown = gameObject.GetComponentInParent <Camera>().GetComponent <AimDown>(); }