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."); } }
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; }
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)); }
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 }
public static void Initialize(Application inApp) { _application = inApp; }
public ParticleVfx(Application inApp, GameObject inGameObject) : base(inApp, inGameObject) { }
public ViewsContainer(Application inApp) { _application = inApp; views = new Dictionary <string, GameView>(); }
public AISystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig) { }
public static void Initialize(Application inApp) { _application = inApp; _objects = new Dictionary <GameObject, GameView>(); }
public PoolSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig) { _viewsBuffer = new Dictionary <Type, HashSet <GameView> >(); }
public PlayerView(Application inApp, string inName, string inLayerName, PlayerProfile inProfile) : base(inApp, inName, inLayerName) { profile = inProfile; IsAlive = true; Health = profile.startHealth; }
public EnemyView(Application inApp, string inName, string inLayerName, NpcProfile inProfile) : base(inApp, inName, inLayerName) { IsAlive = true; Profile = inProfile; Health = Profile.startHealth; }
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) { }