void Start() { health = maxHealth; levelManager = GameObject.FindObjectOfType <LevelManager> (); lifeDisplay = GameObject.FindObjectOfType <LifeDisplay> (); spriteRenderer = GetComponent <SpriteRenderer> (); ComputeXPositionLimits(); }
public void Start() { life = FindObjectOfType <LifeDisplay>(); currentScene = SceneManager.GetActiveScene().buildIndex; if (currentScene == 0) { StartCoroutine(LoadingStart()); } }
private SpriteRenderer spriteRenderer; // this objects sprite renderer void Start() { // set current health to max health if current health is set to 0 or above maxHealth at runtime if (currentHealth == 0 || currentHealth > maxHealth) { currentHealth = maxHealth; } // get this game object's component's needed for this script lifeDisplay = GetComponentInChildren <LifeDisplay>(); spriteRenderer = GetComponent <SpriteRenderer>(); }
void Start() { worldBounds = transform.Find("WorldBounds").GetChild(0).GetComponent <EdgeCreator>(); enemyManager = transform.Find("EnemyManager").GetComponent <EnemyGenerator>(); ballManager = transform.Find("BallManager").GetComponent <BallGenerator>(); lvlDisplay = transform.Find("GameStatsBar").Find("LevelDisplay").GetComponent <LevelDisplayController>(); lifeDisplay = transform.Find("GameStatsBar").Find("LifeDisplay").GetComponent <LifeDisplay>(); gameOver = transform.Find("GameOver").gameObject; obstacleManager = transform.Find("ObstacleManager").GetComponent <ObstacleGenerator>(); background = transform.Find("Background").GetComponent <BackgroundBehavior>(); /*feedback = transform.Find("FilledFeedback").GetComponent<FillerFeedbackScript>();*/ progressPie = transform.Find("GameStatsBar").Find("ProgressPie").GetComponent <ProgressPie>(); // kickstart the first level enemyManager.numEnemies = currLevel; LevelBegin(); }
private void Start() { winLabel.SetActive(false); loseLabel.SetActive(false); life = FindObjectOfType <LifeDisplay>(); }
void Start() { lifeDisplay = FindObjectOfType <LifeDisplay>(); }
private void Start() { lifeDisplay = FindObjectOfType <LifeDisplay>(); levelController = FindObjectOfType <LevelController>(); }
public void takeAHit(bool fromRight) { this.rb2d.AddForce(new Vector2(0, 5), ForceMode2D.Impulse); LifeDisplay.setLife(--this.life); }