Пример #1
0
    void Start()
    {
        if (motion2D == null)
        {
            motion2D = GetComponent <Motion2d>();
        }
        if (rigidbody2D == null)
        {
            rigidbody2D = GetComponent <Rigidbody2D>();
        }

        motion2D.OnJump += OnJump;
    }
    private void Start()
    {
        if (JumpComponent == null)
        {
            JumpComponent = GetComponent <BasicJump>();
        }
        if (Motion2d == null)
        {
            Motion2d = GetComponent <Motion2d>();
        }

        JumpComponent.OnLanding += OnLanding;
        Motion2d.OnJump         += OnJump;
    }