示例#1
0
    void Start()
    {
        gm = FindObjectOfType <Gamemode>();
        rb = GetComponent <Rigidbody2D>();
        ss = FindObjectOfType <ScreenShake>();
        rm = FindObjectOfType <RoomManager>();

        //Increase enemy count
        gm.enemyCount++;

        //Change name of enemy, including the enemy count
        name = "Enemy " + gm.enemyCount;

        sr           = GetComponentInChildren <SpriteRenderer>();
        player       = GameObject.Find("Player");
        playerScript = player.GetComponent <Player>();


        seeker = GetComponent <Seeker>();

        InvokeRepeating("UpdatePath", 0f, navUpdateTimer);

        // This must be placed after all the values are set
        // If the enemy is a boss, ensure their statistics are not boss amounts
        if (!GetComponent <Enemy>().isBoss)
        {
            //gm.bossBulletScaleIncCur = 1;
            gm.bossBulletIncScaleRateCur = 1;
            gm.bossBulletDamageCur       = 1;
            gm.bossBulletSpeedCur        = 1;
            gm.bossBulletDistCur         = 1;
            gm.bossScaleCur         = 1;
            gm.bossSpeedCur         = 1;
            gm.bossMaxHealthCur     = 1;
            gm.bossShotCooldownCur  = 1;
            gm.bossBulletSizeInfCur = 1;
            gm.BossAimBot           = 1;
        }

        else
        {
            gm.bossBulletIncScaleRateCur = gm.bossBulletIncScaleRateDef;
            gm.bossBulletDamageCur       = gm.bossBulletDamageDef;
            gm.bossBulletSpeedCur        = gm.bossbulletSpeedDef;
            gm.bossBulletDistCur         = gm.bossBulletDistDef;
            gm.bossScaleCur         = gm.bossScaleDef;
            gm.bossSpeedCur         = gm.bossSpeedDef;
            gm.bossMaxHealthCur     = gm.bossMaxHealthDef;
            gm.bossShotCooldownCur  = gm.bossShotCooldownDef;
            gm.bossBulletSizeInfCur = gm.bossBulletSizeInfDef;
        }
        gm.bossEnragedBulletSizeInfCur = 1;

        // Set health of enemy
        gm.e_MaxHealth *= gm.bossMaxHealthCur;

        gm.GetSwitchTimer();

        Reset();
        SetSize();
    }