public void FillFlagSounds(NodeAddedEvent e, SelfBattleUserNode battleUser, [Context, JoinByBattle] CTFNode battle, [Context, JoinByMap] MapNode map, [JoinAll] SingleNode <SoundListenerComponent> listener) { CTFAssetProxyBehaviour behaviour = ((GameObject)battle.resourceData.Data).GetComponent <CTFAssetProxyBehaviour>(); CTFSoundsComponent component = new CTFSoundsComponent(); GameObject effectRoot = new GameObject("Effects") { transform = { parent = listener.component.transform } }; component.EffectRoot = effectRoot; component.FlagLost = this.CreateSound(behaviour.flagLostSound, effectRoot); component.FlagReturn = this.CreateSound(behaviour.flagReturnSound, effectRoot); component.FlagStole = this.CreateSound(behaviour.flagStoleSound, effectRoot); component.FlagWin = this.CreateSound(behaviour.flagWinSound, effectRoot); listener.Entity.AddComponent(component); }
public void LoadResources(NodeAddedEvent e, CTFNode ctf) { ctf.Entity.AddComponent <AssetReferenceComponent>(); ctf.Entity.AddComponent <AssetRequestComponent>(); }