Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        switch (skillMode)
        {
        //movement
        case SealSkillState.crawl:
            EnableScript(sealMovement.ToString());

            break;

        case SealSkillState.electricity:

            break;

        case SealSkillState.fat:

            break;

        case SealSkillState.flat:

            break;

        case SealSkillState.hover:
            //X-akseli
            EnableScript(hoverScript.ToString());
            hoverScript.UpdateOriginalScaleX(PlayerManager.Instance.side);
            break;

        case SealSkillState.FloatingVertical:
            //Y-akseli
            break;

        case SealSkillState.fly:

            break;

        case SealSkillState.jump:
            EnableScript(jumpScript.ToString());
            jumpScript.UpdateOriginalScaleX(PlayerManager.Instance.side);
            break;

        case SealSkillState.oil:

            break;
        }

        if (skillMode == SealSkillState.hover)
        {
            _rb2D.gravityScale = 0;
        }
        else
        {
            _rb2D.gravityScale = 1;
        }

        if (Input.GetButtonDown("Fire1"))
        {
            EndSummoning();
        }
        if (_collision.IsEverythingColliding())
        {
            EndSummoning();
        }

        if (Input.GetKeyDown(KeyCode.M))
        {
            ToggleSkill();
        }
    }