public void ParseTest()
        {
            string input = testClick.ToString() + "\n";

            input += testHover.ToString() + "\n";
            input += testDrag.ToString() + "\n";
            input += testKeystroke.ToString() + "\n";

            AutoClickerParser parser = SetUp(input.ToString());

            AutoClickerParser.InstructionsContext context = parser.instructions();
            AutoClickerVisitor visitor = new AutoClickerVisitor();
            List <Instructions.Instruction> instructions = (List <Instructions.Instruction>)visitor.Visit(context);

            Assert.IsTrue(instructions.Contains(testClick));
            Assert.IsTrue(instructions.Contains(testHover));
            Assert.IsTrue(instructions.Contains(testDrag));
            Assert.IsTrue(instructions.Contains(testKeystroke));
        }
Exemple #2
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();
        }
    }