public void SystemUpdate()
    {
        TAccessor <ShootModule> myModuleAccessor = TAccessor <ShootModule> .Instance();

        foreach (var module in myModuleAccessor.DisplayListT())
        {
        }
    }
        public void SystemUpdate()
        {
            TAccessor <MovementModule> myModuleAccessor = TAccessor <MovementModule> .Instance();

            foreach (var module in myModuleAccessor.DisplayListT())
            {
                module.playerTransform.position += new Vector3(module.speedX, module.speedY) * Time.deltaTime;
            }
        }
Example #3
0
        public void SystemUpdate()
        {
            TAccessor <BulletModule> moduleAccessor = TAccessor <BulletModule> .Instance();

            foreach (var module in moduleAccessor.DisplayListT())
            {
                module.bulletTransform.position += module.direction * (Time.deltaTime * module.speed);
            }
        }
    public void SystemUpdate()
    {
        TAccessor <GunModule> moduleAccessor = TAccessor <GunModule> .Instance();

        foreach (var module in moduleAccessor.DisplayListT())
        {
            if (module.isFiring)
            {
                module.shotCounter -= Time.deltaTime;
                if (module.shotCounter < 0.5f)
                {
                    module.shotCounter = module.shotInterval;
                    BulletScript newBullet = MonoBehaviour.Instantiate(module.bullet, module.firePoint.position, module.firePoint.rotation);
                    newBullet.speed = module.bulletSpeed;
                }
            }
        }
    }