private void Start() { mainCanvas = FindObjectOfType(typeof(Canvas)) as Canvas; uiManager = UiManager.Instance; ballManager = BallManager.Instance; touchControlManager = TouchControlManager.Instance; }
private void Start() { //gets instances gameEnvironmentSetUp = gameObject.AddComponent <GameEnvironmentSetUp>() as GameEnvironmentSetUp; touchControlManager = TouchControlManager.Instance; //gets datas saved SaveLoad.Load(); gameDatas = SaveLoad.gameDatas; WholePlatform = new GameObject("wholePlatform"); PlatformCount = gameDatas.PlatformCount; //get harder point settings firstGetHarderPoint = (PlatformCount * 25) / 100; secondGetHarderPoint = (PlatformCount * 50) / 100; thirdGetHarderPoint = (PlatformCount * 75) / 100; PlatformSetUp(); MakeControlPointForARing(); }
private void Start() { //gets instances uiManager = UiManager.Instance; gameManager = GameManager.Instance; gameEnvironmentSetUp = gameObject.AddComponent <GameEnvironmentSetUp>() as GameEnvironmentSetUp; touchControlManager = TouchControlManager.Instance; levelSettings = gameObject.AddComponent <LevelSettings>(); gameDatas = new GameDatas(); //get datas that is saved SaveLoad.Load(); BestScore = SaveLoad.gameDatas.BestScore; LevelCount = SaveLoad.gameDatas.LevelCount; platformCount = SaveLoad.gameDatas.PlatformCount; targetForCamera = GameObject.FindWithTag("targetForCamera"); mainCanvas = FindObjectOfType(typeof(Canvas)) as Canvas; //calculates initial distance between ball and targetForCamera object targetOffset = targetForCamera.transform.position - transform.position; bestScoreObject = mainCanvas.transform.Find("bestScore").gameObject; }