コード例 #1
0
        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);
        }
コード例 #2
0
 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.");
     }
 }
コード例 #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();
 }
コード例 #4
0
        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));
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        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;
        }
コード例 #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;
        }
コード例 #8
0
        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));
        }
コード例 #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();
        }
コード例 #10
0
        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;
            }
        }
コード例 #11
0
        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
        }
コード例 #12
0
 public static void Initialize(Application inApp)
 {
     _application = inApp;
 }
コード例 #13
0
 public ParticleVfx(Application inApp, GameObject inGameObject) : base(inApp, inGameObject)
 {
 }
コード例 #14
0
 public ViewsContainer(Application inApp)
 {
     _application = inApp;
     views        = new Dictionary <string, GameView>();
 }
コード例 #15
0
 public AISystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
 {
 }
コード例 #16
0
 public static void Initialize(Application inApp)
 {
     _application = inApp;
     _objects     = new Dictionary <GameObject, GameView>();
 }
コード例 #17
0
 public PoolSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
 {
     _viewsBuffer = new Dictionary <Type, HashSet <GameView> >();
 }
コード例 #18
0
 public PlayerView(Application inApp, string inName, string inLayerName, PlayerProfile inProfile) : base(inApp, inName, inLayerName)
 {
     profile = inProfile;
     IsAlive = true;
     Health  = profile.startHealth;
 }
コード例 #19
0
 public EnemyView(Application inApp, string inName, string inLayerName, NpcProfile inProfile) : base(inApp, inName, inLayerName)
 {
     IsAlive = true;
     Profile = inProfile;
     Health  = Profile.startHealth;
 }
コード例 #20
0
 public ResourcesSystem(GameController inController, Application inApp, SystemConfig inConfig = null) : base(inController, inApp, inConfig)
 {
     DisposeAllSprites();
 }
コード例 #21
0
 public AnimationVfx(Application inApp, string inName, string inLayerName) : base(inApp, inName, inLayerName)
 {
 }