// Use this for initialization void Awake() { gameManager = GameObject.Find("Main Camera").GetComponentInChildren <GameManager>(); if (this.name == "Raft" || this.name == "Raft(Clone)") { this.name = "Raft"; enemyClass = EnemyData.CreateEnemy(0); } if (this.name == "Rowboat" || this.name == "Rowboat(Clone)") { this.name = "Rowboat"; enemyClass = EnemyData.CreateEnemy(1); } if (this.name == "Ship" || this.name == "Ship(Clone)") { this.name = "Ship"; enemyClass = EnemyData.CreateEnemy(2); } this.gameObject.name = this.enemyClass.Name; enemyNavScript = this.GetComponent <EnemyNav>(); Debug.Log("I am a " + this.name); health = this.enemyClass.Health; speed = this.enemyClass.Speed; this.GetComponent <NavMeshAgent>().speed = speed; this.GetComponent <EnemyNav>().speed = speed; }