Example #1
0
 void Start()
 {
     player           = GameObject.FindGameObjectWithTag("Player");                  // Componente del jugador.
     playerExp        = player.GetComponent <PlayerExperience>();                    // Componente de la experiencia del jugador.
     playerStats      = player.GetComponent <PlayerStats>();                         // Componente de las estadísticas del jugador.
     healthText.color = new Color(0, 0, 0, 1);
 }
Example #2
0
    // Use this for initialization
    void Awake()
    {
        //Pegar os objetos do GM, e setar as skills e o ManagerScene
        GM = GameObject.FindGameObjectWithTag("GameController");
        skills = GM.GetComponent<Skills>();
        gmManagerScene = GM.GetComponent<ManagerScene>();
        gmManagerScene.GetScenesModeGame();

        //Verificar se o modo de jogo é survival
        if (gmManagerScene.gameMode == "Survival")
        {
            print("Entrou no if");
            wavesDetailsSurvival = GameObject.FindGameObjectWithTag("Canvas").GetComponent<WavesDetailsSurvival>();
        }

        // anim = GetComponent<Animator>();
        // enemyAudio = GetComponent<AudioSource>();
        capsuleCollider = GetComponent<CapsuleCollider>();
        damageGO.SetActive(false);
        currentHealth = startingHealth;

        //Achar o PlayerExperience
        if (GameObject.FindGameObjectWithTag("Player"))
        {
            player = GameObject.FindGameObjectWithTag("Player");
            playerExperience = player.GetComponent<PlayerExperience>();
        }
    }
Example #3
0
    protected virtual void EnemyDeath()
    {
        PlayerExperience playerExperience = target.GetComponent <PlayerExperience>();

        playerExperience.AddExp(xpGiveAmount);
        Destroy(gameObject);
    }
Example #4
0
 // Use this for initialization
 void Start()
 {
     fath                = GameObject.Find("Father");
     animas              = GetComponent <Animator> ();
     bossCurrentHealth   = bossMaxHealth;
     thePlayerExperience = GameObject.Find("UICanvas").GetComponent <PlayerExperience> ();
 }
Example #5
0
 private void Awake()
 {
     player           = GameObject.FindGameObjectWithTag("Player");
     playerAbilities  = player.GetComponent <PlayerAbilities>();
     playerExperience = player.GetComponent <PlayerExperience>();
     db = GameObject.FindGameObjectWithTag("ItemDB").GetComponent <ItemDatabase>();
 }
Example #6
0
 void Awake()
 {
     Instance = gameObject;
     PlayerTransform = Instance.transform;
     PlayerHealth = Instance.GetComponent<PlayerHealth>();
     PlayerExperience = Instance.GetComponent<PlayerExperience>();
     PlayerEnergy = Instance.GetComponent<PlayerEnergy>();
 }
 public void findObjects()
 {
     player    = GameObject.FindGameObjectWithTag("Player");
     abilities = player.GetComponent <PlayerAbilities>();
     health    = player.GetComponent <PlayerHealth>();
     exp       = player.GetComponent <PlayerExperience>();
     equip     = player.GetComponent <PlayerEquip>();
     movement  = player.GetComponent <PlayerMovement>();
 }
Example #8
0
    void Awake()
    {
        Instance   = this;
        currentExp = startingExp;
        levelText  = experienceSlider.GetComponentInChildren <Text> ();

        experienceSlider.minValue = 0;
        experienceSlider.maxValue = (2 / .365f) * (2 / .365f);
    }
Example #9
0
    // Update is called once per frame
    void Update()
    {
        pE                  = FindObjectOfType <PlayerExperience>();
        ExperienceText      = GetComponent <Text>();
        ExperienceText.text = pE.totalExperience.ToString() + "/100";
        float experienceAmount = pE.totalExperience;

        ExperienceSlider.value = experienceAmount;
    }
Example #10
0
 void Start()
 {
     _player           = GameObject.Find("Player");
     _playerResources  = _player.GetComponent <PlayerResources>();
     _playerExperience = _player.GetComponent <PlayerExperience>();
     resourceQuantity  = maxQuantity + Convert.ToInt32(UnityEngine.Random.Range(-maxQuantity * 0.3f, maxQuantity * 0.3f));
     _animator         = _player.GetComponent <Animator>();
     audioManager      = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <CustomAudioManager>();
     _playerEq         = _player.GetComponent <PlayerEquipment>();
 }
Example #11
0
    void Awake()
    {
        experienceBar = GameObject.Find("Experience");

        levelDisplayText = GameObject.Find("Level Display Text");
        levelDisplay     = levelDisplayText.GetComponent <Text>();

        player           = GameObject.FindGameObjectWithTag("Player");
        playerExperience = player.GetComponent <PlayerExperience>();
    }
Example #12
0
 void Awake()
 {
     player          = GameObject.FindGameObjectWithTag("Player");
     exp             = player.GetComponent <PlayerExperience>();
     playerAbilities = player.GetComponent <PlayerAbilities>();
     abilityImage    = this.gameObject.GetComponent <Image>();
     toolTip         = GameObject.Find("SkillToolTipText").GetComponent <SkillTooltip>();
     toolTipObject   = GameObject.Find("SkillToolTip");
     bar             = GameObject.Find("AbilityBarPanel").GetComponent <UIAbilityBar>();
 }
Example #13
0
    void Awake()
    {
        enemyHealthBarPrefab = (Resources.Load("Prefabs/Enemy Health Bar")) as GameObject;

        combat           = GetComponent <EnemyCombat>();
        playerCombat     = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerCombat>();
        stats            = GetComponent <EnemyStats>();
        game             = GameObject.Find("Game").GetComponent <GameController>();
        playerExperience = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerExperience>();
    }
Example #14
0
 private void RefreshExp(PlayerExperience playerExp)
 {
     level = playerExp.Level;
     try
     {
         this.Invoke((MethodInvoker) delegate {
             RefreshHUD();
         });
     }
     catch { }
 }
Example #15
0
    public virtual void PickUp(PlayerExperience experience, PlayerInventory inventory)
    {
        addToInv(inventory);

        if (!dropped)
        {
            experience.addXp(xp);
        }

        Destroy(gameObject);
    }
Example #16
0
    public PlayerData(PlayerHealth health, PlayerExperience exp, PlayerSkills skills)
    {
        maxHP = health.maxHP;
        hp    = health.hp;

        level      = exp.level;
        this.exp   = exp.exp;
        levelupExp = exp.levelupExp;

        skillAID = skills.skillAID;
        skillBID = skills.skillBID;
    }
Example #17
0
 // Use this for initialization
 void Start()
 {
     anim       = GetComponent <Animator> ();
     player     = GameObject.FindGameObjectWithTag("Player");
     getHit     = GameObject.FindGameObjectWithTag("HP").GetComponent <PlayerHealth> ();
     playerAnim = player.GetComponent <Animator> ();
     nav        = GetComponent <NavMeshAgent> ();
     audioPlay  = GetComponent <AudioSource>();
     playerEXP  = GameObject.FindGameObjectWithTag("EXP").GetComponent <PlayerExperience>();
     tool1      = GameObject.FindGameObjectWithTag("Tools1").GetComponent <Tool1>();
     tool2      = GameObject.FindGameObjectWithTag("Tools2").GetComponent <Tool2>();
     tool3      = GameObject.FindGameObjectWithTag("Tools3").GetComponent <Tool3>();
 }
Example #18
0
    // Colocar todo valor que foi passado de uma fase para outra nas variáveis

    private void Awake()
    {
        canvas  = GameObject.FindGameObjectWithTag("Canvas");
        potions = canvas.GetComponent <PotionsScript>();

        if (GameObject.FindGameObjectWithTag("Player"))
        {
            player           = GameObject.FindGameObjectWithTag("Player");
            playerHealth     = player.GetComponent <PlayerHealth>();
            playerExperience = player.GetComponent <PlayerExperience>();
            playerShooting   = player.GetComponentInChildren <PlayerShooting>();
        }
    }
Example #19
0
 // Use this for initialization
 void Start()
 {
     slider = GetComponent <Slider>();
     hurt   = GetComponent <AudioSource>();
     anim   = GameObject.FindGameObjectWithTag("Player").GetComponent <Animator>();
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>();
     level  = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerLevelData> ();
     HP     = GameObject.FindGameObjectWithTag("HP").GetComponent <Slider>();
     exp    = GameObject.FindGameObjectWithTag("EXP").GetComponent <PlayerExperience> ();
     skill1 = GameObject.FindGameObjectWithTag("Skill1").GetComponent <Skill1> ();
     skill2 = GameObject.FindGameObjectWithTag("Skill2").GetComponent <Skill2> ();
     over   = GameObject.FindGameObjectWithTag("GameOver").GetComponent <GameOver> ();
     mis    = GameObject.FindGameObjectWithTag("Mission").GetComponent <MissionProgress> ();
 }
Example #20
0
    bool isSinking;                             // Whether the enemy has started sinking through the floor.


    void Awake()
    {
        // Setting up the references.
        anim             = GetComponent <Animator>();
        enemyAudio       = GetComponent <AudioSource>();
        hitParticles     = GetComponentInChildren <ParticleSystem>();
        capsuleCollider  = GetComponent <CapsuleCollider>();
        player           = GameObject.FindGameObjectWithTag("Player");
        playerExperience = player.GetComponent <PlayerExperience>();
        loots            = GetComponent <EnemyLoots>();

        // Setting the current health when the enemy first spawns.
        currentHealth = startingHealth;
    }
Example #21
0
 // Use this for initialization
 void Start()
 {
     HealthBar.interactable = false;
     thePE        = gameObject.GetComponent <PlayerExperience> ();
     playerHealth = GameObject.FindWithTag("Player").GetComponent <PlayerHealthManager>();
     if (!UIExists)
     {
         UIExists = true;
         DontDestroyOnLoad(transform.gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
 private void Awake()
 {
     if (SceneManager.GetActiveScene().buildIndex == 1)
     {
         player      = GameObject.FindGameObjectWithTag("Player");
         abilities   = player.GetComponent <PlayerAbilities>();
         health      = player.GetComponent <PlayerHealth>();
         exp         = player.GetComponent <PlayerExperience>();
         equip       = player.GetComponent <PlayerEquip>();
         movement    = player.GetComponent <PlayerMovement>();
         inventory   = GameObject.Find("Inventory").GetComponent <Inventory>();
         uiInventory = GameObject.Find("InventoryPanel").GetComponent <UIInventory>();
         abilityBar  = GameObject.Find("AbilityBarPanel").GetComponent <UIAbilityBar>();
         //skillCanvas = GameObject.Find("SkillPanel").GetComponent<SkillCanvas>();
     }
 }
Example #23
0
        private static void UpdateExp()
        {
            bool attributesChanged = ReadExperience();

            attributesChanged |= ReadLevel();

            if (attributesChanged && ExperienceChanged != null)
            {
                var playerExperience = new PlayerExperience {
                    Level      = level,
                    Experience = experience
                };

                ExperienceChanged(null, playerExperience);
            }
        }
Example #24
0
        private static void UpdateExp()
        {
            bool attributesChanged = ReadExperience();

            if (!tibia11_addresses)
            {
                attributesChanged |= ReadLevel();
            }

            if (attributesChanged && ExperienceChanged != null)
            {
                if (tibia11_addresses)
                {
                    level = GetLevelFromExperience(experience);
                }
                var playerExperience = new PlayerExperience {
                    Level      = level,
                    Experience = experience
                };

                ExperienceChanged(null, playerExperience);
            }
        }
Example #25
0
        private void RefreshHUD(PlayerExperience playerExp)
        {
            int  level          = playerExp.Level;
            long baseExperience = GetExperience(level - 1);
            long exp            = playerExp.Experience - baseExperience;
            long maxExp         = GetExperience(level) - baseExperience;

            if (maxExp == 0)
            {
                exp    = 1;
                maxExp = 1;
            }

            try
            {
                this.Invoke((MethodInvoker) delegate {
                    RefreshHUD(exp, maxExp, level);
                });
            }
            catch
            {
            }
        }
Example #26
0
 // Use this for initialization
 void Start()
 {
     lucSet = GetComponent <Text> ();
     exp    = GameObject.FindGameObjectWithTag("EXP").GetComponent <PlayerExperience> ();
 }
Example #27
0
 // Use this for initialization
 void Start()
 {
     anima = GetComponent <Animator> ();
     enemyCurrentHealth  = enemyMaxHealth;
     thePlayerExperience = GameObject.Find("UICanvas").GetComponent <PlayerExperience> ();
 }
Example #28
0
 public PlayerStats(int defaultExperience, int defaultStrength)
 {
     strength   = defaultStrength;
     experience = new PlayerExperience(defaultExperience);
 }
 public PlayerExperienceProperties(ScriptContext context, Player player)
     : base(context, player)
 {
     exp = player.PlayerActor.Trait <PlayerExperience>();
 }
Example #30
0
 private void Awake()
 {
     playerExperience = GetComponent <PlayerExperience>();
     HP     = GetComponent <PlayerHealth>();
     attack = GetComponentInChildren <PlayerShooting>();
 }