Inheritance: MonoBehaviour
示例#1
0
 //instantiations for script references
 void Start()
 {
     changeBG     = GameObject.FindGameObjectWithTag("Background").GetComponent <ChangeBackground> ();
     player       = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControl>();
     playerHealth = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerHealth>();
     camera       = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraControl>();
     platforms    = GameObject.FindGameObjectWithTag("Ground").GetComponent <SpawnPlatforms>();
     birds        = GameObject.FindGameObjectWithTag("Bird").GetComponent <BirdAI>();
     enemy1       = GameObject.FindGameObjectWithTag("Enemy1").GetComponent <Enemy1AI>();
 }
示例#2
0
 // Use this for initialization
 void Start()
 {
     enemyAI = this.gameObject.AddComponent <Enemy1AI> ();
 }
示例#3
0
 void Start()
 {
     followingPlayer = false;
     ai = GetComponent <Enemy1AI>();
 }