// Use this for initialization void Start() { if (GameObject.Find("GameController") != false) { gameInfo = GameObject.Find("GameController").GetComponent <OverworldGameController>().getSingleton(); enemyID = gameInfo.getEnemyID(); } else { enemyID = "Common Robot"; } Rigidbody robotInstance = null; if (enemyID == CommonRobot.tag) { robotInstance = Instantiate(CommonRobot, start, target) as Rigidbody; robotInstance.transform.parent = GameObject.Find("Fix-It Robot").transform; } else if (enemyID == OutsideRobot.tag) { robotInstance = Instantiate(OutsideRobot, start, target) as Rigidbody; robotInstance.transform.parent = GameObject.Find("Fix-It Robot").transform; } else if (enemyID == BigBoss.tag) { robotInstance = Instantiate(BigBoss, start, target) as Rigidbody; robotInstance.transform.parent = GameObject.Find("Fix-It Robot").transform; } if (gameInfo.getBossStatus() && enemyID != BigBoss.tag) { robotInstance.GetComponentInChildren <Renderer>().material.color = new Color(.83f, .69f, .22f, 1f); } }
private void Start() { if (GameObject.Find("GameController") != false) { gameInfo = GameObject.Find("GameController").GetComponent <OverworldGameController>().getSingleton(); enemyID = gameInfo.getEnemyID(); } else { enemyID = "Common Robot"; } if (enemyID == "Outside Robot") { robotTarget.transform.position = new Vector3(-8, -0.15f, 8); } else { robotTarget.transform.position = new Vector3(0, -1, 8); } }
// Use this for initialization void Start() { if (GameObject.Find("GameController") != false) { gameInfo = GameObject.Find("GameController").GetComponent <OverworldGameController>().getSingleton(); enemyID = gameInfo.getEnemyID(); //Debug.Log("Enemy ID is " + enemyID); } else { enemyID = "Common Robot"; } if (enemyID == "Common Robot" || enemyID == "BigBoss") { GetComponent <FixItCommonRobotMovement>().enabled = true; GetComponent <FixItOutsideRobotMovement>().enabled = false; } else { GetComponent <FixItCommonRobotMovement>().enabled = false; GetComponent <FixItOutsideRobotMovement>().enabled = true; } }