示例#1
0
    void OnDuckFlee(DuckController duck)
    {
        _spawnedDucks.Remove(duck);

        _ducksMissedThisRound++;
        UpdateInfoText();
    }
示例#2
0
 // 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;
 }
示例#3
0
    void OnDuckKill(DuckController duck)
    {
        m_SpawnedDucks.Remove(duck);
        m_DucksKilledThisRound++;

        m_OnDuckKilled.Raise();
    }
示例#4
0
    void OnDuckDeath(DuckController duck)
    {
        _spawnedDucks.Remove(duck);

        _ducksKilledThisRound++;
        UpdateInfoText();
    }
示例#5
0
 // 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);
 }
示例#6
0
    // Use this for initialization
    void SetState(DuckController.Actions currentState)
    {
        bool shouldSetActive = false;
        if(currentState == MyState) {
            shouldSetActive = true;
        }

        renderer.enabled = shouldSetActive;
        collider2D.enabled = shouldSetActive;
    }
示例#7
0
    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;
        }
    }
示例#8
0
 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>();
     }
 }
示例#9
0
 // 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>();
     }
 }
示例#10
0
    // 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;
        }
    }
示例#11
0
    // 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;
        }
    }
示例#12
0
    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>();
    }
示例#13
0
 void OnDuckKill(DuckController duck)
 {
     _currentScore += duck.GetScore();
 }
示例#14
0
 void OnDuckFled(DuckController duck)
 {
     m_SpawnedDucks.Remove(duck);
 }
示例#15
0
 // Use this for initialization
 void Start()
 {
     AcidRigid = GetComponent <Rigidbody2D>();
     duck      = GameObject.Find("Duck").GetComponent <DuckController>();
     dx        = GameObject.Find("Duck").GetComponent <Transform>().position.x;
 }
示例#16
0
    void OnDuckKill(DuckController duck)
    {
        var scoreKeeper = duck.GetComponent <DuckScoreKeeper>();

        m_CurrentScore.ApplyChange(scoreKeeper.GetScore());
    }
示例#17
0
 void Start()
 {
     animator       = GetComponent <Animator>();
     duckController = GetComponentInParent <DuckController>();
 }