예제 #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
파일: GameManager.cs 프로젝트: MinusPL/DHVR
    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
파일: GameManager.cs 프로젝트: MinusPL/DHVR
 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>();
 }