// Use this for initialization
 void Start()
 {
     MyRendere = GetComponent <Renderer>();
     if (gameObject.name == "Player")
     {
         IsPlayer = true;
         MCS      = this.GetComponent <MainCharScript>();
     }
 }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        _collider = GetComponentInChildren <BoxCollider2D>();
        _animator = GetComponent <Animator>();

        _hpText = GetComponentsInChildren <Text>()
                  .Single(t => t.name == "HPText");

        _timeText = GetComponentsInChildren <Text>()
                    .Single(t => t.name == "TimeText");


        _scoreScript = GameObject.Find("ScoreText")
                       .GetComponent <Text>()
                       .GetComponent <ScoreScript>();

        _mainCharScript = GameObject.Find("Max")
                          .GetComponent <MainCharScript>();

        _spawnScript = GameObject.Find("EnemySpawner2")
                       .GetComponent <EnemySpawnScript2>();

        _hpText.text = hp.ToString();
    }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     MCS = this.GetComponent <MainCharScript>();
 }
 // Use this for initialization
 void Start()
 {
     MCS       = Player.GetComponent <MainCharScript>();
     MyRendere = GetComponent <Renderer>();
 }