// Use this for initialization void Start() { player = FindObjectOfType <PlayerBehaviour>(); cameraController = FindObjectOfType <CameraController>(); healthManager = FindObjectOfType <PlayerHealthManager>(); time = FindObjectOfType <TimeManager>(); }
// Use this for initialization void Start() { thePlayerHealth = FindObjectOfType <PlayerHealthManager>(); currentHP = HPLevels[1]; currentAttack = attackLevels[1]; currentDefence = defenceLevels[1]; }
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); } }
void OnTriggerStay2D(Collider2D other) { if (other.gameObject.tag == "Player") { PlayerHealthManager.HurtPlayer(damage); } }
// 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>(); }
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>(); } }
// 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); }
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>(); }
// 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>(); }
private void SetReferences() { playerStatus = gameObject.GetComponent <PlayerStatus>(); player = gameObject.GetComponent <Player>(); playerHealthManager = gameObject.GetComponent <PlayerHealthManager>(); smokeChild = findChildByTag(Constantes.PLAYER_SMOKE_SPAW_POINT); }
// 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>(); }
public void Setup() //performs the same actions as MonoBehaviour's Start() function { playerHealthManager = FindObjectOfType <PlayerHealthManager>(); hurtEnemy = FindObjectOfType <HurtEnemy>(); maxHealth = playerHealthManager.GetMaxHealth(); }
void Start() { levelManager = FindObjectOfType <LevelManager>(); Resume(); //cameraB = FindObjectOfType<Boss01Camera>(); PHM = FindObjectOfType <PlayerHealthManager>(); }
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>(); }
// Use this for initialization void Start() { myRB = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); theCamera = FindObjectOfType <CameraController>(); playerHealth = GetComponent <PlayerHealthManager>(); }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { PlayerHealthManager.damagePlayer(damageToGive); } }
// 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); }
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]; }
void Start() { currentHP = hpLevels[1]; currentAttack = attackLevels[1]; currentDefense = defenseLevels[1]; playerHealth = FindObjectOfType <PlayerHealthManager>(); }
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>(); }
// Start is called before the first frame update void Start() { if (phm != null) { phm = GameObject.Find("Player").GetComponent <PlayerHealthManager>(); } }
// 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>(); }
// 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>(); }
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); } } } }
void Start() { currentHp = hpLvl[currentLvl]; currentAtack = attackLvl[currentLvl]; currentDefence = defenceLvl[currentLvl]; playerHp = FindObjectOfType <PlayerHealthManager>(); }
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>(); }
// 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(); }
//Text text; void Start() { //text = GetComponent<Text>(); healthManager = FindObjectOfType<PlayerHealthManager>(); healthBar = GetComponent<Slider>(); healthCount = PlayerHealthManager.playerHealth; maxHealth = healthManager.maxPlayerHealth; healthBar.maxValue = maxHealth; }
// 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>(); }
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); }