예제 #1
0
 private void OnEnable()
 {
     if (m_controlls != null)
     {
         m_controlls.Enable();
     }
 }
예제 #2
0
    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();
    }
예제 #3
0
 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>();
    }
예제 #5
0
    // 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>();
    }
예제 #6
0
 private void OnEnable()
 {
     controlls.Enable();
 }