// Use this for initialization
 void Start()
 {
     movementModule = GetComponent<MovementModule>();
     trackingModule = GetComponent<TrackingModule>();
     loadoutModule = GetComponent<AircraftLoadout>();
     fireControlModule = GetComponent<AircraftFireControl>();
 }
Beispiel #2
0
        public void PluginRun()
        {
            try
            {
                mainForm       = new Main();
                commonModule   = new CommonModule();
                movementModule = new MovementModule();
                questModule    = new QuestModule();
                farmModule     = new FarmModule();
                ClearLogs();
                ResumeMoveTo();
                RegisterModule(commonModule);
                RegisterModule(farmModule);
                RegisterModule(movementModule);
                RegisterModule(questModule);

                formThread = new Thread(RunForm);
                formThread.SetApartmentState(ApartmentState.STA);
                formThread.Start();
                while (true)
                {
                    Thread.Sleep(100);
                }
            }
            catch (Exception error) {
                Log(error.ToString());
            }
        }
Beispiel #3
0
        //TODO Remove magic numbers
        private WeaponModuleUnit CreateWeaponModuleUnitHorizontal(
            float frequency,
            float damage,
            float projectileSpeed,
            SKPoint coords,
            SKSize projSize,
            SKSize explSize,
            float cooldownPhaseShiftPercent = 0
            )
        {
            //TODO fix 1ms execution time
            Helper.StartTimeLog("CreateWeaponModHoriz");
            MovementModule module =
                movementModuleFactory.CreateHorizontalModule(
                    coords,
                    projSize,
                    explSize,
                    projectileSpeed
                    );
            WeaponModuleUnit unit = new WeaponModuleUnit(
                frequency,
                damage,
                module,
                projBitmap,
                animatorExpl1
                );

            unit.SetCooldownPhaseShiftPercent(cooldownPhaseShiftPercent);
            Helper.FinishTimeLog("CreateWeaponModHoriz");
            return(unit);
        }
Beispiel #4
0
        private void Start()
        {
            movementComponent =
                new MovementModule(speed.x * Input.GetAxis("Horizontal"), speed.y * Input.GetAxis("Vertical"), this.gameObject.transform);

            _modules = new List <ScriptableObject>();
            _modules.Add(movementComponent);
            TAccessor <MovementModule> .Instance().Add(movementComponent);
        }
    public void EnableMovement()
    {
        MovementModule x = SpellInstance.caster.GetComponent <MovementModule>();

        if (x)
        {
            x.enabled = true;
        }
    }
    // Use this for initialization
    void Awake()
    {
        m_playingFrames = Constants.framesPerCombatRound;

        movementModule = GetComponent<MovementModule>();

        estimationLine.SetVertexCount(m_playingFrames);

        fakePlaneMesh = transform.GetChild(0).gameObject;
    }
Beispiel #7
0
 private void LoadModules()
 {
     Action      = LoadModule <ActionModule>(EnableAction, ActionConfig);
     Brain       = LoadModule <BrainModule>(EnableBrain, BrainConfig);
     Inventory   = LoadModule <InventoryModule>(EnableInventory, InventoryConfig);
     Interaction = LoadModule <InteractionModule>(EnableInteraction, InteractionConfig);
     Movement    = LoadModule <MovementModule>(EnableMovement, MovementConfig);
     Physics     = LoadModule <PhysicsModule>(EnablePhysics, PhysicsConfig);
     Stacking    = LoadModule <StackingModule>(EnableStacking, StackingConfig);
     Stats       = LoadModule <StatsModule>(EnableStats, StatsConfig);
     TagList     = LoadModule <TagListModule>(true, TagListConfig);
 }
Beispiel #8
0
    //TODO 逻辑结构可调整
    private void Init()
    {
        if (null == instructionModule)
        {
            instructionModule = new InstructionModule(this);
        }

        if (null == movementModule)
        {
            movementModule = new MovementModule(this);
        }
        instructionModule.OnInit();
        movementModule.OnInit();
    }
Beispiel #9
0
 public Projectile(
     MovementModule movementModule,
     SKBitmap projBitmap,
     Animator animatorExpl,
     float damage
     )
 {
     this.movementModule = movementModule;
     this.projBitmap     = projBitmap;
     this.animatorExpl   = animatorExpl;
     explDuration        = animatorExpl.GetLoopDuration();
     this.damage         = damage;
     friendly            = false;
     loopTimer           = LoopTimer.GetInstance();
 }
Beispiel #10
0
 public void buildModules(UnitType t)
 {
     movement = new MovementModule(this);
     modules.Add(movement);
     if (t == UnitType.AFV)
     {
         transporter = new TransporterModule(this);
         modules.Add(transporter);
     }
     if (t == UnitType.Infantry)
     {
         transportable = new TransportableModule(this);
         modules.Add(transportable);
     }
 }
Beispiel #11
0
    protected void GetModules()
    {
        Modules = new Dictionary <string, NPCModule>();
        foreach (KeyValuePair <string, string> entry in NPCModuleTypes)
        {
            NPCModule module = (NPCModule)GetComponent(entry.Value);
            Modules.Add(entry.Key, module);
        }
        ;

        combatModule         = (CombatModule)Modules["Combat"];
        movementModule       = (MovementModule)Modules["Movement"];
        bounceModule         = (BounceModule)Modules["Bounce"];
        handleOpponentModule = (HandleOpponentModule)Modules["HandleOpponent"];
        visionModule         = (VisionModule)Modules["Vision"];
    }
Beispiel #12
0
 public Enemy(
     float maxHealth,
     MovementModule movementModule,
     WeaponModule weaponModule,
     Animator animatorNormal,
     Animator animatorExpl
     )
 {
     this.maxHealth      = maxHealth;
     health              = maxHealth;
     this.movementModule = movementModule;
     this.weaponModule   = weaponModule;
     this.animatorNormal = animatorNormal;
     this.animatorExpl   = animatorExpl;
     explDuration        = animatorExpl.GetLoopDuration();
     loopTimer           = LoopTimer.GetInstance();
 }
Beispiel #13
0
    public void BuildModules(UnitType t)
    {
        Movement = new MovementModule(this);
        Modules.Add(Movement);

        if (t == UnitType.AFV)
        {
            Transporter = new TransporterModule(this);
            Modules.Add(Transporter);
        }

        if (t == UnitType.Infantry)
        {
            Transportable = new TransportableModule(this);
            Modules.Add(Transportable);
        }
    }
Beispiel #14
0
    private void Start()
    {
        MovementModule          = GetComponent <MovementModule>();
        MovementModule.OnMove  += Walking;
        MovementModule.OnStill += Idle;
        MovementModule.OnDodge += Dodge;

        SpellCaster = GetComponent <SpellCaster_Struggler>();
        SpellCaster.OnTriggerCastTargetAnimation += CastTargetSpell;

        AttackModule           = GetComponent <AttackModule>();
        AttackModule.OnAttack += Attack;

        HealthController        = GetComponent <HealthController>();
        HealthController.OnDie += TriggerDie;

        Rigidbody = GetComponent <Rigidbody>();
    }
Beispiel #15
0
 public WeaponModuleUnit(
     float frequency,
     float damage,
     MovementModule movementTemplate,
     SKBitmap projBitmap,
     Animator animatorExpl
     )
 {
     shootInterval         = 1000 / frequency;
     this.damage           = damage;
     this.movementTemplate = movementTemplate;
     this.projBitmap       = projBitmap;
     this.animatorExpl     = animatorExpl;
     loopTimer             = LoopTimer.GetInstance();
     cooldownStartTime     = loopTimer.GetTotalMs();
     friendly          = false;
     projectileManager = ProjectileManager.GetInstance();
     //fireAudioPlayer =
     //	Helper.LoadAudioPlayer("JetPack.media.samples.laserpew.ogg");
 }
Beispiel #16
0
    void Start()
    {
        audioSource = CreateChildWithAudioSource("AudioSource (SoundModule)");

        HealthController = GetComponent <HealthController>();
        MovementModule   = GetComponent <MovementModule>();

        if (StrugglerAnimationEvents && AttackClipSet)
        {
            StrugglerAnimationEvents.OnPlayAttackSound += PlayAttackSoundAnimationEvent;
        }

        if (FootstepClipSet)
        {
            AudioSourceFootstep = CreateChildWithAudioSource("AudioSourceFootsteps (SoundModule)");
            audioSource.outputAudioMixerGroup = audioMixer;

            if (MovementModule)
            {
                MovementModule.OnMove  += PlayFootstepSoundEvent;
                MovementModule.OnStill += StopFootstepSoundEvent;
            }
        }

        if (DodgeClipSet && MovementModule)
        {
            MovementModule.OnDodge += PlayDodgeSoundEvent;
        }
        if (DeathClipSet)
        {
            HealthController.OnDie += DieEvent;
        }
        if (HurtClipSet)
        {
            HealthController.OnDamage += TakeDamageEvent;
        }
    }
 // Use this for initialization
 void Start()
 {
     movementModule = GetComponent<MovementModule>();
     trackingModule = GetComponent<TrackingModule>();
 }
Beispiel #18
0
 // Use this for initialization
 void Start()
 {
     myMovementModule = GetComponent<MovementModule>();
 }