예제 #1
0
 // Use this for initialization
 void Start()
 {
     player           = FindObjectOfType <PlayerBehaviour>();
     cameraController = FindObjectOfType <CameraController>();
     healthManager    = FindObjectOfType <PlayerHealthManager>();
     time             = FindObjectOfType <TimeManager>();
 }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     thePlayerHealth = FindObjectOfType <PlayerHealthManager>();
     currentHP       = HPLevels[1];
     currentAttack   = attackLevels[1];
     currentDefence  = defenceLevels[1];
 }
예제 #3
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("EnemyActivator") || other.CompareTag("Projectile") || other.CompareTag("Enemy") || other.CompareTag("Arena"))
        {
            //print("Hit " + other.tag);
            return;
        }

        if (other.CompareTag("Player"))
        {
            if (other.isTrigger == true)
            {
                return;
            }

            //print("Projectile hit player");
            Invoke(nameof(DelayedDestroy), 0.1f);
            PlayerHealthManager playerHM = other.gameObject.GetComponent <PlayerHealthManager>();
            if (playerHM)
            {
                playerHM.RecieveDamage(damage);
            }
        }
        else
        {
            //print("Destroying projectile, hit " + other.name);
            Destroy(gameObject);
        }
    }
예제 #4
0
 void OnTriggerStay2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         PlayerHealthManager.HurtPlayer(damage);
     }
 }
예제 #5
0
    // Use this for initialization
    void Start()
    {
        playerStamina      = FindObjectOfType <PlayerStaminaManager>();
        playerHealthObject = GameObject.Find("Player");
        playerHealth       = playerHealthObject.GetComponent <PlayerHealthManager>();
        playerRanged       = playerHealthObject.GetComponent <PlayerRangedAttack>();
        shieldBlockScript  = FindObjectOfType <ShieldBlock>();
        playerStatsScript  = FindObjectOfType <PlayerStats>();

        daggerTextObject  = GameObject.Find("DaggerText");
        shieldTextObject  = GameObject.Find("ShieldText");
        shieldImageObject = GameObject.Find("ShieldImage");
        potionText        = GameObject.Find("PotionText").GetComponent <Text>();

        shieldTextObject.SetActive(false);
        shieldImageObject.SetActive(false);

        // daggerImageObject.GetComponent<Image>().Sprite = YourSprite;

        if (!UIExists)
        {
            UIExists = true;
            //DontDestroyOnLoad(transform.gameObject);
        }

        else
        {
            //Destroy(gameObject);
        }

        thePS = GetComponent <PlayerStats>();
    }
예제 #6
0
    Boss03Phase3 P3; //for wendigo boss

    // Use this for initialization
    void Start()
    {
        //Grab controls from controls save file
        moveRight = ControlsSerializeManager.Load_MoveRight_Data();
        moveLeft  = ControlsSerializeManager.Load_MoveLeft_Data();
        jumpKey   = ControlsSerializeManager.Load_Jump_Data();
        shootKey  = ControlsSerializeManager.Load_ShootLemon_Data();

        anim = GetComponent <Animator>();
        rb   = GetComponent <Rigidbody2D>();

        healthManager = FindObjectOfType <PlayerHealthManager>();

        facingRight = true;

        isWalking = false;

        projectilePos = transform.Find("projectilePos");   //find child named projectilePos (i.e. its position)

        flipValue = 1;

        justJumped = false;

        landedFromJump = false;

        if (FindObjectOfType <Boss03Phase3>() != null)
        {
            P3 = GameObject.FindObjectOfType <Boss03Phase3>();
        }
    }
예제 #7
0
 // Use this for initialization
 void Start()
 {
     sound     = FindObjectOfType <EffectsManager>();
     thePlayer = FindObjectOfType <PlayerHealthManager>();
     kill      = FindObjectOfType <Killer>();
     Items     = FindObjectOfType <Item>();
 }
        public PlayerData(PlayerController playerController)
        {
            PlayerHealthManager playerHealthManager = playerController.GetComponent <PlayerHealthManager>();

            playerControllerData = new PlayerControllerData(playerController);
            playerHealthData     = new PlayerHealthData(playerHealthManager);
        }
예제 #9
0
    void Start()
    {
        if (!UIExists)
        {
            UIExists = true;
            DontDestroyOnLoad(transform.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        HpBar  = GameObject.Find("HP_Bar").GetComponent <Slider>();
        MpBar  = GameObject.Find("MP_Bar").GetComponent <Slider>();
        ExpBar = GameObject.Find("Exp_Bar").GetComponent <Slider>();

        HpText  = GameObject.Find("HP_Text").GetComponent <Text>();
        MpText  = GameObject.Find("MP_Text").GetComponent <Text>();
        ExpText = GameObject.Find("Exp_Text").GetComponent <Text>();
        lvlText = GameObject.Find("LvL_Text").GetComponent <Text>();

        playerHP = GameObject.Find("Player").GetComponent <PlayerHealthManager>();
        playerMP = GameObject.Find("Player").GetComponent <PlayerManaManager>();

        playerStats = GetComponent <PlayerStats>();
    }
예제 #10
0
 // Start is called before the first frame update
 void Start()
 {
     movementManager = GameObject.Find("Movement Manager").GetComponent <MovementManager>();
     playerCharacter = transform.root.gameObject.GetComponent <PlayerCharacter>();
     healthManager   = transform.root.gameObject.GetComponent <PlayerHealthManager>();
     Anim            = transform.root.GetChild(1).gameObject.GetComponent <Animator>();
 }
예제 #11
0
 private void SetReferences()
 {
     playerStatus        = gameObject.GetComponent <PlayerStatus>();
     player              = gameObject.GetComponent <Player>();
     playerHealthManager = gameObject.GetComponent <PlayerHealthManager>();
     smokeChild          = findChildByTag(Constantes.PLAYER_SMOKE_SPAW_POINT);
 }
예제 #12
0
 // Start is called before the first frame update
 void Start()
 {
     player        = GameObject.FindWithTag("Player");
     money         = player.GetComponent <MoneyManager>();
     healthManager = player.GetComponent <PlayerHealthManager>();
     sfxMan        = FindObjectOfType <SFXManager>();
 }
예제 #13
0
    public void Setup() //performs the same actions as MonoBehaviour's Start() function
    {
        playerHealthManager = FindObjectOfType <PlayerHealthManager>();
        hurtEnemy           = FindObjectOfType <HurtEnemy>();

        maxHealth = playerHealthManager.GetMaxHealth();
    }
예제 #14
0
 void Start()
 {
     levelManager = FindObjectOfType <LevelManager>();
     Resume();
     //cameraB = FindObjectOfType<Boss01Camera>();
     PHM = FindObjectOfType <PlayerHealthManager>();
 }
예제 #15
0
    public float time;       //time the button has been held for

    // Start is called before the first frame update
    void Start()
    {
        isActive     = false;
        time         = 0.0f;
        sfxMan       = FindObjectOfType <SFXManager>();
        playerHealth = FindObjectOfType <PlayerHealthManager>();
    }
예제 #16
0
 // Use this for initialization
 void Start()
 {
     myRB         = GetComponent <Rigidbody2D>();
     anim         = GetComponent <Animator>();
     theCamera    = FindObjectOfType <CameraController>();
     playerHealth = GetComponent <PlayerHealthManager>();
 }
예제 #17
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         PlayerHealthManager.damagePlayer(damageToGive);
     }
 }
예제 #18
0
 // Start is called before the first frame update
 void Start()
 {
     UI           = GameObject.Find("UI");
     gameOver     = UI.transform.Find("GameOver");
     playerHealth = FindObjectOfType <PlayerHealthManager>();
     gameOver.gameObject.SetActive(false);
 }
예제 #19
0
 private void Awake()
 {
     playerHealth = FindObjectOfType <PlayerHealthManager>();
     playerMana   = FindObjectOfType <PlayerManaManager>();
     playerStats  = FindObjectOfType <PlayerStatistics>();
     playerDamage = FindObjectOfType <DamageEnemy>();
 }
 // Use this for initialization
 void Start()
 {
     playerHealthManager = FindObjectOfType <PlayerHealthManager>();
     CurrentHp           = hpLevels[1];
     CurrentStrength     = strengthLevels[1];
     CurrentDefense      = defenseLevels[1];
 }
예제 #21
0
 void Start()
 {
     currentHP      = hpLevels[1];
     currentAttack  = attackLevels[1];
     currentDefense = defenseLevels[1];
     playerHealth   = FindObjectOfType <PlayerHealthManager>();
 }
예제 #22
0
    void Start()
    {
        character      = GetComponent <Character>();
        characterStats = GetComponent <CharacterDatabase>().FetchCharacterByTipe("player");

        name            = characterStats.Name;
        race            = characterStats.Race;
        pClass          = characterStats.Class;
        statsPoints     = characterStats.Sp;
        tempStatsPoints = statsPoints;
        currentLvl      = characterStats.Level;
        currentExp      = characterStats.Exp;

        currentPower = characterStats.Power;
        currentAgi   = characterStats.Agility;
        currentVit   = characterStats.Vitality;
        currentInt   = characterStats.Inteligence;
        currentConst = characterStats.Constitution;

        tempPower = currentPower;
        tempAgi   = currentAgi;
        tempVit   = currentVit;
        tempInt   = currentInt;
        tempConst = currentConst;

        currentHp      = Mathf.RoundToInt(currentVit * 1.5f);
        currentMp      = Mathf.RoundToInt(currentInt * 1.5f);
        currentSta     = Mathf.RoundToInt(currentConst * 1.5f);
        currentAttack  = Mathf.RoundToInt(currentPower * 1.5f);
        currentDefence = Mathf.RoundToInt(currentConst * 1.5f);
        playerHp       = FindObjectOfType <PlayerHealthManager>();
        playerMp       = FindObjectOfType <PlayerManaManager>();
    }
예제 #23
0
 // Start is called before the first frame update
 void Start()
 {
     if (phm != null)
     {
         phm = GameObject.Find("Player").GetComponent <PlayerHealthManager>();
     }
 }
예제 #24
0
    // Start is called before the first frame update
    void Start()
    {
        toLevelUp[0] = 0;
        toLevelUp[1] = 15;

        HPLevels[0] = 50;
        HPLevels[1] = 50;

        attackLevels[0] = 5;
        attackLevels[1] = 5;

        defenceLevels[0] = 0;
        defenceLevels[1] = 0;

        for (int i = 2; i < 500; i++)
        {
            toLevelUp[i]     = (int)(15 * Mathf.Pow(i, 2));
            HPLevels[i]      = (int)(45 + 5 * i);
            attackLevels[i]  = (int)(3 * i);
            defenceLevels[i] = (int)(i);
        }

        currentHP      = HPLevels[1];
        currentAttack  = attackLevels[1];
        currentDefence = defenceLevels[1];

        thePlayerHealth = FindObjectOfType <PlayerHealthManager>();
    }
예제 #25
0
    // Use this for initialization
    void Start()
    {
        playerStaminaMan = FindObjectOfType <PlayerStaminaManager>();

        thePlayer = FindObjectOfType <PlayerController>();

        sfxMan = FindObjectOfType <SFXManager>();

        shield = FindObjectOfType <ShieldBlock>();

        thePS = FindObjectOfType <PlayerStats>();

        enemy = FindObjectOfType <EnemyTestScript>();

        playerHealth = FindObjectOfType <PlayerHealthManager>();
        hurtEnemy    = FindObjectOfType <HurtEnemy>();

        enemyHealth = FindObjectOfType <EnemyHealthManager>();

        playerEngagement = FindObjectOfType <EngagedWithPlayer>();

        // enemyStaminaMan = FindObjectOfType<EnemyStaminaManager>();

        deathStrike = false;

        showBlood          = false;
        playerStaminaDrain = false;
    }
    //private	Animator anim;

    void Start()
    {
        //playerControl = transform.root.GetComponent<PlayerControl2D>();
        playerHealth = transform.root.GetComponent <PlayerHealthManager>();
        playerBody   = transform.root.GetComponent <Rigidbody2D>();
        //anim = transform.root.GetComponent<Animator>();
    }
예제 #27
0
    public void Kill(GameObject obj)
    {
        PlayerHealthManager player = obj.GetComponent <PlayerHealthManager>();

        if (player)
        {
            player.TakeDamage(100);
        }
        else
        {
            SmasherHealthManager smasher = obj.GetComponent <SmasherHealthManager>();
            if (smasher)
            {
                smasher.TakeDamage(100);
            }
            else
            {
                MonsterHealthManager monster = obj.GetComponent <MonsterHealthManager>();
                if (monster)
                {
                    monster.TakeDamage(100);
                }
            }
        }
    }
예제 #28
0
 void Start()
 {
     currentHp      = hpLvl[currentLvl];
     currentAtack   = attackLvl[currentLvl];
     currentDefence = defenceLvl[currentLvl];
     playerHp       = FindObjectOfType <PlayerHealthManager>();
 }
예제 #29
0
 void OnCollisionStay2D(Collision2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         PlayerHealthManager.HurtPlayer(damage);
     }
 }
 private void Awake()
 {
     rb          = GetComponent <Rigidbody2D>();
     audioSource = GameObject.Find("Main Camera").GetComponent <AudioSource>();
     audioSource.PlayOneShot(appearanceSound);
     healthManager = FindObjectOfType <PlayerHealthManager>();
 }
예제 #31
0
 // Use this for initialization
 void Start()
 {
     health = FindObjectOfType<PlayerHealthManager>();
     GetComponent<AudioSource>().Play ();
     canPickUp = false;
     p2Check = PlayerPrefs.GetInt("PlayerTwoHasSpawned");
     if(p2Check == 1){
         health2 = FindObjectOfType<PlayerTwoHealthManager>();
     }
     CallTouchDelay();
 }
예제 #32
0
    //Text text;
    void Start()
    {
        //text = GetComponent<Text>();
        healthManager = FindObjectOfType<PlayerHealthManager>();

        healthBar = GetComponent<Slider>();

        healthCount = PlayerHealthManager.playerHealth;

        maxHealth = healthManager.maxPlayerHealth;

        healthBar.maxValue = maxHealth;
    }
예제 #33
0
    // Use this for initialization
    void Start()
    {
        player = FindObjectOfType<PlayerController>();
        health = FindObjectOfType<PlayerHealthManager>();

        playerTwoHasSpawned = PlayerPrefs.GetInt("PlayerTwoHasSpawned");
        playerTwoThisLevel = false;

        hasWaveStarted = false;
        waveCompleted = false;
        anEnemyHasSpawned = false;
        gameOver = false;
        CallDelayLevelStart();
        Cursor.visible = false;
    }
 void Start()
 {
     player = FindObjectOfType<PlayerController>();
     camera = FindObjectOfType<CameraController>();
     playerHealthManager = FindObjectOfType<PlayerHealthManager>();
 }
예제 #35
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     else
     {
         if (this != _instance)
             Destroy(gameObject);
     }
     m_healthManager = new PlayerHealthManager(m_fMaxHealth, m_fRecoveryRate);
     m_skills = new Dictionary<Skill.SkillColor, Skill>();
     DontDestroyOnLoad(gameObject);
 }