private void OnEnable() { if (m_controlls != null) { m_controlls.Enable(); } }
private void OnEnable() { if (!m_focus) { return; } controlls = new PlayerControlls(); CharacterController cCon = m_focus.GetComponent <CharacterController>(); if (!cCon) { return; } switch (cCon.p) { case PlayerChoise.PlayerOne: controlls.PlayerOneControlls.Camera.performed += ctx => m_cameraInput = new Vector2(-ctx.ReadValue <Vector2>().y, ctx.ReadValue <Vector2>().x); controlls.PlayerOneControlls.Camera.canceled += ctx => m_cameraInput = Vector2.zero; break; case PlayerChoise.PlayerTwo: controlls.PlayerTwoControlls.Camera.performed += ctx => m_cameraInput = new Vector2(ctx.ReadValue <Vector2>().y, ctx.ReadValue <Vector2>().x); controlls.PlayerTwoControlls.Camera.canceled += ctx => m_cameraInput = Vector2.zero; break; default: break; } controlls.Enable(); }
private void Start() { m_segments = new Segment[0]; m_controlls = new PlayerControlls(); m_controlls.PlayerOneControlls.InitiateRope.performed += ctx => InstantiateRope(m_instanciator, Target); m_controlls.PlayerTwoControlls.InitiateRope.performed += ctx => InstantiateRope(m_instanciator, Target); m_controlls.Enable(); }
private void Start() { zoomLerpFactor = Mathf.InverseLerp(cameraMinHeight, cameraMaxHeight, cameraBaseHeight); playerControlls = new PlayerControlls(); playerControlls.Enable(); playerControlls.KeyboardMouse.Move.performed += context => movementVector = context.ReadValue <Vector2>(); }
// Start is called before the first frame update void Start() { playerControlls = new PlayerControlls(); playerControlls.Enable(); playerControlls.KeyboardMouse.Move.performed += context => movementVector = context.ReadValue <Vector2>(); rigidbody = this.GetComponent <Rigidbody>(); }
private void OnEnable() { controlls.Enable(); }