// Use this for initialization void Start() { /*Obtengo instacion de los GameObject cube*/ cubeLeftIndicator = GameObject.FindGameObjectWithTag("cubeLeft"); cubeRightIndicator = GameObject.FindGameObjectWithTag("cubeRight"); /*I define the colors that will be used as indicators "indicatorOn" color to designate the exit of the ball * "IndicatorOff" Color to indicate the standby time */ indicatorOn = new Color(0.2f, 0.2f, 0.2f); indicatorOff = new Color(0, 1, 0); /*Inicio con ambos cubos con el color de espera*/ indicatorRight = indicatorOff; indicatorLeft = indicatorOff; gameM = GameObject.Find("GameManager").GetComponent <GameManagerAtrapalo>(); gameM.ballsAlive++; angle = (180 * gameM.level) / 6; calc = new GameAngles(angle, gameM.planeShootFront, gameM.planeShootLat); timeLaunch = gameM.launchTime; side = true; if (type == 3) { timeLaunch = timeLaunch / 2; } timeArrive = Time.time + timeLaunch; Vector3 pointIni = transform.position; flagArrive = false; //posNew = this.GetComponent<Rigidbody>(); }
// Use this for initialization void Start() { // set the targetTime to be the current time + exitAfterSeconds seconds gameM = GameObject.Find("GameManager").GetComponent <GameManagerAtrapalo>(); float exitAfterSeconds = gameM.launchTime + 3; targetTime = Time.time + exitAfterSeconds; }
void Start() { spawner = GameObject.Find("Spawner").GetComponent <MovementDetectionLibrary.SpawnGameObjects>(); sSpawner = GameObject.Find("Spawner").GetComponent <SpawnGameObjectsBall>(); gameM = GameObject.Find("GameManager").GetComponent <GameManagerAtrapalo>(); if (scoreAmount > 0) { textPoint.text = "+" + scoreAmount.ToString(); } else { textPoint.text = scoreAmount.ToString(); } textPoint.color = getColorBall(scoreAmount); }
// Use this for initialization void Start() { /*Initialize the canon vector to point the player*/ gameM = GameObject.Find("GameManager").GetComponent <GameManagerAtrapalo>(); gameM.ballsAlive++; angle = (180 * gameM.level) / 6; calc = new GameAngles(angle, gameM.planeShootFront, gameM.planeShootLat); timeLaunch = gameM.launchTime; side = true; if (type == 3) { timeLaunch = timeLaunch / 2; } timeArrive = Time.time + timeLaunch; Vector3 pointIni = transform.position; flagArrive = false; //posNew = this.GetComponent<Rigidbody>(); }
// setup the game void Start() { panel_count = GameObject.FindWithTag("CountBalls"); panel_count.SetActive(false); side = true; spawner = GameObject.Find("Spawner").GetComponent <SpawnGameObjectsBall>(); spawner.enabled = false; // set the current time to the startTime specified currentTime = startTime; // get a reference to the GameManager component for use by other scripts if (gms == null) { gms = this.gameObject.GetComponent <GameManagerAtrapalo>(); } // init scoreboard to 0 mainScoreDisplay.text = ""; spawner.enabled = false; // inactivate the gameOverScoreOutline gameObject, if it is set if (gameOverScoreOutline) { gameOverScoreOutline.SetActive(false); } // inactivate the playAgainButtons gameObject, if it is set if (playAgainButtons) { playAgainButtons.SetActive(false); } // inactivate the nextLevelButtons gameObject, if it is set if (nextLevelButtons) { nextLevelButtons.SetActive(false); } if (countdownDisplayObject) { countdownDisplay = countdownDisplayObject.GetComponent <Text>(); } }