コード例 #1
0
 void Update()
 {
     if (waitforpress && keyBinds.GetButtonDown("Interract"))
     {
         dialogueOption.Choice("Can I join your party?", yesEvent, noEvent);
     }
 }
コード例 #2
0
    void Update()
    {
        if (keyBinds.GetButtonDown("Jump"))
        {
            characterSwapper.currentCharacter.GetComponent <PlayerController>().jump();
        }
        ;

        if (Input.GetButtonDown("Character1"))
        {
            characterSwapper.switchToCharacter1();
        }

        if (Input.GetButtonDown("Character2"))
        {
            characterSwapper.switchToCharacter2();
        }

        if (Input.GetButtonDown("Character3"))
        {
            characterSwapper.switchToCharacter3();
        }

        if (Input.GetButtonDown("Character4"))
        {
            characterSwapper.switchToCharacter4();
        }
    }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        if (waitforpress && keyBinds.GetButtonDown("Interract"))
        {
            if (theText != null)
            {
                textbox.reuse(theText);
            }
            //else if (start < lines.Length)
            //{
            //    line.text = lines[start];
            //}
            textbox.currentline = start;
            textbox.endatline   = end;
            textbox.enable();

            if (stopPlayerMovement)
            {
                characterSwapper.currentCharacter.GetComponent <PlayerController>().controlEnabled = false;
            }

            if (DestroyObject)
            {
                Destroy(gameObject);
            }
            waitforpress = false;
        }
        //else if (lines.Length != 0)
        //{
        //    //activate Textbox
        //    //each line in lines = each line in TextBox
        //    //advance by getting interact
        //}
    }
コード例 #4
0
 void Update()
 {
     if (waitforpress && keyBinds.GetButtonDown("Interract"))
     {
         dialogueOption.Choice("Ohoho, you're approaching me?", yesEvent, noEvent);
     }
 }
コード例 #5
0
 // Update is called once per frame
 void Update()
 {
     if (keyBinds.GetButtonDown("Skill2"))
     {
         gameObject.GetComponent <CharacterSwapping>().currentCharacter.GetComponent <PlayerDetectShoot>().ShootBulletButton(1);
     }
     if (keyBinds.GetButtonDown("Skill3"))
     {
         gameObject.GetComponent <CharacterSwapping>().currentCharacter.GetComponent <PlayerDetectShoot>().ShootBulletButton(2);
     }
     if (keyBinds.GetButtonDown("Skill4"))
     {
         if (gameObject.GetComponent <CharacterSwapping>().currentCharacter.GetComponent <Mana>().currentMP >= 5)
         {
             gameObject.GetComponent <CharacterSwapping>().currentCharacter.GetComponent <PlayerController>().decrementMana(5);
             gameObject.GetComponent <CharacterSwapping>().currentCharacter.GetComponent <PlayerDetectShoot>().ShootBulletButton(3);
         }
     }
     if (keyBinds.GetButtonDown("Skill1"))
     {
         gameObject.GetComponent <CharacterSwapping>().currentCharacter.GetComponent <PlayerDetectShoot>().ShootBulletButton(4);
     }
 }
コード例 #6
0
    // Update is called once per frame
    void Update()
    {
        if (!isActive)
        {
            return;
        }

        if (currentline < textlines.Length)
        {
            theText.text = textlines[currentline];
        }

        if (keyBinds.GetButtonDown("Interract")) // press return/enter advances text
        {
            currentline += 1;
        }

        if (currentline > endatline) // once you reach the end, box disappears
        {
            disable();
        }
    }