Inheritance: MonoBehaviour
 void Start()
 {
     health         = maxHealth;
     levelManager   = GameObject.FindObjectOfType <LevelManager> ();
     lifeDisplay    = GameObject.FindObjectOfType <LifeDisplay> ();
     spriteRenderer = GetComponent <SpriteRenderer> ();
     ComputeXPositionLimits();
 }
Esempio n. 2
0
 public void Start()
 {
     life         = FindObjectOfType <LifeDisplay>();
     currentScene = SceneManager.GetActiveScene().buildIndex;
     if (currentScene == 0)
     {
         StartCoroutine(LoadingStart());
     }
 }
Esempio n. 3
0
    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>();
    }
Esempio n. 4
0
    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();
    }
Esempio n. 5
0
 private void Start()
 {
     winLabel.SetActive(false);
     loseLabel.SetActive(false);
     life = FindObjectOfType <LifeDisplay>();
 }
Esempio n. 6
0
 void Start()
 {
     lifeDisplay = FindObjectOfType <LifeDisplay>();
 }
Esempio n. 7
0
 private void Start()
 {
     lifeDisplay     = FindObjectOfType <LifeDisplay>();
     levelController = FindObjectOfType <LevelController>();
 }
Esempio n. 8
0
 public void takeAHit(bool fromRight)
 {
     this.rb2d.AddForce(new Vector2(0, 5), ForceMode2D.Impulse);
     LifeDisplay.setLife(--this.life);
 }