Ejemplo n.º 1
0
        public void BuildBonusBox(NodeAddedEvent e, [Combine] BonusBoxBuildNode bonus, [Context, JoinByBattle] BonusClientConfigNode bonusClientConfig, [Context, JoinByMap] MapEffectNode mapEffect)
        {
            GetInstanceFromPoolEvent eventInstance = new GetInstanceFromPoolEvent {
                Prefab = (GameObject)bonus.resourceData.Data
            };

            base.ScheduleEvent(eventInstance, bonus);
            GameObject gameObject = eventInstance.Instance.gameObject;

            gameObject.AddComponent <BonusPhysicsBehaviour>().TriggerEntity = bonus.Entity;
            BonusBoxInstanceComponent component = new BonusBoxInstanceComponent {
                BonusBoxInstance = gameObject
            };

            bonus.Entity.AddComponent(component);
            gameObject.SetActive(true);
        }
Ejemplo n.º 2
0
        public void InitAmbientMapSoundEffect(MapAmbientSoundPlayEvent evt, NonMapNativeSoundsListenerNode listener, [JoinAll] MapNode map, [JoinByMap] MapEffectNode mapEffect)
        {
            Transform transform = map.mapInstance.SceneRoot.transform;
            MapNativeSoundsBehaviour mapNativeSounds = Object.Instantiate <MapNativeSoundsBehaviour>(mapEffect.mapNativeSoundsAsset.Asset);

            Object.DontDestroyOnLoad(mapNativeSounds.gameObject);
            Transform transform2 = mapNativeSounds.transform;

            transform2.position   = transform.position;
            transform2.rotation   = transform.rotation;
            transform2.localScale = Vector3.one;
            listener.Entity.AddComponent(new MapNativeSoundsComponent(mapNativeSounds));
            mapNativeSounds.Play();
        }
Ejemplo n.º 3
0
 public void SetUserReady(NodeAddedEvent e, BattleUserNode user, LoadCompletedNode loadCompleted, MapNode map, [Context, JoinByMap] MapEffectNode mapEffect)
 {
     user.Entity.AddComponent <UserReadyToBattleComponent>();
     GC.Collect();
 }
Ejemplo n.º 4
0
        public void InitReverbZones(NodeAddedEvent evt, NonMapReverbZoneListenerNode listener, MapNode map, [JoinByMap, Context] MapEffectNode mapEffect)
        {
            Transform  transform      = map.mapInstance.SceneRoot.transform;
            GameObject reverbZoneRoot = Object.Instantiate <GameObject>(mapEffect.mapReverbZoneAsset.MapReverbZonesRoot);

            Object.DontDestroyOnLoad(reverbZoneRoot.gameObject);
            Transform transform2 = reverbZoneRoot.transform;

            transform2.position   = transform.position;
            transform2.rotation   = transform.rotation;
            transform2.localScale = Vector3.one;
            listener.Entity.AddComponent(new MapReverbZoneComponent(reverbZoneRoot));
        }