コード例 #1
0
    public virtual void ResetValues()
    {
        currentHealth           = entity.maxHealth;
        currentHealthWrongColor = entity.maxHealth;
        canReceiveDamage        = false;

        spawnAnimationEnded    = true;
        attackAnimationTrigger = false;
        attackAnimationEnded   = true;
        dieAnimationEnded      = true;

        target = null;

        SetPlayer(null);
        lookAtPlayer = true;

        capacitorController = null;
        deviceController    = null;

        lastShotDirection = Vector3.zero;
        lastShotSameColor = false;
        lastShotPlayer    = null;

        groupInfo = null;
    }
コード例 #2
0
    private IEnumerator spawnDelayedEnemy(EnemyGroupInfo enemy) //Spawns a delay enemy
    {
        yield return(new WaitForSeconds(enemy.SpawnDelay));     //Wait

        //SpawnEnemy(enemy, WaveManager.instance.getRandomSpawnPos(enemy.Type).Use()); //Spawn the enemy in
        SpawnEnemy(enemy); //Spawn the enemy in
    }
コード例 #3
0
    public SpawnSpiderGroupWaveAction(string spPoint, List <AIAction> leader, List <AIAction> attack, List <AIAction> infect, FormationType form, int[] col, float iniDel = 0f, SpiderAIBehaviour.SpawnAnimation spawnAnim = SpiderAIBehaviour.SpawnAnimation.FLOOR)
    {
        spawnPointName = spPoint;
        leaderActions  = leader;
        attackActions  = attack;
        infectActions  = infect;
        initialDelay   = iniDel;
        formation      = form;
        colors         = col;
        spawnAnimation = spawnAnim;
        spiderIndex    = 0;

        enemyMng = rsc.enemyMng;


        switch (formation)
        {
        case FormationType.ROLLING:
            followersActions = new List <AIAction>[4] {
                null, enemyMng.rolling, enemyMng.rolling, enemyMng.rolling
            };
            break;

        case FormationType.THREE_FRONT:
            followersActions = new List <AIAction>[4] {
                null, enemyMng.three_front_1, enemyMng.three_front_2, enemyMng.three_front_3
            };
            break;

        case FormationType.THREE_BACK:
            followersActions = new List <AIAction>[4] {
                null, enemyMng.three_back_1, enemyMng.three_back_2, enemyMng.three_back_3
            };
            break;

        case FormationType.TRIANGLE:
            followersActions = new List <AIAction>[5] {
                null, enemyMng.triangle_1, enemyMng.triangle_2, enemyMng.triangle_3, enemyMng.triangle_4
            };
            break;

        case FormationType.QUAD:
            followersActions = new List <AIAction>[5] {
                null, enemyMng.quad_1, enemyMng.quad_2, enemyMng.quad_3, enemyMng.quad_4
            };
            break;

        default:
            break;
        }

        groupInfo = new EnemyGroupInfo();
        groupInfo.followersCount    = followersActions.Length - 1;
        groupInfo.leaderActionIndex = 0;
    }
コード例 #4
0
    public void AIInitGroup(SpawnAnimation spawnAnimation, EnemyGroupInfo groupInfo, List <AIAction> leaderList, List <AIAction> followerList, List <AIAction> attackList, List <AIAction> infectList, bool isLeader = false)
    {
        spiderBlackboard.ResetValues();
        spiderBlackboard.spawnAnimation = spawnAnimation;

        spiderBlackboard.groupInfo = groupInfo;
        if (isLeader)
        {
            groupInfo.leader = this;
        }

        //Init states with lists
        spiderBlackboard.leadingGroupState.Init(leaderList);
        spiderBlackboard.followingGroupState.Init(followerList);
        spiderBlackboard.attackingPlayerState.Init(attackList);
        spiderBlackboard.infectingDeviceState.Init(infectList);
    }
コード例 #5
0
 private void SpawnEnemy(EnemyGroupInfo enemy)
 {
     enemy.spawn(); //Spawns the enemy at the position
 }