//private bool destroyed = false; void Start(){ soundManager = gameObject.GetComponentInChildren<SoundManager>(); energy = maxEnergy; score = FindObjectOfType(typeof(ScoreKeeper)) as ScoreKeeper; playerControl = gameObject.GetComponentInChildren<PlayerControl>(); playerGUI = gameObject.GetComponentInChildren<PlayerGUI>(); playerHealth = gameObject.GetComponentInChildren<PlayerHealth>(); thrust = gameObject.GetComponentInChildren<Thrust>(); shield = gameObject.AddComponent<Shield>() as Shield; shield.PDelegate = this; foreach(Weapon weapon in gameObject.GetComponentsInChildren(typeof(IWeapon))){ if(weapon.gameObject.name == "Left weapon"){ leftWeapon = weapon; leftWeapon.soundManager = soundManager; }else if(weapon.gameObject.name == "Right weapon"){ rightWeapon = weapon; rightWeapon.soundManager = soundManager; } } StartCoroutine("RegenerateEnergy"); }
// Use this for initialization void Start() { movementVelocity = new Vector2 (Random.Range (-1f, 1f), -fallSpeed); GetComponent<Rigidbody2D>().velocity = movementVelocity; enemySounds = GameObject.FindObjectOfType<SoundController>(); scoreKeeper = GameObject.FindObjectOfType<ScoreKeeper>(); }
void Start() { scoreKeeper = GameObject.Find("Score").GetComponent<ScoreKeeper>(); explosionSound = GameObject.FindObjectOfType<AudioClip>(); spawnerLevel = GameObject.FindObjectOfType<EnemySpawner>(); //shots per second increases with level shotsPerSecond = spawnerLevel.beginningLevel / 3; }
// Use this for initialization void Start () { float distanceToCamera = this.transform.position.z - Camera.main.transform.position.z; this.xMin = Camera.main.ViewportToWorldPoint( new Vector3( 0, 0, distanceToCamera) ).x + (this.width / 2); this.xMax = Camera.main.ViewportToWorldPoint( new Vector3( 1, 0, distanceToCamera) ).x - (this.width / 2); this.score = GameObject.FindObjectOfType<ScoreKeeper> (); this.SpawnUntilFull(); }
public void Start() { gameObject.transform.parent = MapManager.instance.ParticlesTransform; switch (mBulletTargetNumber) { case 1: mPlayer = VehiclesManager.instance.Player1Ship.gameObject; break; case 2: mPlayer = VehiclesManager.instance.Player2Ship.gameObject; break; default: //mPlayer = VehiclesManager.instance.Player1Ship.gameObject; break; } mScoreKeeper = ScoreKeeper.instance; //Vector2 bulletForce; //Used for firing in a particular pattern (i.e. rotational pattern on boss horns)~Adam if (mFixedFireDir) { bulletForce = mFireDir * mBulletSpeed; //transform.rotation = Quaternion.Euler(new Vector3(90f,0f,0f) + transform.rotation.eulerAngles); } //Used for aiming at the player ~Adam else if (mAimAtPlayer) { Vector3 directionToPlayer = Vector3.down; //fire at the player directionToPlayer = mPlayer.transform.position - transform.position; bulletForce = Vector3.Normalize (directionToPlayer) * mBulletSpeed; transform.LookAt (mPlayer.transform.position); transform.rotation = Quaternion.Euler (new Vector3 (90f, 0f, 0f) + transform.rotation.eulerAngles); } //For constantly tracking/homing in on the player else if (mMoveTowardsPlayer) { Vector3 directionToPlayer = Vector3.down; //fire at the player directionToPlayer = mPlayer.transform.position - transform.position; bulletForce = Vector3.Normalize (directionToPlayer) * mBulletSpeed; transform.LookAt (mPlayer.transform.position); transform.rotation = Quaternion.Euler (new Vector3 (90f, 0f, 0f) + transform.rotation.eulerAngles); } //Just fire up and down ~Adam else { //Fire straight down bulletForce = new Vector2(0.0f,mBulletSpeed * -1.0f); } GetComponent<Rigidbody2D> ().velocity = bulletForce; }
// Use this for initialization void Start () { if (Instance != null && Instance != this) Destroy(gameObject); Instance = this; //DontDestroyOnLoad(gameObject); m_currentCrowd = maxCrowd / 2; currentBar.fillAmount = currentCrowd / maxCrowd; }
public MainForm() { InitializeComponent(); this.DoubleBuffered = true; // removes flickering seen on some systems scoreKeeper = new ScoreKeeper(); frmHighScores = new ScoreTableForm(); frmHighScores.StartPosition = FormStartPosition.CenterParent; StartGame(); }
// Use this for initialization void Start () { scoreKeeper = GameObject.Find("ScoreKeeper").GetComponent<ScoreKeeper>(); currentLvlPositions = sessions[currentSession].levels[currentSessionLvl].levelData; timerUI = GameObject.Find ("Timer").GetComponent<UILabel> (); gameOver = GameObject.Find ("Game Over").GetComponent<UILabel> (); finalScore = GameObject.Find ("Final Score").GetComponent<UILabel> (); loadCurrentLevel(); }
void Start() { float distanceToCamera = transform.position.z - Camera.main.transform.position.z; Vector3 leftBoudary = Camera.main.ViewportToWorldPoint(new Vector3(0,0, distanceToCamera)); Vector3 rightBoudary = Camera.main.ViewportToWorldPoint(new Vector3(1,0, distanceToCamera)); xMax = rightBoudary.x; xMin = leftBoudary.x; SpawnUntilFull(); scoreKeeper = GameObject.Find("GameController").GetComponent<ScoreKeeper>(); }
// Use this for initialization void Start() { spawnUntilFull(); scoreKeeper = GameObject.Find("Score").GetComponent<ScoreKeeper>(); float distance = transform.position.z - Camera.main.transform.position.z; Vector3 leftmost = Camera.main.ViewportToWorldPoint(new Vector3(0,0,distance)); Vector3 rightmost = Camera.main.ViewportToWorldPoint(new Vector3(1,0,distance)); maxLeft = leftmost.x + (width/2); maxRight = rightmost.x - (width/2); }
private void Awake() { scoreKeeper = FindObjectOfType <ScoreKeeper>(); if (gameObject.CompareTag("Player")) { HUD = FindObjectOfType <Canvas>(); playerRank = HUD.GetComponentInChildren <UpdatePlayerScore>(); } }
/// <summary> /// Retrieve the necessary object and script references /// </summary> void Start() { GameObject gameController = GameObject.FindGameObjectWithTag("GameController"); gameTimer = gameController.GetComponent<GameTimer>(); scoreKeeper = gameController.GetComponent<ScoreKeeper>(); referee = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>(); breakTimer = GameObject.Find("BreakTimer").GetComponent<BreakTimer>(); timer = gameObject.GetComponent<Timer>(); timer.SetLengthOfTimer(announcementPauseLength); }
void OnTriggerEnter(Collider otherCollider) { if (otherCollider == expectedcollider) { ScoreKeeper scoreKeeper = FindObjectOfType <ScoreKeeper>(); scoreKeeper.ScoreIncrement(scoreAmount); AudioSource score = GetComponent <AudioSource>(); score.Play(); } }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
void Start() { float distance = transform.position.z - Camera.main.transform.position.z; Vector3 leftmost = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, distance)); Vector3 rightmost = Camera.main.ViewportToWorldPoint(new Vector3(1, 0, distance)); xmin = leftmost.x + padding; xmax = rightmost.x - padding; scoreKeeper = GameObject.Find("Score").GetComponent <ScoreKeeper>(); }
void Update() { countdown -= Time.deltaTime; TextTimer.time = countdown; if (countdown < 0) { ScoreKeeper scorekeeper = GameObject.Find("Score Keeper").GetComponent <ScoreKeeper>(); scorekeeper.EndScore(); //Call the score keeper script to display game over Ui } }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody2D>(); scoreKeeper = GameObject.Find("Score").GetComponent <ScoreKeeper>(); InvokeRepeating("ScorePoints", 0.0001f, 1.0f); timer = 0; AudioS = GetComponent <AudioSource>(); print(PlayerPrefs.GetInt("highestScore")); bomb = GetComponentInChildren <Bomb>(); bomb.gameObject.SetActive(false); }
private void OnMouseDown() { Debug.Log("You clicked the tile"); ScoreKeeper scoreKeeper = GameObject.FindObjectOfType <ScoreKeeper>(); if (scoreKeeper != null) { scoreKeeper.IncrementScore(); } Destroy(gameObject); }
// Start is called before the first frame update void Start() { sessionManager = FindObjectOfType <SessionManager>(); scoreText.text = "0"; saveLoader = FindObjectOfType <SaveLoader>(); scoreKeeper = FindObjectOfType <ScoreKeeper>(); antonymsSfxManager = FindObjectOfType <AntonymsSfxManager>(); endScreenContainer.SetActive(false); gameContainer.SetActive(false); Invoke("SetupGame", 3f); }
//------------------------------------------------------------------------- void Awake() { if (_instance == null) { _instance = this; } else { Object.Destroy(this); } }
// Will show new highScore banner public void NewHighScore(bool highScore) { if (highScore) { highscoreText.text = "!!NEW HIGHSCORE!!"; } else { highscoreText.text = "HIGHSCORE: " + ScoreKeeper.GetTotalHightScore(); } }
public void LoadMainMenu() { StopAllCoroutines(); ScoreKeeper scoreKeeper = GameObject.FindObjectOfType <ScoreKeeper>(); if (scoreKeeper != null) { Destroy(scoreKeeper.gameObject); } PhotonNetwork.LoadLevel(NetworkCustomSettings.MAIN_MENU_SCENE); }
private void Scored() { SpriteRenderer render = gameObject.GetComponent <SpriteRenderer>(); float mass = gameObject.GetComponent <Rigidbody2D>().mass; if (render.color != Color.green) { ScoreKeeper.AddToScore(mass); render.color = Color.green; } }
// Use this for initialization void Start() { float distanceZ = transform.position.z - Camera.main.transform.position.z; Vector3 leftMost = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, distanceZ)); Vector3 rightMost = Camera.main.ViewportToWorldPoint(new Vector3(1, 0, distanceZ)); xmin = leftMost.x + padding; xmax = rightMost.x - padding; scoreKeeper = GameObject.FindObjectOfType <ScoreKeeper>(); levelManager = GameObject.FindObjectOfType <LevelManager>(); }
protected CourtRound getCurrentCourtRound(ScoreKeeper scoreKeeper) { if (scoreKeeper != null) { return(getCurrentCourtRound(scoreKeeper.AssociatedAccessCode)); } else { return(null); } }
private void SetHighscores() { //Załadowanie Highscorów StreamReader sr; string line; List <int> hsText = new List <int>(); #if UNITY_EDITOR sr = new StreamReader("Assets/Scripts/highscores.txt"); #else sr = new StreamReader("highscores.txt"); #endif line = sr.ReadLine(); while (line != null) { hsText.Add(Int32.Parse(line)); line = sr.ReadLine(); } sr.Close(); hsText.Sort(); hsText.Reverse(); int i = 1; foreach (Text hs in hsList) { string score; if (i <= hsText.Count) { score = hsText[i - 1] + ""; //Tutaj załadowany wynik } else { score = "-"; } string spc = ""; if (i < 10) { spc = " "; } hs.text = spc + i + ". " + score; i++; } string rankstring = (hsText.IndexOf(ScoreKeeper.getScore()) + 1).ToString(); if (hsText.IndexOf(ScoreKeeper.getScore()) == 0) { yourRank.color = new Color(223f / 255f, 0f, 0f); rankstring += "!"; //Sexy Nigiri code panel.GetComponent <Image>().sprite = sexyNigiri; } yourRank.text = rankstring; }
// Start is called before the first frame update void Awake() { if (Singleton != null) { Destroy(this); } else { Singleton = this; } }
// Use this for initialization void Start() { instance = this; Score = 0.0f; presentCount = 0; decorationCount = 0; ScoreTxt.text = Score.ToString(); PresentCountTxt.text = presentCount.ToString(); scoreTXTPos = ScoreTxt.transform.position; presentTXTPos = Camera.main.WorldToScreenPoint(PresentCountTxt.transform.position); }
// Use this for initialization void Start() { Text text = GetComponent <Text>(); if (text) { int score = ScoreKeeper.GetScore(); text.text = "Score: " + score.ToString(); ScoreKeeper.Reset(); } }
void setYOffset() //Keeping camera rig at ground level { if (ScoreKeeper.ballInHole()) { yOffset = 0.079f; } else { yOffset = -0.025f; } }
// Use this for initialization void Start() { ScoreKeeper oldKeeper = FindObjectOfType <ScoreKeeper> (); attempts = 1; if (oldKeeper) { attempts = oldKeeper.attempts; Destroy(oldKeeper.gameObject); } }
// Use this for initialization void Start() { float distance = transform.position.z - Camera.main.transform.position.z; Vector3 leftmost = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, distance)); Vector3 rightmost = Camera.main.ViewportToWorldPoint(new Vector3(1, 1, distance)); xmin = leftmost.x + padding; xmax = rightmost.x - padding; sk = GameObject.Find("Score").GetComponent<ScoreKeeper>(); }
private void Scored() { GetComponent <SpriteRenderer>().color = Color.green; float mas = GetComponent <Rigidbody2D>().mass; if (gameObject.tag != "Scored") { ScoreKeeper.AddToScore(mas); gameObject.tag = "Scored"; // Make sure each box only scores once } }
// Start is called before the first frame update void Start() { sessionManager = FindObjectOfType <SessionManager>(); saveLoader = FindObjectOfType <SaveLoader>(); scoreKeeper = FindObjectOfType <ScoreKeeper>(); endScreenContainer.SetActive(false); gameContainer.SetActive(true); spawnTimer = spawnRate; intro.SetActive(true); Invoke("StartGame", 3f); }
/// <summary> /// Initialize all variables needed for this script to run. /// </summary> void Start () { timer = GetComponent<Timer>(); timer.SetLengthOfTimer(halfLength + 1); timer.Pause(); referee = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>(); GameObject gameController = GameObject.FindGameObjectWithTag("GameController"); scoreKeeper = gameController.GetComponent<ScoreKeeper>(); ballReset = gameController.GetComponent<BallReset>(); breakTimer = GameObject.Find("BreakTimer").GetComponent<BreakTimer>(); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(this); } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { ScoreKeeper scoreKeeper = GameObject.FindObjectOfType <ScoreKeeper>(); if (scoreKeeper != null) { scoreKeeper.IncrementScore(); } } }
protected override void Start() { base.Start(); scoreKeeper = GameObject.Find("Score").GetComponent <ScoreKeeper>(); OnDestroyHandler += () => { AudioSource.PlayClipAtPoint(explosionSFX, transform.position); scoreKeeper.Score(Score); }; }
// Use this for initialization void Start() { ScoreKeeper oldKeeper = FindObjectOfType <ScoreKeeper>(); score = 1; if (oldKeeper) { score = oldKeeper.score; Destroy(oldKeeper.gameObject); } }
private void Update() { if (Time.timeSinceLevelLoad - timeCreation >= expireTime) //se il tempo è scaduto allora emetti suono per la bolla che scompare e aggiorno il punteggio { AudioSource.PlayClipAtPoint(bubbleDisappear, transform.position, volume); ScoreKeeper.Miss(); Destroy(gameObject); BubbleSpawner.timeElapsedBubbles.Add(expireTime);// [ID] = expireTime; //Debug.Log("ID della bolla non colpita: " + ID); } }
// Use this for initialization void Start() { ScoreKeeper[] scoreKeepers = GameObject.FindObjectsOfType<ScoreKeeper>(); foreach (ScoreKeeper scoreKeeper in scoreKeepers) { if (1 == scoreKeeper.teamNumber) { T1ScoreKeeper = scoreKeeper; } else if (2 == scoreKeeper.teamNumber) { T2ScoreKeeper = scoreKeeper; } } spawnManager = FindObjectOfType<SpawnManager>(); gameManager = FindObjectOfType<GameManager>(); audioSource = GetComponent<AudioSource>(); }
// Use this for initialization void Start() { scoreKeeper = GameObject.Find("Score Text").GetComponent<ScoreKeeper>(); anglePerShip = 360.0f / numberOfSupportShips; for (int i = 0; i < numberOfSupportShips; i++) { Transform ship = Instantiate(supportShipPrefab) as Transform; //ship.parent = transform; supportShips.Add(ship); } }
private void Start() { //Me creo 2 vectores que me van a indicar las posiciones en 3D del punto mas a la izq y del de mas a la derecha float distance = transform.position.z - Camera.main.transform.position.z; Vector3 leftMost = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, distance)); Vector3 rightMost = Camera.main.ViewportToWorldPoint(new Vector3(1, 0, distance)); minX = leftMost.x + padding; maxX = rightMost.x - padding; scorekeeper = GameObject.Find("Score").GetComponent <ScoreKeeper>(); }
private void Start() { PlayerAC = GetComponent <Animator>(); RB = GetComponent <Rigidbody2D>(); PM = GetComponent <PlayerMovement>(); PlayerScale = GetComponent <Transform>(); SK = SKObject.GetComponent <ScoreKeeper>(); AttackCode = GetKey(Key.Attack); UpCode = GetKey(Key.Up); DownCode = GetKey(Key.Down); }
void OnEnable() { OnCardActivateEvent += AddCard; OnCardDeactivateEvent += RemoveCard; webSocketManager = FindObjectOfType <WebSocketManager>(); cardGenerator = FindObjectOfType <CardGenerator>(); hexgrid = FindObjectOfType <HexGrid>(); turnController = FindObjectOfType <TurnController>(); scorekeeper = GetComponent <ScoreKeeper>(); infoGetter = FindObjectOfType <InformationGetter>(); reset = false; }
// Use this for initialization void Start() { TimeSpawned = Time.time; shootTimer = Time.time - 3f; GameObject scoreKeeperObject = GameObject.FindWithTag ("ScoreKeeper"); if (scoreKeeperObject != null) { scoreKeeper = scoreKeeperObject.GetComponent <ScoreKeeper> (); } if (scoreKeeper == null) { Debug.Log ("Can't find 'ScoreKeeper' script"); } }
// Use this for initialization void Start() { //Calculate edge of camera view to set ship boundaries float distance = transform.position.z - Camera.main.transform.position.z; Vector3 leftmost = Camera.main.ViewportToWorldPoint(new Vector3(0,0, distance)); Vector3 rightmost = Camera.main.ViewportToWorldPoint(new Vector3(1, 0, distance)); xmin = leftmost.x + padding; xmax = rightmost.x - padding; scoreKeeper = GameObject.FindObjectOfType<ScoreKeeper>(); shields = GameObject.FindObjectOfType<ShieldStrength>(); shields.Shields(health); }
// Use this for initialization void Start () { maxHealth = health; levelManager = FindObjectOfType<LevelManager>(); anim = GetComponent<Animator>(); limitBreak = FindObjectOfType<LimitBreak>(); if (GetComponent<Defender>()) { playerHealthBar = FindObjectOfType<HealthBar>(); playerHealthBar.SetMaxHealth (maxHealth); playerHealthBar.UpdateDisplay (health); } scoreKeeper = GameObject.Find("Score").GetComponent<ScoreKeeper>(); }
// Use this for initialization void Start() { /*if (targetPos.y < transform.position.y) { //targetPos.y = targetPos.y * -1; speed = -speed; } //2D Equivalent to LookAt(); Quaternion rotation = Quaternion.LookRotation (targetPos - transform.position, transform.TransformDirection(Vector3.up)); transform.rotation = new Quaternion(0, 0, rotation.z, rotation.w);*/ print ("bullet target " + targetPos); GameObject scoreKeeperObject = GameObject.FindWithTag ("ScoreKeeper"); if (scoreKeeperObject != null) { scoreKeeper = scoreKeeperObject.GetComponent <ScoreKeeper> (); } if (scoreKeeper == null) { Debug.Log ("Can't find 'ScoreKeeper' script"); } Destroy(gameObject, 5f); }
// Use this for initialization void Start() { mScoreKeeper = FindObjectOfType<ScoreKeeper>(); ScaleBulletTime(); }
// Use this for initialization void Start() { //Locking the ships movement until the animation is finished. startMoving = false; //Capturing the camera perspective so we can restrict it later float distance = transform.position.z - Camera.main.transform.position.z; Vector3 leftBottom = Camera.main.ViewportToWorldPoint (new Vector3 (0,0,distance)); Vector3 rightTop = Camera.main.ViewportToWorldPoint (new Vector3 (1, 1, distance)); //Gets the animator to see when the intro animation is completed. animator = this.GetComponent<Animator> (); //Time Ellapsed since we got the new random direction timeEllapsed = 0f; //Getting the width and height of the sprite to create the valid bounds of the ship's movement spriteWidth = this.GetComponent<SpriteRenderer> ().bounds.size.x; spriteHeight = this.GetComponent<SpriteRenderer> ().bounds.size.y; //Establishing the bounds of the ships movement. maxX = rightTop.x - spriteWidth/2; minX = leftBottom.x + spriteWidth/2; maxY = rightTop.y - spriteHeight/2; minY = leftBottom.y + spriteHeight/2 + 2; //Establishing the first direction dir = getNewDirection(); position = this.transform.position; //Setting up the Health health = 50f; hit = this.GetComponent<AudioSource> (); //Getting the ScoreKeeper scoreboard = GameObject.Find ("Score").GetComponent<ScoreKeeper>(); }
void Start() { InvokeRepeating("Fire", fireRate, fireRate); scoreKeeper = GameObject.Find("Score").GetComponent<ScoreKeeper>(); }
void Start() { _scoreKeeper = GameObject.FindObjectOfType<ScoreKeeper> (); _particles = GameObject.FindObjectOfType<ParticleSystem> (); _shaker = GameObject.FindObjectOfType<Shaker> (); _successAudio = GameObject.Find ("Success SFX").GetComponent<AudioSource> (); _shrinkCurve = new AnimationCurve (new Keyframe (0, 1), new Keyframe (10000, 1), new Keyframe (10000 + (shrinkDuration * 0.1F), 1.25F), new Keyframe (10000 + shrinkDuration, 0)); _numberOfRings = transform.childCount; _startTime = Time.time; _lastTriggerTime = 0; _save = FindObjectOfType <Save> (); SetTargetScaleMultiplier(); }
void Start() { // Reset 'spriteTimer' spriteTimer = 0; movementTimer = 0; maxHealth = health; // So, two ways to grab a script. The first is more specific, including the actual // game object it's attached to. The second is very general and should only be used // when there is only one instance of the script. scoreKeeper = GameObject.Find("Score").GetComponent<ScoreKeeper>(); enemySounds = FindObjectOfType<SoundController>(); player = GameObject.Find ("Player"); gameObject.GetComponentInChildren<ParticleSystem>().enableEmission = false; }
private void Awake() { m_ScoreKeeper = GameObject.Find ("Score").GetComponent<ScoreKeeper> (); }
void Awake() { S = this; }
void Start() { scoreKeeper = GameObject.Find("Score").GetComponent<ScoreKeeper>(); }
// Use this for initialization void Start() { scoreKeeper = FindObjectOfType<ScoreKeeper>(); text = GetComponent<Text>(); }
void Start() { scoreKeeper = GameObject.Find("Score").GetComponent<ScoreKeeper>(); powerSpawner = GameObject.FindObjectOfType<PowerUpSpawner>(); }
// Use this for initialization void Start() { health *= Multiplier.enemyHealth; DinoSpeed *= Multiplier.enemySpeed; money = GameObject.Find ("Main Camera").GetComponent<Itemizer>(); Player = GameObject.Find("Player"); HYPECounter = GameObject.Find("Player").GetComponent<ScoreKeeper>(); transform.localEulerAngles = new Vector3 (0, 180, 0); ledgeAnimator.Play ("dinoPlat_idle"); }