// Start is called before the first frame update void Start() { gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); rigidbody = GetComponent <Rigidbody>(); BulletSpawn = GameObject.Find("BulletSpawn").transform; slamDetection = GetComponent <SlamDetection>(); }
// Start is called before the first frame update void Awake() { // Set up level stuff. //Enemy spawn Level = GameObject.Find("Level"); EnemyRightSpawn = Level.transform.Find("Platforms").transform.Find("Right").transform.Find("EnemySpawn"); EnemyMiddleSpawn = Level.transform.Find("Platforms").transform.Find("Middle").transform.Find("EnemySpawn"); EnemyLeftSpawn = Level.transform.Find("Platforms").transform.Find("Left").transform.Find("EnemySpawn"); //Player move positions PlayerPosRight = Level.transform.Find("Platforms").transform.Find("Right").transform.Find("PlayerPosition"); PlayerPosMiddle = Level.transform.Find("Platforms").transform.Find("Middle").transform.Find("PlayerPosition"); PlayerPosLeft = Level.transform.Find("Platforms").transform.Find("Left").transform.Find("PlayerPosition"); //Setup Player player = GameObject.Find("Player").GetComponent <Player>(); // get player positions. player.RightPosition = PlayerPosRight; player.MiddlePosition = PlayerPosMiddle; player.LeftPosition = PlayerPosLeft; //assign current level platforms rightPlatform = Level.transform.Find("Platforms").transform.Find("Right").transform.Find("RightPlatform").GetComponent <Platform>(); leftPlatform = Level.transform.Find("Platforms").transform.Find("Left").transform.Find("LeftPlatform").GetComponent <Platform>(); middlePlatform = Level.transform.Find("Platforms").transform.Find("Middle").transform.Find("MiddlePlatform").GetComponent <Platform>(); //Get Portals leftPortal = Level.transform.Find("Platforms").transform.Find("Left").transform.Find("Portal").GetComponent <Portal>(); middlePortal = Level.transform.Find("Platforms").transform.Find("Middle").transform.Find("Portal").GetComponent <Portal>(); rightPortal = Level.transform.Find("Platforms").transform.Find("Right").transform.Find("Portal").GetComponent <Portal>(); // get Level Generation script levelGeneration = GetComponent <LevelGeneration>(); //Get slam detection from player gameobject slamDetection = GameObject.Find("Player").GetComponent <SlamDetection>(); spawnEnemiesHelper = GetComponent <SpawnEnemiesHelper>(); spawnEnemiesHelper.pauseEnemySpawning = true; mobileController = GameObject.Find("MobileController").GetComponent <MobileController>(); }