예제 #1
0
    /////////////////////////////////////////////////////////////////////////



    //---------------------------------------------------------------------//
    //-------------------------- INITIALISATION ---------------------------//
    //---------------------------------------------------------------------//
    #region Initilisation
    public void InitializePathBehavior()
    {
        SC_bezier    = GetComponent <BezierSolution.BezierWalkerWithSpeed>(); //Récupère le script du flock
        FlockManager = GetComponent <SC_FlockManager>();                      //Récupère le script du flock

        InitTab();                                                            //initialise tout les tableaux

        //Premier comportement quand la nuée est spawn
        curCircleIndex = 0;
        newCircleIndex = 0;
    }
예제 #2
0
    /// <summary>
    /// Avant le start, instanciation
    /// </summary>
    public void Initialize(Transform newGuide, int newSpawnCount, BoidSettings newSettings, FlockSettings flockSettings, Vector3Int newSensitivity)
    {
        GetReferences();
        regeneration     = true;
        curRecoveryTimer = 0;
        recoveryDuration = 1.5f;
        flockManager     = newGuide.GetComponent <SC_FlockManager>();

        curFlockSettings = flockSettings;
        spawnCount       = newSpawnCount;


        switch (flockSettings.attackType)
        {
        case FlockSettings.AttackType.none:

            koaCharID = "Neutral";
            type      = 0;
            break;

        case FlockSettings.AttackType.Bullet:

            koaCharID = "Bullet";
            type      = 1;
            break;

        case FlockSettings.AttackType.Laser:

            koaCharID = "Laser";
            type      = 2;
            break;

        case FlockSettings.AttackType.Kamikaze:

            koaCharID = "Kamikaze";
            type      = 3;
            break;
        }

        koaNumID = SC_BoidPool.Instance.GetFlockID();
        koaID    = koaCharID + " #" + koaNumID;

        //Instanciation des list de Boid et de Guide
        _boidsTab = SC_BoidPool.Instance.GetBoid(curFlockSettings.maxBoid);

        _guideList = new List <Transform>();

        //Récupération du comportement initial
        curBoidSettings = newSettings;
        if (SC_EnemyManager.Instance.curPhaseIndex != 0)
        {
            sensitivity = newSensitivity;
        }
        else
        {
            sensitivity = new Vector3Int(3, 5, 4);
        }
        //Ajout du premier guide a la liste
        _guideList.Add(newGuide);

        respawnTimer = 0;
        if (_koaPrefab != null)
        {
            _koa = NetPSpawnKoa.SpawnKoa();
            _koa.transform.position = transform.position;
            _koa.GetComponent <SC_KoaCollider>().Initialize(this);

            flockManager.KoaMainAnimator = _koa.transform.GetChild(0).GetComponent <Animator>();

            koaEmissiveAnimator = _koa.transform.GetChild(0).GetChild(0).GetComponent <Animator>();
            flockManager.KoaEmissiveAnimator = koaEmissiveAnimator;

            vfx_Hit = _koa.GetComponent <ParticleSystem>();

            syncVarKoa = _koa.GetComponent <SC_MoveKoaSync>();
            flockManager.moveKoaSync = syncVarKoa;
            syncVarKoa.InitOPKoaSettings(sensitivity, flockSettings.spawnTimer, koaID, KoaLife, maxLife, type, newGuide);
            syncVarKoa.curboidNumber = spawnCount;
            syncVarKoa.curboidNumber = flockSettings.maxBoid;
        }
    }