예제 #1
0
    /// <summary>
    /// 人工知能
    /// </summary>
    private void AI()
    {
        NormalAI();

        if (HP <= 0 || isStan)
        {
            bulletClass.Stop();
            spawnClass.Stop();
            moveClass.Stop();
        }
    }
예제 #2
0
    /// <summary>
    /// 人工知能
    /// </summary>
    private void AI()
    {
        if (!smashGage.IsMax)
        {
            enemyBulletClass.bulletCount = spawnCount;
            bulletClass.Stop();
            dashClass.Stop();
            rotateClass.Stop();
            dashCount            = 0;
            bulletCount          = bulletTime;
            rigid.sharedMaterial = p_mat;
            rigid.drag           = 0.0f;
        }
        else
        {
            rigid.sharedMaterial = null;
            rigid.drag           = 2.0f;
            if (enemyBulletClass.bulletCount != spawnCountMax)
            {
                currentRV      = Vector2.zero;
                rigid.velocity = currentRV;
                enemyBulletClass.bulletCount = spawnCountMax;
            }
            if (dashCount <= 2)
            {
                bulletCount       = bulletTime;
                dashClass.enabled = true;
                currentRV         = rigid.velocity;
                if (dashClass.IsEnd())
                {
                    dashClass.Stop();
                    dashCount++;
                }
            }
            else
            {
                bulletClass.enabled = true;
                rotateClass.enabled = true;
                bulletCount        -= Time.deltaTime;
                if (bulletCount <= 0.0f)
                {
                    bulletClass.Stop();
                    rotateClass.Stop();
                    dashCount = 0;
                }
            }
        }

        if (enemys.Length > 0)
        {
            enemyBulletClass.Stop();
        }
        else
        {
            enemyBulletClass.enabled = true;
        }

        if (HP <= 0 || isStan)
        {
            enemyBulletClass.Stop();
            bulletClass.Stop();
            dashClass.Stop();
            rotateClass.Stop();
            lookClass.Stop();
            dashCount   = 0;
            bulletCount = bulletTime;
            currentRV   = Vector2.zero;
            isStartMove = false;
        }
        else
        {
            rigid.velocity    = currentRV;
            lookClass.enabled = true;
        }
    }