void OnDuckFlee(DuckController duck) { _spawnedDucks.Remove(duck); _ducksMissedThisRound++; UpdateInfoText(); }
// Use this for initialization void Start() { Life = 1; duck = GameObject.Find("Duck").GetComponent <DuckController>(); boss = GameObject.Find("Boss 2").GetComponent <Boss02>(); dx = GameObject.Find("Duck").GetComponent <Transform>().position.x; }
void OnDuckKill(DuckController duck) { m_SpawnedDucks.Remove(duck); m_DucksKilledThisRound++; m_OnDuckKilled.Raise(); }
void OnDuckDeath(DuckController duck) { _spawnedDucks.Remove(duck); _ducksKilledThisRound++; UpdateInfoText(); }
// Use this for initialization void Start() { shieldSpawned = false; playerController = transform.parent.gameObject.GetComponent <DuckController>(); gameManagerScript = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>(); baseDashCooldown = playerController.dashCooldown; baseCanMoveTime = playerController.canMoveCooldownTime; transformParent = transform.parent; shield.SetActive(false); }
// Use this for initialization void SetState(DuckController.Actions currentState) { bool shouldSetActive = false; if(currentState == MyState) { shouldSetActive = true; } renderer.enabled = shouldSetActive; collider2D.enabled = shouldSetActive; }
void Update() { if (enemiesRemainingToSpawn > 0 && Time.time > nextSpawnTime) { enemiesRemainingToSpawn--; nextSpawnTime = Time.time + currentWave.timeBetweenSpawns; DuckController spawnedEnemy = Instantiate(enemy, gameObject.transform.position, Quaternion.identity) as DuckController; spawnedEnemy.transform.parent = gameObject.transform.parent; spawnedEnemy.OnDeath += OnEnemyDeath; } }
private void OnLevelWasLoaded(int level) { // Get the duck controller script reference if (duck == null) { duck = GameObject.FindGameObjectWithTag("Duck").GetComponent <DuckController>(); } // Get the duck controller script reference if (hunter == null) { hunter = GameObject.FindGameObjectWithTag("Hunter").GetComponent <HunterController>(); } }
// Use this for initialization void Start() { // Get the duck controller script reference if (duck == null) { duck = GameObject.FindGameObjectWithTag("Duck").GetComponent <DuckController>(); } // Get the duck controller script reference if (hunter == null) { hunter = GameObject.FindGameObjectWithTag("Hunter").GetComponent <HunterController>(); } }
// Use this for initialization void Start() { RockRigid = GetComponent <Rigidbody2D>(); Aligator = GameObject.Find("Boss01").GetComponent <Transform>(); duck = GameObject.Find("Duck").GetComponent <DuckController>(); if (Aligator.localScale.x > 0) { RockRigid.velocity = speed * -1; Destroy(this.gameObject, 10f); } else if (Aligator.localScale.x < 0) { RockRigid.velocity = speed; Destroy(this.gameObject, 10f); gameObject.GetComponent <Transform>().localScale = this.gameObject.GetComponent <Transform>().localScale * -1; } }
// Use this for initialization void Start() { LaserR = GetComponent <Rigidbody2D>(); Fox = GameObject.Find("Boss03").GetComponent <Transform>(); duck = GameObject.Find("Duck").GetComponent <DuckController>(); if (Fox.localScale.x > 0) { LaserR.velocity = speed * -1; Destroy(this.gameObject, 10f); } else if (Fox.localScale.x < 0) { LaserR.velocity = speed; Destroy(this.gameObject, 10f); gameObject.GetComponent <Transform>().localScale = this.gameObject.GetComponent <Transform>().localScale * -1; } }
void Start() { //Get the characters crab = GameObject.Find("CrabCharacter").GetComponent <CrabController>(); duck = GameObject.Find("Duck").GetComponent <DuckController>(); //Find the duckHealth images duckHealth1 = transform.GetChild(0).GetChild(1).GetComponent <Image>(); duckHealth2 = transform.GetChild(0).GetChild(3).GetComponent <Image>(); duckHealth3 = transform.GetChild(0).GetChild(5).GetComponent <Image>(); //Find the crabhealth images crabHealth1 = transform.GetChild(1).GetChild(1).GetComponent <Image>(); crabHealth2 = transform.GetChild(1).GetChild(3).GetComponent <Image>(); crabHealth3 = transform.GetChild(1).GetChild(5).GetComponent <Image>(); timerText = transform.GetChild(2).GetComponent <Text>(); }
void OnDuckKill(DuckController duck) { _currentScore += duck.GetScore(); }
void OnDuckFled(DuckController duck) { m_SpawnedDucks.Remove(duck); }
// Use this for initialization void Start() { AcidRigid = GetComponent <Rigidbody2D>(); duck = GameObject.Find("Duck").GetComponent <DuckController>(); dx = GameObject.Find("Duck").GetComponent <Transform>().position.x; }
void OnDuckKill(DuckController duck) { var scoreKeeper = duck.GetComponent <DuckScoreKeeper>(); m_CurrentScore.ApplyChange(scoreKeeper.GetScore()); }
void Start() { animator = GetComponent <Animator>(); duckController = GetComponentInParent <DuckController>(); }