Exemple #1
0
 /// <summary>
 /// Creates a simple transformable sound emitter.
 /// </summary>
 /// <param name="soundSystem"></param>
 /// <param name="soundName"></param>
 public TestAudio3DEmitter(ISoundSystem soundSystem, string soundName)
     : base(null)
 {
     system           = soundSystem;
     fireSound        = system.CreateSound(soundName);
     fireSound.Parent = this;
 }
Exemple #2
0
 // Start is called before the first frame update
 void Start()
 {
     rb = GetComponent <Rigidbody2D>();
     dd = new DamageSystemBullet(gameObject, 1, 1);
     ss = new SoundSystemDefault(gameObject, Sounds.GunCollision, 0.5f);
     rb.AddForce(bulletDirection * bulletSpeed, ForceMode2D.Impulse);
 }
Exemple #3
0
 public DamageSystemBullet(GameObject damagingObject, int damagePoints, float knockbackStrength)
 {
     DamagingObject    = damagingObject;
     DamagePoints      = damagePoints;
     KnockbackStrength = knockbackStrength;
     ssHit             = new SoundSystemDefault(damagingObject, Sounds.MonsterHurt, 0.6f);
 }
 // Start is called before the first frame update
 void Start()
 {
     bullet    = Resources.Load <GameObject>("Prefabs/Bullet");
     cam       = Camera.main;
     character = transform.gameObject.GetComponent <Character>();
     ss        = new SoundSystemDefault(gameObject, Sounds.GunShot, 0.5f);
 }
Exemple #5
0
    protected void Start()
    {
        base.Start();
        pushDistance *= transform.localScale.x;
        //определение точки, из которой начинается поиск объекта
        rayStart        = gameObject.transform.position;
        pistonRotation  = gameObject.transform.rotation.eulerAngles;
        pistonDirection = Quaternion.Euler(pistonRotation) * Vector2.down;
        //pushDistance = GetComponent<Collider2D>().bounds.size.y;
        pistonAnim      = GetComponent <Animator>();
        pistonLightAnim = transform.Find("LightSource").gameObject.GetComponent <Animator>();
        pistonHead      = transform.Find("pistonHead");
        pistonHeadSize  = pistonHead.gameObject.GetComponent <SpriteRenderer>().size;
        pistonHeadScale = pistonHead.localScale;
        pistonHeadPos   = pistonHead.position;
        ssPiston        = new SoundSystemDefaultLooping(gameObject, Sounds.PistonMovement, 0.6f);

        /*
         * Собственно поиск объекта.
         * При коллизии с объектом, связывает его с поршнем.
         * Также возврщает true в isConnected.
         */
        isConnected = Physics2D.Raycast(rayStart, pistonDirection, 5f * transform.localScale.x, m);
        if (isConnected)
        {
            //связь объекта с поршнем
            RaycastHit2D hit = Physics2D.Raycast(rayStart, pistonDirection, 5f, m);
            pulledObjPos = hit.transform.position;
            pulledObject = hit.collider.gameObject;
        }
    }
        private void Start()
        {
            iSoundSystem         = UIManager.Instance.GetComponent <ISoundSystem>();
            interactivityMonitor = GetComponent <InteractivityMonitor>();

            interactivityMonitor?.InteractivityChangedEvent.AddListener(SetAudioClip);
        }
 public HealthSystemWithShader(int healthPoints, GameObject healthyObject, float fade)
 {
     HealthPoints   = healthPoints;
     HealthyObject  = healthyObject;
     shaderMaterial = healthyObject.GetComponent <SpriteRenderer>().material;
     Fade           = fade;
     ssDeath        = new SoundSystemDefault(healthyObject, Sounds.DeathScore, 0.6f);
 }
Exemple #8
0
 public DamageSystem(GameObject damagingObject, int damagePoints, float knockbackStrength, float damageDelay)
 {
     DamagingObject    = damagingObject;
     DamagePoints      = damagePoints;
     KnockbackStrength = knockbackStrength;
     DamageDelay       = damageDelay;
     ssHit             = new SoundSystemDefault(damagingObject, Sounds.DamageHit, 0.6f);
 }
        public SoundTestSystem(IWorld world, ISoundSystem soundSystem, IInputManager inputManager) : base(world, world.EntityFilter(10).With <SoundClipComponent>())
        {
            _keyboard = inputManager.Keyboard;
            _sound    = Map <SoundClipComponent>();

            _soundEffects = soundSystem.GetPlayer("SoundEffects");
            _music        = soundSystem.GetPlayer("Music");

            _volume = _soundEffects.GetVolume();
        }
Exemple #10
0
 /// <summary>
 /// Ordinary constructor.
 /// </summary>
 /// <param name="game">Main game object</param>
 /// <param name="list">Game sound listener</param>
 /// <param name="sname">Sound name</param>
 /// <param name="e">XACT audio engine</param>
 /// <param name="banks">XACT sound banks</param>
 /// <param name="waves">XACT wave banks</param>
 /// <param name="stype">Sound type</param>
 /// <param name="soundSystem">Current sound system</param>
 public Sound(ICanyonShooterGame game, SoundListener list, string sname,
              AudioEngine e, SoundBank banks, WaveBank waves, SoundType stype, ISoundSystem soundSystem)
     : base(game)
 {
     this.soundSystem = soundSystem;
     engine           = e;
     bank             = banks;
     wave             = waves;
     box  = list;
     name = sname;
     cue  = bank.GetCue(Name);
     type = stype;
 }
Exemple #11
0
        /// <summary>
        /// Setup the test environment.
        /// </summary>
        /// <param name="game"></param>
        public void SetUp(ICanyonShooterGame game)
        {
            // Create sound system
            sounds = new SoundSystem(game);

            // Create the listener
            listener = new SoundListener(game);

            // Set global volumes
            sounds.EffectVolume = 0.8f;

            // The listener "player"
            sounds.SoundListener = listener;
        }
        /// <summary>
        /// Setup the test environment.
        /// </summary>
        /// <param name="game"></param>
        public void SetUp(ICanyonShooterGame game)
        {
            // Create sound system
            sounds = new SoundSystem(game);

            // Load all sounds
            sndFire   = sounds.CreateSound("MFireLoop");
            sndStop   = sounds.CreateSound("MFireStop");
            sndStart  = sounds.CreateSound("MFireStart");
            sndAmmo   = sounds.CreateSound("ReleaseMines");
            sndReload = sounds.CreateSound("Ammo");

            // Set global volumes
            sounds.EffectVolume = 0.8f;
        }
Exemple #13
0
        public bool Create(ISoundSystem AudioSystem)
        {
            if (AudioSystem is FMOD_SoundSystem)
            {
                m_system  = AudioSystem as FMOD_SoundSystem;
                m_status  = StreamStatus.Created;
                m_sound   = null;
                m_channel = null;

                Console.WriteLine("[FMOD] SoundStream created");
            }
            else
            {
                throw new NotSupportedException("Create SoundSystem");
            }



            return(true);
        }
Exemple #14
0
 public static void Initialize(ISoundSystem soundSystem)
 {
     m_instance = soundSystem;
 }
Exemple #15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CanyonShooterGame"/> class.
        /// </summary>
        public CanyonShooterGame(string[] args)
        {
            Args   = new Arguments(args);
            states = new GameStates(this, Components);
            config = new Config();
            graphicsDeviceManager = new GraphicsDeviceManager(this);
            content = new ContentManager(Services);

            graphics          = new Graphics(this, graphicsDeviceManager);
            this.Window.Title = " CanyonShooter";

            Intercom.Game = this;

            #region Commandline Parameter Settings:

            #region Parameter: --setShaderModel

            if (Args["setShaderModel"] == "2")
            {
                graphics.ShaderModel3SupportedOverride = true;
            }
            #endregion

            #region Parameter: --debug

            if (Args["debug"] == "1")
            {
                debugMode = true;
            }
            #endregion

            #region Parameter: --multiThreaded
            // Physik Intialisierung

            /*if (Args["multiThreaded"] != null)
             * {
             *  if(Args["multiThreaded"] == "1")
             *      physics = new Physics(this, true);
             *  else
             *  {
             *      physics = new Physics(this, false);
             *      Components.Add(physics);
             *  }
             * }
             * else*/// automatically set threading-mode
            {
                /*if (Environment.ProcessorCount > 1)
                 * {
                 *  physics = new Physics(this, true);
                 * }
                 * else*/
                {
                    physics = new Physics(this, false);
                    Components.Add(physics);
                }
            }
            #endregion

            #region Parameter: --testAudio
            // Test Audio Framework *******************************
            if (Args["testAudio"] == "1")
            {
                TestAudioPlayback test1 = new TestAudioPlayback();
                test1.SetUp(this);
                test1.TestMinigunPlayback();
                test1.TearDown();

                TestAudio3D test2 = new TestAudio3D();
                test2.SetUp(this);
                test2.TestPlayback3D();
                test2.TearDown();
            }
            #endregion

            #endregion

            // Create sound system by M.Rodriguez
            sounds = new SoundSystem(this);

            // Set global volumes by M.Rodriguez
            sounds.EffectVolume = 1.0f;
            sounds.MusicVolume  = 0.3f;

            // Initialisieren der einzelnen Komponenten:
            input      = new Input(this);
            renderer   = new Renderer(this, Components);
            effects    = new EffectFactory(this);
            highscores = new Highscores(this);

            GraphicalConsole.GetSingleton(this).RegisterObjectProperty(graphics, "Graphics", "Fullscreen");

            GraphicalConsole.GetSingleton(this).RegisterObjectProperty(renderer, "Renderer", "DrawCollisionShapes");

            GraphicalConsole.GetSingleton(this).RegisterObjectFunction(Args, "Args", "ListParameters");
            if (Args["enable3DMouse"] == "1")
            {
                hasSpaceMouse = true;
                device        = new TDxInput.Device();
            }
            states.SetStateStart();

            // states.SetStateDebugMode();
        }
Exemple #16
0
 private void Start()
 {
     m_soundSystem = GetSoundSystem();
 }
 public PlayerStepMakesSoundRule(ISystemContainer systemContainer)
 {
     _soundSystem     = systemContainer.SoundSystem;
     _prototypeSystem = systemContainer.PrototypeSystem;
 }
Exemple #18
0
 public virtual void Start(Size size, ISoundSystem system)
 {
     m_size        = size;
     m_soundSystem = system;
 }
 // Start is called before the first frame update
 void Start()
 {
     ssLevelComplete = new SoundSystemDefault(gameObject, Sounds.VictoryScore, 0.5f);
 }
Exemple #20
0
 /*
  * Состояние этого элемента изменяемо игроком посредством коллизии,
  * передает свое состояние в другие элементы
  */
 protected override void Start()
 {
     base.Start();
     ssInput = new SoundSystemDefault(gameObject, Sounds.InputChange, 0.6f);
 }
Exemple #21
0
 public bool Create(ISoundSystem AudioSystem)
 {
     Console.WriteLine("[Dummy] Stream is created: ");
     return(true);
 }
Exemple #22
0
 // Start is called before the first frame update
 void Start()
 {
     scoreBoard = GetComponent <Text>();
     ss         = new SoundSystemDefault(gameObject, Sounds.VictoryScore, 0.5f);
 }
 public MissMakesSoundRule(ISystemContainer systemContainer)
 {
     _soundSystem     = systemContainer.SoundSystem;
     _prototypeSystem = systemContainer.PrototypeSystem;
 }
Exemple #24
0
 public virtual void Start()
 {
     iSoundSystem = UIManager.Instance.ISoundSystem;
 }
Exemple #25
0
 public void Start()
 {
     ssAmbient = new SoundSystemAmbient(gameObject, 0.1f);
 }
Exemple #26
0
        public static void Init()
        {
            Game.Clock = new DOM_Clock();
            //Game.Clock.Start();

            //I must be script#'ing wrong. This won't fire here.
            InputManager.Input.Init();
            // Set up the local player
            Player LocalPlayer = new Player();
            //Surface.Initialize(new DOM_Renderer());
            //Surface.Initialize(new Canvas_Renderer());
            Game.Renderer = new Canvas_Renderer();
            SoundSystem = new HTML5_Audio();
            //set up the primary view
            // Remember to initialize the renderer first!
            View playerOneView = new View(LightingStyle.Tiles);
            playerOneView.SetArea(new Rectangle(0, 0, Renderer.GetSize().width, Renderer.GetSize().height));

            //notificationLayer = new GuiLayer(playerOneView, new Rectangle(0, 0, 0, 0));
            notificationLayer = playerOneView.AddLayer("NotificationLayer", new Rectangle(0, 0, 0, 0));
            notificationLayer.SetSize(522, 60);
            //notificationLayer.Hide();

            //create two gui elements on the layer:
            //an image on the left
            GuiElement notifIcon = notificationLayer.AddGUIElement("");
            notifIcon.AddStyle("notifIcon");
            notifIcon.SetPosition(12, 0);
            //and sender on the right
            GuiElement notifSender = notificationLayer.AddGUIElement("");
            notifSender.SetPosition(58, 0);
            notifSender.SetSize(474, 12);
            //and the sender's handle, if applicable
            GuiElement notifSenderHandle = notificationLayer.AddGUIElement("");
            notifSenderHandle.SetPosition(80, 0);
            notifSenderHandle.SetSize(474, 12);
            notifSenderHandle.AddStyle("tweetName");
            //and the text on the right
            GuiElement notifText = notificationLayer.AddGUIElement("");
            notifText.SetPosition(58, 18);
            notifText.SetSize(474, 40);
            notificationLayer.Hide();

            //clockRenderguy = Game.Clock.AddRender(Game.Renderer.RenderUpdate);
            //clockRenderguy = Game.Clock.AddRender(Game.Renderer.Render);

            //reposition the notification layer after a few seconds
            string notif_repos = Clock.AddRender(reposition_notification_layeer);
            Clock.delayRender(notif_repos, 2);

            Clock.AddCalculation(StandardCalculations);
            Clock.IntervalExecute(Game.StandardIntervalCalculations, .2);
            Game.Paused = false;
        }
 private void Setup()
 {
     IConnected   = GetComponent <IConnected>();
     ISoundSystem = GetComponent <ISoundSystem>();
 }