Example #1
0
 public void SetUpState()
 {
     CrossPlatformInputManager.SetButtonUp(Name);
 }
Example #2
0
 public void OnPointerUp(PointerEventData eventData)
 {
     CrossPlatformInputManager.SetButtonUp(buttonName);
 }
Example #3
0
    // Use this for initialization
    void Start()
    {
        Time.timeScale = 1;
        CrossPlatformInputManager.SetButtonUp("Fire");

        var behave = GameObject.FindGameObjectWithTag("Behaviour").GetComponent <GameBehavior>();

        strength    = behave.getStrength();
        agility     = behave.getAgility();
        inteligence = behave.getInteligence();
        vitality    = behave.getVitality();
        isShooting  = false;

        //NOVA LOGICA
        if (vitality <= 10)
        {
            maxLife = vitality * 10;
        }
        else if (vitality > 10 && vitality <= 20)
        {
            maxLife = vitality * 12;
        }
        else if (vitality > 20 && vitality <= 30)
        {
            maxLife = vitality * 15;
        }
        else
        {
            maxLife = vitality * 17;
        }


        if (strength <= 10)
        {
            baseDamage = strength + 2;
        }
        else if (strength > 10 && strength <= 20)
        {
            baseDamage = strength + 4;
        }
        else if (strength > 20 && strength <= 30)
        {
            baseDamage = strength + 6;
        }
        else
        {
            baseDamage = strength + 8;
        }

        speed          = 1 + agility * 0.01f;
        life           = maxLife;
        behave.life    = life;
        behave.maxLife = maxLife;


        experience = behave.experience;
        if (life <= 0)
        {
            life = maxLife;
        }
        neededExperience = behave.neededExperience;



        HUD = GameObject.FindGameObjectWithTag("HUD");

        //HUD
        hudGame = HUD.GetComponent <HUDGame> ();

        hudGame.initLife();

        hudGame.takeDamage();
        hudGame.incrementXp();

        direction      = 0;
        shootDirection = 0;
        bothAnimator   = transform.GetComponent <Animator> ();
        legAnimator    = transform.Find("Legs").GetComponent <Animator>();
        torsoAnimator  = transform.Find("Torso").GetComponent <Animator>();


        torsoAnimator.SetInteger("Weapon", behave.selectedWeapon);


        behave.pause = false;

        extraTime        = (float)behave.getInteligence() / (float)4;
        timeToStopSkill += extraTime;
        reloadingTime    = 20;
    }
Example #4
0
 public void OnPointerUp(PointerEventData eventData)
 {
     CrossPlatformInputManager.SetButtonUp(Name);
     print("Up registered");
     //   vbutton.Released();
 }
Example #5
0
 /// <summary>
 /// presses the endturn button up
 /// </summary>
 public void Button_End_Turn_Up()
 {
     CrossPlatformInputManager.SetButtonUp("endturn");
 }