コード例 #1
0
    void ChangeBehaviour()
    {
        switch (currentState)
        {
        case BossBehaviourState.Dash:
            attack = new RageDash(settings, characterController, ShootAt.player);
            break;

        case BossBehaviourState.RapidFire:
            attack   = new RapidShotAttack(settings, firePoint, projectilePool, ShootAt.player);
            movement = new RandomeDirectionMovement(settings, characterController);
            break;

        case BossBehaviourState.SpreadFire:
            attack = new SpreadAttack(settings, firePoint, projectilePool, ShootAt.player);
            break;
        }

        attack.inProgress = true;
    }
コード例 #2
0
ファイル: FlyingCreep.cs プロジェクト: Zipperdr/ArcheroPAGA
    private void Start()
    {
        if (characterController == null)
        {
            characterController = GetComponent <CharacterController>();
        }
        if (projectilePool == null)
        {
            projectilePool = GetComponent <Pool>();
        }

        var settings = SettingsLoader.LoadSettings <FlyingCreepSettings>();

        movement = new RandomeDirectionMovement(settings, characterController);
        attack   = new RapidShotAttack(settings, firePoint, projectilePool, ShootAt.player);


        //set forst action
        movement.inProgress = true;

        MaxHealth     = settings.Health;
        CurrentHealth = MaxHealth;
    }