コード例 #1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            serializedObject.Update();

            SoundComponent t = (SoundComponent)target;

            EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
            {
                EditorGUILayout.PropertyField(m_EnablePlaySoundUpdateEvent);
                EditorGUILayout.PropertyField(m_EnablePlaySoundDependencyAssetEvent);
                EditorGUILayout.PropertyField(m_InstanceRoot);
                EditorGUILayout.PropertyField(m_AudioMixer);
                m_SoundHelperInfo.Draw();
                m_SoundGroupHelperInfo.Draw();
                m_SoundAgentHelperInfo.Draw();
                EditorGUILayout.PropertyField(m_SoundGroups, true);
            }
            EditorGUI.EndDisabledGroup();

            if (EditorApplication.isPlaying && IsPrefabInHierarchy(t.gameObject))
            {
                EditorGUILayout.LabelField("Sound Group Count", t.SoundGroupCount.ToString());
            }

            serializedObject.ApplyModifiedProperties();

            Repaint();
        }
コード例 #2
0
    protected SoundComponent LoadAndPlay(string fileName, Vector3 Position, KBusAudio bus = null, float DelayTime = 0f, float Duration = -1f)
    {
        SoundComponent source = GetAudioSource3D(fileName);

        if (source == null)
        {
            return(null);
        }

        if (bus != null)
        {
            if (bus.Add(source) == false)
            {
                if (PushToPool != null)
                {
                    PushToPool.Invoke(source.transform);
                }
                else
                {
                    Destroy(source.transform.gameObject);
                }

                return(null);
            }
            else
            {
                // Please Add All CallbackFunction
                // Do dùng cái Pool nên sợ Add thê nhiều lần
                // if (_Sound.callback == null)
                //      :: Todo
                // Ignore add to Pool of KAudioCompoenent
                source._Sound.callback = () =>
                {
                    bus.Remove(source);

                    if (PushToPool != null)
                    {
                        PushToPool.Invoke(source.transform);
                    }
                    else
                    {
                        Destroy(source.transform.gameObject);
                    }
                };
            }
        }

        source.gameObject.transform.localPosition = Position;

        if (Duration > 0)
        {
            source.Play(DelayTime, Duration);
        }
        else
        {
            source.Play(DelayTime);
        }

        return(source);
    }
コード例 #3
0
        public static int?PlayMusic(this SoundComponent soundComponent, int musicId, object userData = null)
        {
            soundComponent.StopMusic();

            IDataTable <DRMusic> dtMusic = GameEntry.DataTable.GetDataTable <DRMusic>();

            if (dtMusic == null)
            {
                Log.Warning("Music data is null", musicId.ToString());
                return(null);
            }

            DRMusic drMusic = dtMusic.GetDataRow(musicId);

            if (drMusic == null)
            {
                Log.Warning("Can not load music '{0}' from data table.", musicId.ToString());
                return(null);
            }

            PlaySoundParams playSoundParams = new PlaySoundParams
            {
                Priority           = 64,
                Loop               = true,
                VolumeInSoundGroup = 1f,
                FadeInSeconds      = FadeVolumeDuration,
                SpatialBlend       = 0f,
            };

            s_MusicSerialId = soundComponent.PlaySound(AssetUtility.GetMusicAsset(drMusic.AssetName), "Music", playSoundParams, null, userData);
            return(s_MusicSerialId);
        }
コード例 #4
0
ファイル: MoonTaxi.cs プロジェクト: modulexcite/moontaxi
        public MoonTaxi(bool isServer, string username)
            : base()
        {
            this.isServer = isServer;
            if (isServer)
            {
                server = new Server();
                server.Start();
            }
            else
            {
                client = new Client(username);
                client.Connect(IPAddress.Loopback, 1234);
                client.DataReceived += Client_DataReceived;
            }
            graphics = new GraphicsDeviceManager(this);

            level = new RandomLevel(new Vector2(1280, 720), 2, Environment.TickCount);

            graphics.PreferredBackBufferWidth  = (int)level.Size.X;
            graphics.PreferredBackBufferHeight = (int)level.Size.Y;

            Content.RootDirectory = "Content";

            Components.Add(sound = new SoundComponent(this));
        }
コード例 #5
0
        public void LoadContent(ContentManager contentManager)
        {
            var entities = ComponentManager.Instance
                           .GetEntitiesWithComponent(typeof(SpriteComponent))
                           .Where(entity => !(entity.Value as SpriteComponent).SpriteIsLoaded);

            foreach (var entity in entities)
            {
                var spriteComponent = entity.Value as SpriteComponent;
                if (string.IsNullOrEmpty(spriteComponent.SpriteName))
                {
                    continue;
                }
                spriteComponent.Sprite         = contentManager.Load <Texture2D>(spriteComponent.SpriteName);
                spriteComponent.SpriteIsLoaded = true;
                if (spriteComponent.TileWidth == 0)
                {
                    spriteComponent.TileWidth = spriteComponent.Sprite.Width;
                }
                if (spriteComponent.TileHeight == 0)
                {
                    spriteComponent.TileHeight = spriteComponent.Sprite.Height;
                }
            }

            var soundEntities = ComponentManager.Instance.GetEntitiesWithComponent(typeof(SoundComponent));

            foreach (var entity in soundEntities)
            {
                SoundComponent soundComponent = (SoundComponent)entity.Value;
                soundComponent.SoundEffect = contentManager.Load <SoundEffect>(soundComponent.SoundEffectName);
            }
        }
コード例 #6
0
    protected SoundComponent GetAudioSource3D(string fileName)
    {
        // PoolManager.Pools[POOL.POOL_AUDIO].Spawn("Audio3D").gameObject;
        GameObject ownerSource = GetPool("Audio3D").gameObject;
        // Get AudioSource
        SoundComponent _SoundComponent = ownerSource.GetComponent <SoundComponent>();

        // Add Clip
        _SoundComponent._Sound.clip = LoadClip(fileName);

        if (_SoundComponent._Sound.clip == null)
        {
#if UNITY_EDITOR
            Debug.LogError(fileName);
#endif
            return(null);
        }
        // Add Cache
        if (_AudioSources3D == null)
        {
            _AudioSources3D = new List <SoundComponent>();
        }
        if (_AudioSources3D.Contains(_SoundComponent) == false)
        {
            _AudioSources3D.Add(_SoundComponent);
        }

        //Debug.LogWarning(fileName);
        return(_SoundComponent);
    }
コード例 #7
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            SoundComponent t = (SoundComponent)target;

            EditorGUILayout.PropertyField(m_EnablePlaySoundSuccessEvent);
            EditorGUILayout.PropertyField(m_EnablePlaySoundFailureEvent);
            EditorGUILayout.PropertyField(m_EnablePlaySoundUpdateEvent);
            EditorGUILayout.PropertyField(m_EnablePlaySoundDependencyAssetEvent);

            EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
            {
                EditorGUILayout.PropertyField(m_AudioMixer);
                EditorGUILayout.PropertyField(m_SoundGroupInfos, true);
            }
            EditorGUI.EndDisabledGroup();

            if (EditorApplication.isPlaying && PrefabUtility.GetPrefabType(t.gameObject) != PrefabType.Prefab)
            {
                EditorGUILayout.LabelField("Sound Group Count", t.SoundGroupCount.ToString());
            }

            serializedObject.ApplyModifiedProperties();

            Repaint();
        }
コード例 #8
0
    public override void OnAwake()
    {
        base.OnAwake();

        m_throwable           = true; // change depending on power-up
        MovementSpeedModifier = 1.0f;

        BaseThrowForce       = 15.0f;
        MaxThrowForce        = 25.0f;
        ThrowForce           = BaseThrowForce;
        m_rigidBody.Friction = 100.0f;

        _LastCollider = null;
        DespawnTime   = 60.0f;
        _BananaTimer  = 0.0f;


        SetModels(true, false);

        SlipSound         = gameObject.AddComponent <SoundComponent>();
        SlipSound.Type    = SoundComponent.SoundType.Effect;
        SlipSound.Clip    = BananaSlipSound;
        SlipSound.Looping = false;
        SlipSound.Is3D    = true;

        Rigidbody rb = gameObject.GetComponent <Rigidbody>();

        rb.CcdMotionThreshold   = 1e-7f;
        rb.CcdSweptSphereRadius = 0.1f;
    }
コード例 #9
0
        public static int?PlayMusic(this SoundComponent soundComponent, int musicId, object userData = null)
        {
            soundComponent.StopMusic();
            s_MusicSerialId = soundComponent.PlaySound(musicId, null, userData);

            return(s_MusicSerialId);
        }
コード例 #10
0
 public void Execute()
 {
     foreach (Entity e in _group.GetEntities())
     {
         SoundComponent sound = e.sound;
         GameObject     go    = sound.go;
         if (go == null)
         {
             sound.go = new GameObject();
             AudioSource source = sound.go.AddComponent <AudioSource>();
             source.volume = sound.volume;
             source.clip   = Resources.Load <AudioClip>(sound.path);
             source.Play();
         }
         else
         {
             AudioSource source = go.GetComponent <AudioSource>();
             if (!source.isPlaying)
             {
                 UnityEngine.Object.Destroy(go);
                 e.isDestroyEntity = true;
             }
         }
     }
 }
コード例 #11
0
 void Awake()
 {
     sound              = GetComponent <SoundComponent>();
     _health            = GetComponent <IHealth>();
     ShieldActive.Value = false;
     CurrentHP          = _health.MaxHP;
     scoreComponent     = GetComponent <ScoreComponent>();
 }
コード例 #12
0
    private void Collided(Entity other, Vector3 point)
    {
        if (other.Has <AircraftComponent>())
        {
            Entity e = Entity.Instantiate();
            e.Attach(new TransformComponent()
            {
                Position = point
            });
            //e.Attach<GunBulletSmokeComponent>();
            e.Attach(new LimitedLifeTimeComponent()
            {
                CountSpeed = 0.04f
            });
            var soundComponent = new SoundComponent(BulletHitSound);
            soundComponent.VolumeFactor = 0.5f;
            e.Attach(soundComponent);
            soundComponent.Play();

            var aircraft = other.Get <AircraftComponent>();
            aircraft.Damage(Damage);

            if (this.ShootedByPlayer)
            {
                if (aircraft.Armor > 0)
                {
                    Entity.SendMessage(Entity.Find("ui"), "notice", "Hit");
                }
                else
                {
                    Entity.SendMessage(Entity.Find("ui"), "notice", "Destroyed");
                }
            }

            if (other.Name == "player")
            {
                Entity.SendMessage(Entity.Find("ui"), "notice", "Damaged");
            }
        }
        else if (other.Has <GroundComponent>())
        {
            Entity e = Entity.Instantiate();
            e.Attach(new TransformComponent()
            {
                Position = point
            });
            e.Attach <GunBulletSmokeComponent>();
            e.Attach(new LimitedLifeTimeComponent()
            {
                CountSpeed = 0.04f
            });
            var soundComponent = new SoundComponent(BulletHitSound);
            soundComponent.VolumeFactor = 0.5f;
            e.Attach(soundComponent);
            soundComponent.Play();
        }
        Entity.Kill(this.Owner);
    }
コード例 #13
0
    public static void StopMusic(this SoundComponent soundComponent)
    {
        if (!s_MusicSerialId.HasValue)
        {
            return;
        }

        soundComponent.StopSound(s_MusicSerialId.Value);
    }
コード例 #14
0
        public static int?PlaySound(this SoundComponent soundComponent, EnumSound enumSound, Entity bindingEntity = null, object userData = null)
        {
            if (enumSound == EnumSound.None)
            {
                return(null);
            }

            return(soundComponent.PlaySound((int)enumSound, bindingEntity, userData));
        }
コード例 #15
0
        public RheinwerkGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            graphics.IsFullScreen = false;
            IsMouseVisible        = true;

            Input             = new InputComponent(this);
            Input.UpdateOrder = 0;
            Components.Add(Input);

            Screen             = new ScreenComponent(this);
            Screen.UpdateOrder = 1;
            Screen.DrawOrder   = 2;
            Components.Add(Screen);

            Local             = new LocalComponent(this);
            Local.UpdateOrder = 2;
            Components.Add(Local);

            var client = new ClientComponent(this);

            Client             = client;
            client.UpdateOrder = 3;
            Components.Add(client);

            var server = new ServerComponent(this);

            Server             = server;
            server.UpdateOrder = 4;
            Components.Add(server);

            Simulation             = new SimulationComponent(this);
            Simulation.UpdateOrder = 5;
            Components.Add(Simulation);

            Scene             = new SceneComponent(this);
            Scene.UpdateOrder = 6;
            Scene.DrawOrder   = 0;
            Components.Add(Scene);

            Hud             = new HudComponent(this);
            Hud.UpdateOrder = 7;
            Hud.DrawOrder   = 1;
            Components.Add(Hud);

            Music             = new MusicComponent(this);
            Music.UpdateOrder = 8;
            Components.Add(Music);

            Sound             = new SoundComponent(this);
            Sound.UpdateOrder = 9;
            Components.Add(Sound);

            // Einstellungen laden
            Settings = Settings.LoadSettings();
        }
コード例 #16
0
        private void PlayStompSound(float volume)
        {
            SoundComponent stomp = this.Components.Get <SoundComponent>();

            if (!stomp.IsRunning)
            {
                stomp.Volume = volume;
                stomp.PlayPitched(0.5f);
            }
        }
コード例 #17
0
        public static void StopMusic(this SoundComponent soundComponent)
        {
            if (!s_MusicSerialId.HasValue)
            {
                return;
            }

            soundComponent.StopSound(s_MusicSerialId.Value, FadeVolumeDuration);
            s_MusicSerialId = null;
        }
コード例 #18
0
ファイル: BallComponent.cs プロジェクト: FBast/Blobal-Warming
        void Start()
        {
            rigidBody = GetComponent <Rigidbody2D>();
            Vector2 diagonalDirection = UnityEngine.Random.insideUnitCircle;

            diagonalDirection.x = diagonalDirection.x >= 0 ? 1 : -1;
            diagonalDirection.y = diagonalDirection.y >= 0 ? 1 : -1;
            rigidBody.AddForce(diagonalDirection * ballLaunchSpeed, ForceMode2D.Impulse);
            sc = GetComponent <SoundComponent>();
        }
コード例 #19
0
    public SoundComponent Play(string fileName, string soundFile, Vector3 position, bool isLoop = false, float DelayTime = 0f)
    {
        SoundComponent source = LoadAndPlay(fileName, position, this.UIBus, DelayTime);

        if (source == null)
        {
            return(null);
        }

        return(source);
    }
コード例 #20
0
    public void UnMute(string name)
    {
        SoundComponent s = Array.Find(sounds, sound => sound.name == name);

        if (s == null)
        {
            Debug.LogWarning("Sound " + name + " not found.");
            return;
        }
        s.source.volume = 1.0f;
    }
コード例 #21
0
    public void Play(string name)
    {
        SoundComponent s = Array.Find(sounds, sound => sound.name == name);

        if (s == null)
        {
            Debug.LogWarning("Sound: " + name + " not found.");
            return;
        }
        s.source.Play();
    }
コード例 #22
0
    public override void Start()
    {
        DisableRagdoll();

        // Load the ragdoll impact sound
        RagdollSound         = gameObject.AddComponent <SoundComponent>();
        RagdollSound.Type    = SoundComponent.SoundType.Effect;
        RagdollSound.Clip    = ImpactSound;
        RagdollSound.Looping = false;
        RagdollSound.Is3D    = true;
        identity             = gameObject.GetComponent <NetworkIdentity>();
    }
コード例 #23
0
        public static int?PlayMusic(this SoundComponent soundComponent, EnumSound enumSound, object userData = null)
        {
            if (enumSound == EnumSound.None)
            {
                return(null);
            }

            soundComponent.StopMusic();
            s_MusicSerialId = soundComponent.PlaySound((int)enumSound, null, userData);

            return(s_MusicSerialId);
        }
コード例 #24
0
    public bool IsPlaying(string name)
    {
        bool           check;
        SoundComponent s = Array.Find(sounds, sound => sound.name == name);

        if (s == null)
        {
            Debug.LogWarning("Sound " + name + " not found.");
            return(false);
        }
        check = s.source.isPlaying;
        return(check);
    }
コード例 #25
0
ファイル: MonoSound.cs プロジェクト: wangjie0707/Temp_01
        /// <summary>
        /// 游戏框架组件初始化。
        /// </summary>
        protected override void Awake()
        {
            base.Awake();

            m_SoundMethods = CentorPivot.This.GetComponent <SoundComponent>();
            if (m_SoundMethods == null)
            {
                Log.Fatal("Sound manager is invalid.");
                return;
            }

            m_AudioListener = gameObject.GetOrAddComponent <AudioListener>();

            SceneManager.sceneLoaded   += OnSceneLoaded;
            SceneManager.sceneUnloaded += OnSceneUnloaded;

            if (EventComponent.This == null)
            {
                Log.Fatal("Event component is invalid.");
                return;
            }

            m_SoundMethods.SetResourceManager(CentorPivot.This.GetComponent <ResourceComponent>());

            SoundHelperBase soundHelper = (SoundHelperBase)CreateHelper.Create(m_SoundHelperTypeName);

            if (soundHelper == null)
            {
                Log.Error("Can not create sound helper.");
                return;
            }

            m_SoundMethods.SetSoundHelper(soundHelper);

            if (m_InstanceRoot == null)
            {
                m_InstanceRoot = new GameObject("Sound Instances").transform;
                m_InstanceRoot.SetParent(gameObject.transform);
                m_InstanceRoot.localScale = Vector3.one;
            }

            for (int i = 0; i < m_SoundGroups.Length; i++)
            {
                if (!AddSoundGroup(m_SoundGroups[i].Name, m_SoundGroups[i].AvoidBeingReplacedBySamePriority, m_SoundGroups[i].Mute, m_SoundGroups[i].Volume, m_SoundGroups[i].AgentHelperCount))
                {
                    Log.Warning("Add sound group '{0}' failure.", m_SoundGroups[i].Name);
                    continue;
                }
            }
        }
コード例 #26
0
    /// <summary>
    /// This is main function
    /// </summary>
    /// <param name="fileName"></param>
    /// <param name="position"></param>
    /// <returns></returns>
    public SoundComponent PlayVoice(string fileName, Vector3 position)
    {
        SoundComponent source = GetAudioSource3D(fileName);

        if (source == null)
        {
            return(null);
        }

        source.gameObject.transform.localPosition = position;
        source.Play();

        return(source);
    }
コード例 #27
0
    public override void Start()
    {
        ExplosionSound         = gameObject.AddComponent <SoundComponent>();
        ExplosionSound.Type    = SoundComponent.SoundType.Effect;
        ExplosionSound.Clip    = Sound;
        ExplosionSound.Looping = true;
        ExplosionSound.Is3D    = true;
        ExplosionSound.Volume  = 0.5f;

        // 3D options
        ExplosionSound.MaxDistance = 100;
        ExplosionSound.MinDistance = 3;
        ExplosionSound.SpreadAngle = 0;
        ExplosionSound.Play();
    }
コード例 #28
0
 public static void NewLoopSoundFromComponent(SoundComponent comp, List <short> list)
 {
     if (null == list)
     {
         Logger.Error("GetNewSoundFromComponent failed , list is null");
         return;
     }
     if (null == comp)
     {
         Logger.Error("GetNewSoundFromComponent failed , comp is null");
         return;
     }
     list.Clear();
     Diff(comp.LastPlayOnce, comp.PlayOnce, list);
     comp.LastPlayOnce = comp.PlayOnce;
 }
コード例 #29
0
        private void Awake()
        {
            sound         = GetComponent <SoundComponent>();
            _inputEntity  = GetComponent <InputEntity>();
            m_Rigidbody2D = GetComponent <Rigidbody2D>();
            canDash       = true;
            if (OnLandEvent == null)
            {
                OnLandEvent = new UnityEvent();
            }

            if (OnCrouchEvent == null)
            {
                OnCrouchEvent = new BoolEvent();
            }
        }
コード例 #30
0
    public SoundComponent Play(string fileName, string soundFile, Vector3 position, bool isLoop = false, float DelayTime = 0f)
    {
        SoundComponent source = GetAudioSource3D(fileName);

        if (source == null)
        {
            return(null);
        }

        source.gameObject.transform.position      = position;
        source.gameObject.transform.localPosition = Vector3.zero;
        source._Sound.DelayTime = DelayTime;
        source.Play();

        return(source);
    }
コード例 #31
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            AggregateFactory = new AggregateFactory(this);
            WeaponFactory = new WeaponFactory(this);
            DoorFactory = new DoorFactory(this);
            RoomFactory = new RoomFactory(this);
            CollectableFactory = new CollectibleFactory(this);
            WallFactory = new WallFactory(this);
            EnemyFactory = new EnemyFactory(this);
            SkillEntityFactory = new SkillEntityFactory(this);
            NPCFactory = new NPCFactory(this);

            // Initialize Components
            PlayerComponent = new PlayerComponent();
            LocalComponent = new LocalComponent();
            RemoteComponent = new RemoteComponent();
            PositionComponent = new PositionComponent();
            MovementComponent = new MovementComponent();
            MovementSpriteComponent = new MovementSpriteComponent();
            SpriteComponent = new SpriteComponent();
            DoorComponent = new DoorComponent();
            RoomComponent = new RoomComponent();
            HUDSpriteComponent = new HUDSpriteComponent();
            HUDComponent = new HUDComponent();
            InventoryComponent = new InventoryComponent();
            InventorySpriteComponent = new InventorySpriteComponent();
            ContinueNewGameScreen = new ContinueNewGameScreen(graphics, this);
            EquipmentComponent = new EquipmentComponent();
            WeaponComponent = new WeaponComponent();
            BulletComponent = new BulletComponent();
            PlayerInfoComponent = new PlayerInfoComponent();
            WeaponSpriteComponent = new WeaponSpriteComponent();
            StatsComponent = new StatsComponent();
            EnemyAIComponent = new EnemyAIComponent();
            NpcAIComponent = new NpcAIComponent();

            CollectibleComponent = new CollectibleComponent();
            CollisionComponent = new CollisionComponent();
            TriggerComponent = new TriggerComponent();
            EnemyComponent = new EnemyComponent();
            NPCComponent = new NPCComponent();
            //QuestComponent = new QuestComponent();
            LevelManager = new LevelManager(this);
            SpriteAnimationComponent = new SpriteAnimationComponent();
            SkillProjectileComponent = new SkillProjectileComponent();
            SkillAoEComponent = new SkillAoEComponent();
            SkillDeployableComponent = new SkillDeployableComponent();
            SoundComponent = new SoundComponent();
            ActorTextComponent = new ActorTextComponent();
            TurretComponent = new TurretComponent();
            TrapComponent = new TrapComponent();
            ExplodingDroidComponent = new ExplodingDroidComponent();
            HealingStationComponent = new HealingStationComponent();
            PortableShieldComponent = new PortableShieldComponent();
            PortableStoreComponent = new PortableStoreComponent();
            ActiveSkillComponent = new ActiveSkillComponent();
            PlayerSkillInfoComponent = new PlayerSkillInfoComponent();

            Quests = new List<Quest>();

            #region Initialize Effect Components
            AgroDropComponent = new AgroDropComponent();
            AgroGainComponent = new AgroGainComponent();
            BuffComponent = new BuffComponent();
            ChanceToSucceedComponent = new ChanceToSucceedComponent();
            ChangeVisibilityComponent = new ChangeVisibilityComponent();
            CoolDownComponent = new CoolDownComponent();
            DamageOverTimeComponent = new DamageOverTimeComponent();
            DirectDamageComponent = new DirectDamageComponent();
            DirectHealComponent = new DirectHealComponent();
            FearComponent = new FearComponent();
            HealOverTimeComponent = new HealOverTimeComponent();
            InstantEffectComponent = new InstantEffectComponent();
            KnockBackComponent = new KnockBackComponent();
            TargetedKnockBackComponent = new TargetedKnockBackComponent();
            ReduceAgroRangeComponent = new ReduceAgroRangeComponent();
            ResurrectComponent = new ResurrectComponent();
            StunComponent = new StunComponent();
            TimedEffectComponent = new TimedEffectComponent();
            EnslaveComponent = new EnslaveComponent();
            CloakComponent = new CloakComponent();
            #endregion

            base.Initialize();
        }