Ejemplo n.º 1
0
        protected override void SpawnBackend(Entity target)
        {
            if (m_Canvas == null)
            {
                m_Canvas = CanvasUtility.Create(World, 0, "ServerRoom", defaultAddRaycaster: true);
                //CanvasUtility.DisableInteractionOnActivePopup(World, m_Canvas);
            }

            base.SpawnBackend(target);
            var rt = LastBackend.GetComponent <RectTransform>();

            rt.SetParent(m_Canvas.transform, false);

            var folder = AddressBuilder.Client()
                         .Interface()
                         .Menu()
                         .Folder("Screens")
                         .Folder("SettingsScreen");

            LastBackend.Data = new SettingsScreenData
            {
                Panels = new []
                {
                    folder.GetAsset("GraphicSettingsPanel"),
                    folder.GetAsset("AudioSettingsPanel")
                }
            };

            CanvasUtility.ExtendRectTransform(rt);
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            AudioSource CreateAudioSource(string name, float volume)
            {
                var audioSource = new GameObject("(Clip) " + name, typeof(AudioSource)).GetComponent <AudioSource>();

                audioSource.reverbZoneMix = 0f;
                audioSource.spatialBlend  = 0f;
                audioSource.volume        = volume;

                return(audioSource);
            }

            m_AudioSource = CreateAudioSource("AbilitySwitch", 0.25f);
            GetModule(out m_AsyncOp);

            var path = AddressBuilder.Client()
                       .Folder("Sounds")
                       .Folder("InGame");

            m_AsyncOp.Add(AssetManager.LoadAssetAsync <AudioClip>(path.GetAsset("ability_switch.wav")), new HandleOpData {
            });
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            m_PoolByArchetype = new Dictionary <string, Dictionary <string, AsyncAssetPool <GameObject> > >();
            // TODO: Need to be dynamic in the future (search based in StreamingAssets)
            var modelFolder    = AddressBuilder.Client().Folder("Models");
            var uberHeroFolder = modelFolder.Folder("UberHero");
            var pataponFolder  = modelFolder.Folder("Patapon");

            var archAddr = AddressBuilder.Client().Folder("archetype");
            var kitAddr  = AddressBuilder.Client().Folder("kit");

            var uberHeroMap = new Dictionary <string, AsyncAssetPool <GameObject> >
            {
                [string.Empty] = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("Character")),
                [kitAddr.GetFile("yarida")]       = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("CharacterYarida")),
                [kitAddr.GetFile("taterazay")]    = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("CharacterTaterazay")),
                [kitAddr.GetFile("guardira")]     = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("CharacterGuardira")),
                [kitAddr.GetFile("wooyari")]      = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("CharacterYarida")),
                [kitAddr.GetFile("wondabarappa")] = new AsyncAssetPool <GameObject>(uberHeroFolder.GetAsset("CharacterWooyari"))
            };

            var ponMap = new Dictionary <string, AsyncAssetPool <GameObject> >
            {
                [string.Empty] = new AsyncAssetPool <GameObject>(pataponFolder.GetAsset("Patapon")),
                [kitAddr.GetFile("yarida")]    = new AsyncAssetPool <GameObject>(pataponFolder.GetAsset("PataponYarida")),
                [kitAddr.GetFile("taterazay")] = new AsyncAssetPool <GameObject>(pataponFolder.GetAsset("PataponTaterazay"))
            };

            m_PoolByArchetype[archAddr.GetFile("uberhero_std_unit")] = uberHeroMap;
            m_PoolByArchetype[archAddr.GetFile("patapon_std_unit")]  = ponMap;
        }
        private void Awake()
        {
            settingsContainer = ContainerPool.FromPresentation <SettingsScreen.BackendBase, SettingsScreen>(settingsReference)
                                .WithTransformRoot(screenStackRoot.transform);
            settingsContainer.Add().ContinueWith(args =>
            {
                var backend = args.element.Backend;
                backend.DstEntityManager.AddComponent <UIScreen>(backend.BackendEntity);

                args.element.gameObject.SetActive(false);

                var folder = AddressBuilder.Client()
                             .Interface()
                             .Menu()
                             .Folder("Screens")
                             .Folder("SettingsScreen");
                args.element.Data = new SettingsScreenData
                {
                    Panels = new[]
                    {
                        folder.GetAsset("GraphicSettingsPanel"),
                        folder.GetAsset("AudioSettingsPanel")
                    }
                };
            });
        }
Ejemplo n.º 5
0
        protected override void OnCreate()
        {
            base.OnCreate();

            m_Canvas                      = World.GetOrCreateSystem <ClientCanvasSystem>().CreateCanvas(out _, "UIDrumCanvas", defaultAddRaycaster: false);
            m_Canvas.renderMode           = RenderMode.WorldSpace;
            m_Canvas.transform.localScale = new Vector3() * 0.05f;

            m_CameraQuery = GetEntityQuery(typeof(GameCamera));

            var address = AddressBuilder.Client()
                          .Folder("Models")
                          .Folder("InGame")
                          .Folder("UIDrum")
                          .GetAsset("UIDrumPressure");

            for (var i = 1; i <= 4; i++)
            {
                DrumPresentationPools[i] = new AsyncAssetPool <GameObject>(address);
                DrumBackendPools[i]      = new AssetPool <GameObject>(CreateBackendDrumGameObject, World);
                DrumVariantCount[i]      = 0;
            }

            timeSystem = World.GetExistingSystem <TimeSystem>();

            m_EngineQuery = GetEntityQuery(typeof(RhythmEngineDescription), typeof(Relative <PlayerDescription>));
        }
Ejemplo n.º 6
0
        protected override void OnCreate()
        {
            base.OnCreate();

            definitionHashMap = new NativeHashMap <Entity, EntityVisualDefinition>(32, Allocator.Persistent);

            resourceMgr = World.GetExistingSystem <GameResourceManager>();

            visualMgr         = World.GetExistingSystem <EntityVisualManager>();
            defaultDefinition = visualMgr.Register(AddressBuilder.Client()
                                                   .Folder("Models")
                                                   .Folder("InGame")
                                                   .Folder("Projectiles")
                                                   .Folder("Cannon")
                                                   .GetAsset("CannonProjectile"));
        }
Ejemplo n.º 7
0
        protected override void OnCreate()
        {
            base.OnCreate();

            m_ClipMap = new Dictionary <string, AudioClip>();
            GetModule(out m_AsyncOp);

            var builder = AddressBuilder.Client()
                          .Folder("Sounds")
                          .Folder("Effects")
                          .Folder("HeroModeActivation");

            m_AsyncOp.Add(AssetManager.LoadAssetAsync <AudioClip>(builder.GetAsset("TateEnergyField" + ".ogg")), new DataOp
            {
                Key = "TateEnergyField"
            });
            m_AsyncOp.Add(AssetManager.LoadAssetAsync <AudioClip>(builder.GetAsset("YariFearSpear" + ".ogg")), new DataOp
            {
                Key = "YariFearSpear"
            });
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            GetModule(out m_AsyncOp);

            var activationFile = AddressBuilder.Client()
                                 .Folder("Sounds")
                                 .Folder("Effects")
                                 .Folder("HeroModeActivation")
                                 .GetAsset("HeroModeStart");

            m_AsyncOp.Add(AssetManager.LoadAssetAsync <AudioClip>(activationFile), new DataOp {
            });

            m_AbilityWithoutInternalQuery = GetEntityQuery(new EntityQueryDesc
            {
                All  = new ComponentType[] { typeof(AbilityState) },
                None = new ComponentType[] { typeof(AbilityInternalData) }
            });
        }