示例#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);
        }
        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();
        }
 public void SetUserReady(NodeAddedEvent e, BattleUserNode user, LoadCompletedNode loadCompleted, MapNode map, [Context, JoinByMap] MapEffectNode mapEffect)
 {
     user.Entity.AddComponent <UserReadyToBattleComponent>();
     GC.Collect();
 }
        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));
        }