Пример #1
0
    void GetM1Input()
    {
        M1currentInput = Input.GetAxisRaw("Fire1");

        if (M1currentInput >= M1MinInput) //holding down button
        {
            if (showDebugLine)
            {
                Debug.DrawLine(laserPointer.origin, laserPointer.GetPoint(InteractionReachDistance), Color.red);
            }

            if (M1prevInput < M1MinInput) //started holding
            {
                IM.EngageWithObjectStart(rh.transform);
            }
            else //still held
            {
                IM.EngageWithObjectContinued(rh.transform);
            }
        }
        else //not holding
        {
            if (showDebugLine)
            {
                Debug.DrawLine(laserPointer.origin, laserPointer.GetPoint(InteractionReachDistance), Color.blue);
            }

            if (M1prevInput >= M1MinInput) //let go
            {
                IM.MightEngageWithObjectStart(rh.transform);
            }
            else  //still not holding
            {
                IM.MightEngageWithObjectContinued(rh.transform);
            }
        }

        M1prevInput = M1currentInput;
    }