public RendererSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
        {
            // --------------------------------------------------------------------------------
            // Setup Screen Resolution
            // --------------------------------------------------------------------------------
            ScreenWidth  = application.parameters.resolution.width;
            ScreenHeight = application.parameters.resolution.height;

            ResetVector = new Vector3(1.0f, 1.0f, 1.0f);

            CurrentResolution = Mathf.CeilToInt(ScreenHeight / 267F);
            var tmpRes = Mathf.CeilToInt(ScreenWidth / 440F);

            if (tmpRes > CurrentResolution)
            {
                CurrentResolution = tmpRes;
            }

            //CurrentResetVector  = new Vector3(CurrentResolution, CurrentResolution, 1.0f);
            CurrentResetVector = ResetVector;

            // --------------------------------------------------------------------------------
            // Setup Camera
            // --------------------------------------------------------------------------------
            SystemFacade.Camera.SetResolution(ScreenWidth, ScreenHeight, CurrentResolution);
        }
 public ShootingSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
 {
     _config = inConfig as ShootingSystemConfig;
     if (_config == null)
     {
         throw new Exception($"System config must be not null.");
     }
 }
Ejemplo n.º 3
0
 public InputSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
 {
     _config = inConfig as InputSystemConfig;
     if (_config == null)
     {
         throw new Exception($"System config must be not null.");
     }
     _config.Initialize();
 }
        public CameraView(Application inApp, GameObject inGameObject) : base(inApp, inGameObject)
        {
            camera = gameObject.GetComponent <Camera>();
            if (camera == null)
            {
                throw new Exception($"target Camera view Component must have a Camera");
            }

            _shake = AddComponent(new CameraShake(this));
        }
        public LevelSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
        {
            _config = inConfig as LevelSystemConfig;
            if (_config == null)
            {
                throw new Exception($"System config must be not null.");
            }

            ClearComponentList();

            Level = CreateLevel();
        }
        public VfxSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
        {
            _config = inConfig as VfxSystemConfig;
            if (_config == null)
            {
                throw new Exception($"System config must be not null.");
            }

            VfxList = new List <IVfx>();
            ParticleVfx.OnComplete  += OnVfxComplete;
            AnimationVfx.OnComplete += OnVfxComplete;
        }
Ejemplo n.º 7
0
        public PlayerSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
        {
            _config = inConfig as PlayerSystemConfig;
            if (_config == null)
            {
                throw new Exception($"System config must be not null.");
            }

            Sprites              = null;
            Player               = CreatePlayer();
            Player.OnTakeDamage += OnPlayerTakeDamage;
            Player.Destroyed    += OnPlayerDie;
            _input               = SystemFacade.Input;
        }
        public CameraView(Application inApp, string inName, CameraSystemConfig inConfig) : base(inApp, inName)
        {
            // --------------------------------------------------------------------------------
            // Create and setup new camera
            // --------------------------------------------------------------------------------
            _config                 = inConfig;
            camera                  = gameObject.AddComponent <Camera>();
            camera.tag              = _config.tag;
            camera.backgroundColor  = _config.backgroundColor;
            camera.clearFlags       = _config.clearFlag;
            camera.orthographic     = true;
            camera.orthographicSize = _config.orthographicSize;

            _shake = AddComponent(new CameraShake(this));
        }
Ejemplo n.º 9
0
        public NpcSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
        {
            _config = inConfig as NpcSystemConfig;
            if (_config == null)
            {
                throw new Exception($"System config must be not null.");
            }
            Sprites = null;

            // --------------------------------------------------------------------------------
            // Generate enemies
            // --------------------------------------------------------------------------------
            Enemies = null;
            ClearEnemiesList();
        }
        public SoundSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
        {
            _config = inConfig as SoundSystemConfig;
            if (_config == null)
            {
                throw new Exception($"System config must be not null.");
            }

            _musicSource = SystemFacade.Application.gameObject.AddComponent <AudioSource>();
            foreach (var s in _config.sfxMap)
            {
                s.source        = SystemFacade.Application.gameObject.AddComponent <AudioSource>();
                s.source.clip   = s.clip;
                s.source.volume = s.hasOwnVolume? s.volume : _config.sfxVolume;
                s.source.pitch  = s.pitch;
                s.source.loop   = s.loop;
            }
        }
        public CameraSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
        {
            // --------------------------------------------------------------------------------
            // Set system config
            // --------------------------------------------------------------------------------
            _config = inConfig as CameraSystemConfig;
            if (_config == null)
            {
                throw new Exception($"System config must be not null.");
            }

            // --------------------------------------------------------------------------------
            // Create Camera view
            // --------------------------------------------------------------------------------
            //cameraView = new CameraView(this.application, Camera.gameObject); //here if we want to set an existing camera from unity
            CameraView = new CameraView(this.application, "Camera", _config);
            ViewsContainer.AddView(CameraView);
            _targetFollow = null;
            // --------------------------------------------------------------------------------
            // Add Camera Shake Component
            // --------------------------------------------------------------------------------
            //Todo : Add camera shake
        }
Ejemplo n.º 12
0
 public static void Initialize(Application inApp)
 {
     _application = inApp;
 }
 public ParticleVfx(Application inApp, GameObject inGameObject) : base(inApp, inGameObject)
 {
 }
Ejemplo n.º 14
0
 public ViewsContainer(Application inApp)
 {
     _application = inApp;
     views        = new Dictionary <string, GameView>();
 }
 public AISystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
 {
 }
Ejemplo n.º 16
0
 public static void Initialize(Application inApp)
 {
     _application = inApp;
     _objects     = new Dictionary <GameObject, GameView>();
 }
Ejemplo n.º 17
0
 public PoolSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
 {
     _viewsBuffer = new Dictionary <Type, HashSet <GameView> >();
 }
Ejemplo n.º 18
0
 public PlayerView(Application inApp, string inName, string inLayerName, PlayerProfile inProfile) : base(inApp, inName, inLayerName)
 {
     profile = inProfile;
     IsAlive = true;
     Health  = profile.startHealth;
 }
Ejemplo n.º 19
0
 public EnemyView(Application inApp, string inName, string inLayerName, NpcProfile inProfile) : base(inApp, inName, inLayerName)
 {
     IsAlive = true;
     Profile = inProfile;
     Health  = Profile.startHealth;
 }
Ejemplo n.º 20
0
 public ResourcesSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
 {
     DisposeAllSprites();
 }
 public AnimationVfx(Application inApp, string inName, string inLayerName) : base(inApp, inName, inLayerName)
 {
 }