public override void OnInit(IEntityContainer container)
        {
            var m = container.NewMatcher();

            m.HasTrait <Message>();
            this.filter = container.GetFilter(this, TupleType.Job, m);
        }
Exemplo n.º 2
0
        public override void OnInit(IEntityContainer container)
        {
            var m = container.NewMatcher();

            m.HasTag(Player.MainPlayer).HasTrait <Renderer>().HasTag(Renderer.Loaded);
            this.filter = container.GetFilter(this, TupleType.Reactive, m);

            this.follower = Camera.main.GetComponent <CameraFollow>();
        }
Exemplo n.º 3
0
        public override void OnInit(IEntityContainer container)
        {
            var mainCamera = Camera.main.gameObject;
            var refSet     = ResourcesManager.GetManagedRefSet(mainCamera);

            var audioSource = GetOrAddComponent <AudioSource>(mainCamera);

            audioSource.clip = ResourcesManager.LoadAsset <AudioClip>(ExcelManager.Configuration_audio[1].path, refSet);
            audioSource.Play();

            var playMatcher = container.NewMatcher();

            playMatcher.HasTrait <Audio>().ExceptTag(Audio.Playing).HasTrait <Renderer>().HasTag(Renderer.Loaded);
            this.playFilter = container.GetFilter(this, TupleType.Job, playMatcher);

            var updateMatcher = container.NewMatcher();

            updateMatcher.HasTrait <Audio>().HasTag(Audio.Playing);
            this.updateFilter = container.GetFilter(this, TupleType.Job, updateMatcher);
        }
Exemplo n.º 4
0
        public override void OnInit(IEntityContainer container)
        {
            var factory = new PrefabFactory();

            this.pool = GBox.Make <IRecycleManager>().Create(factory, factory);

            var m = container.NewMatcher();

            m.HasTrait <Renderer>().ExceptTag(Renderer.Loaded);
            this.filter = container.GetFilter(this, TupleType.Job, m);
        }
Exemplo n.º 5
0
        public override void OnInit(IEntityContainer container)
        {
            this.container = container;
            this.root      = new GameObject("UI");
            this.refSet    = ResourcesManager.GetUnmanagedRefSet("UI");
            GameObject.DontDestroyOnLoad(this.root);
            this.windows = new Dictionary <string, IEntity>();

            var m = container.NewMatcher();

            m.HasTrait <Window>().ExceptTag(Window.Inited);
            this.filter = container.GetFilter(this, TupleType.Job, m);
        }