void Start() { obj = this.gameObject; stateObj = GameObject.Find("GlobalState"); state = stateObj.GetComponent <globalState>(); randomSpeedGenerator(); }
void Start() { basePlatform = this.gameObject; stateObj = GameObject.Find("GlobalState"); state = stateObj.GetComponent <globalState>(); setLevelDifficulty(); for (int i = 0; i < lenght; i++) { Vector2 oldPos = new Vector2(basePlatform.transform.position.x + randPlatformXLocation(), basePlatform.transform.position.y + 2 * (i + platformDistance)); GameObject newPlatform = Instantiate(Resources.Load(randPlatformChooser()), oldPos, basePlatform.transform.rotation) as GameObject; platformList.Add(newPlatform); //Not used } }
// Use this for initialization void Start() { TheOne = this; }