Exemplo n.º 1
0
    public void EnemyDied(string name)
    {
        if (name == "FirstPhaseBoss(Clone)")
        {
            PlayerController p_controller       = player.GetComponent <PlayerController>();
            BulletController p_bulletController = p_controller.bullet.GetComponent <BulletController>();
            DNARegistry      newRegistry        = new DNARegistry();
            newRegistry.name        = p_controller.playerName;
            newRegistry.mutation    = p_controller.mutationToString();
            newRegistry.life        = p_controller.life;
            newRegistry.maxSpeed    = p_controller.maxSpeed;
            newRegistry.cadency     = p_controller.cadency;
            newRegistry.damage      = p_bulletController.damage;
            newRegistry.bulletSpeed = p_bulletController.speed;
            newRegistry.bulletrange = p_bulletController.range;

            registry.Add(newRegistry);
            Menu_GamePlay._instance.ChangeState(Menu_GamePlay.GameState.WIN);
        }
    }
Exemplo n.º 2
0
    public void playerDied()
    {
        print("Entring in player Died");
        PlayerController p_controller       = player.GetComponent <PlayerController>();
        BulletController p_bulletController = p_controller.bullet.GetComponent <BulletController>();
        DNARegistry      newRegistry        = new DNARegistry();

        newRegistry.name        = p_controller.playerName;
        newRegistry.mutation    = p_controller.mutationToString();
        newRegistry.life        = p_controller.life;
        newRegistry.maxSpeed    = p_controller.maxSpeed;
        newRegistry.cadency     = p_controller.cadency;
        newRegistry.damage      = p_bulletController.damage;
        newRegistry.bulletSpeed = p_bulletController.speed;
        newRegistry.bulletrange = p_bulletController.range;

        registry.Add(newRegistry);

        playerRespawns++;
        Menu_GamePlay._instance.ChangeState(Menu_GamePlay.GameState.OVER);
    }