Ejemplo n.º 1
0
 void TriggerReturnToTitleScreen()
 {
     Disable();
     TriggerFade(ReturnToTitleScreen, new Color(0, 0, 0, 0));
     AudioHandler.Play("selection");
     ArrowFeedback.Left();
 }
Ejemplo n.º 2
0
        public virtual void GrantTurn()
        {
            LevelScene.CurrentTurnOwnerDamageDealt = TurnDamageDealt = new ProjectileDamage(Owner.ID);

            OnGrantTurn?.Invoke();
            OnGrantTurn = default;

            LevelScene.CurrentTurnOwner = SyncMobile;

            Movement.RemainingStepsThisTurn = Movement.MaximumStepsPerTurn;
            Movement.IsAbleToMove           = true;
            IsAbleToShoot   = true;
            IsAbleToUseItem = true;

            if (IsPlayable)
            {
                SyncMobile.ReduceSSCooldown();
                if (SyncMobile.SSLockRemainingTurns == 0)
                {
                    LevelScene.HUD.EnableSS();
                }
            }

            LevelScene.HUD.GrantTurn(this);

            Crosshair.PlayAnimation();

            AudioHandler.PlaySoundEffect(SoundEffectParameter.InGameGameplayNewTurn);

            GameScene.Camera.TrackObject(this);
        }
Ejemplo n.º 3
0
 public new virtual void PlayUnableToMoveSE(float pitch = 0, float pan = 0)
 {
     if (IsAbleToShoot)
     {
         AudioHandler.PlayUniqueSoundEffect(unableToMoveSE, () => MobileFlipbook.State == ActorFlipbookState.UnableToMove, pitch: pitch, pan: pan);
     }
 }
    void Start()
    {
        playerAnimator  = GeneralFinder.player.GetComponent <Animator> ();
        playerRigidbody = GeneralFinder.player.GetComponent <Rigidbody2D> ();

        audioHandler = GetComponent <AudioHandler> ();

        if (darkScreenVar.darkScreenObject != null)
        {
            darkScreenVar.spriteRenderer = darkScreenVar.darkScreenObject.GetComponent <SpriteRenderer> ();
        }

        if (lanternImageVar.lanternImage != null)
        {
            lanternImageVar.spriteRenderer = lanternImageVar.lanternImage.GetComponent <SpriteRenderer> ();
        }

        if (groundRisingVar.groundToRise != null)
        {
            groundRisingVar.beginPosition = groundRisingVar.groundToRise.transform.position;
        }

        takeSpotlightElements();
        lanternTextStart();
        coriandoliStart();
        proseguireStart();

        if (music != null)
        {
            musicStandardVolume = music.volume;
        }
    }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        if (Application.isEditor)
        {
            SceneManager.LoadScene("Game", LoadSceneMode.Additive);
        }

        AudioHandler.Load("jump");
        AudioHandler.Load("hit1");
        AudioHandler.Load("hit2");
        AudioHandler.Load("hit3");

        _body            = GetComponent <Rigidbody2D> ();
        _audio           = GetComponent <AudioSource> ();
        _jumpTimer       = 0f;
        _jumping         = false;
        _firstHit        = true;
        _isHittingGround = false;
        _isHittingWall   = false;
        _shouldHitSound  = false;

        Messenger.AddListener("LevelStart", ActivateControl);
        Messenger.AddListener("LevelPause", PauseControl);
        Messenger.AddListener("LevelResume", ResumeControl);

        this.enabled = false;
    }
Ejemplo n.º 6
0
 private void QuitClick(int playerNr)
 {
     if (inModOptions == true)
     {
         UIScreen.Open(ScreenType.MENU_OPTIONS, 1);
     }
     else
     {
         if (submenu != null)
         {
             if (submenu.screenType == ScreenType.MENU_MAIN)
             {
                 DNPFJHMAIBP.GKBNNFEAJGO(Msg.QUIT, playerNr, -1);
             }
             else
             {
                 DNPFJHMAIBP.GKBNNFEAJGO(Msg.BACK, playerNr, -1);
             }
         }
     }
     if (UIScreen.currentScreens[1].screenType == ScreenType.MENU_OPTIONS)
     {
         mainmenu.lbTitle.text = "OPTIONS";
         inModOptions          = false;
         inModSubOptions       = false;
         AudioHandler.PlayMenuSfx(Sfx.MENU_BACK);
         AudioHandler.PlayMenuSfx(Sfx.MENU_CONFIRM);
     }
 }
Ejemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        AudioHandler.Load("selection");

        Messenger.AddListener("Touch.Left", TriggerReturnToTitleScreen);
        Messenger.AddListener("Touch.Right", TriggerGameStart);
    }
Ejemplo n.º 8
0
    void OnFail()
    {
        AudioHandler.Play(failSound);

        challengeFailed.Play(EventArgs.Empty);
        fail.SetActive(true);
    }
Ejemplo n.º 9
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        if (_activated || collider.gameObject.name != "Ball")
        {
            return;
        }

        _activated = true;
        _collider  = collider;
        _collider.attachedRigidbody.gravityScale = 0.0f;
        _collider.attachedRigidbody.AddTorque(torque, ForceMode2D.Impulse);

        var ballControl = collider.GetComponent <BallControl> ();

        if (ballControl != null)
        {
            ballControl.enabled = false;
            ballControl.StopAudio();
        }

        GameTimer.running = false;
        GameState.FinishedLevel(GameTimer.time);

        Messenger.Broadcast("LevelEnding");

        AudioHandler.Play("level_end");
    }
Ejemplo n.º 10
0
 // Start is called before the first frame update
 void Start()
 {
     rb     = this.GetComponent <Rigidbody2D>();
     player = GameObject.Find("Player");
     pos    = this.transform.position;
     audio  = GameObject.Find("AudioHandler").GetComponent <AudioHandler>();
 }
Ejemplo n.º 11
0
 public new virtual void PlayMovementSE(float pitch = 0, float pan = 0)
 {
     if (IsAbleToShoot)
     {
         AudioHandler.PlayUniqueSoundEffect(movingSE, () => IsStateMoving(MobileFlipbook.State), pitch: pitch, pan: pan);
     }
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="bodyTexture"></param>
        /// <param name="scale"></param>
        /// <param name="moveData"></param>
        /// <remarks>Load moves in this order: IdleIndex, WalkIndex, JumpIndex, SpecialIndex, SideSpecialIndex,
        /// UpSpecialIndex, DownSpecialIndex, BasicIndex</remarks>
        public void LoadCharacterContent(Texture2D bodyTexture, int scale,
                                         params Tuple <float, Point, Texture2D, SoundEffect, SimpleMove>[] moveData)
        {
            CharacterVertices = CreateVerticesFromTexture(bodyTexture, scale);
            ImplimentedMoves  = moveData.Length;
            BodyTexture       = bodyTexture;
            MoveData          = moveData;
            MoveFunctions     = new SimpleMove[ImplimentedMoves];
            MoveTextures      = new CharacterAction[ImplimentedMoves];
            MoveAudio         = new AudioHandler[ImplimentedMoves];
            Scale             = scale;
#if RECTANGLE_BODY
            CharacterOrigin = new Vector2(bodyTexture.Width / 2F, bodyTexture.Height / 2F);
#else
            CharacterOrigin = new Vector2(0, bodyTexture.Height);
#endif

            for (int i = 0; i < ImplimentedMoves; ++i)
            {
                MoveFunctions[i] = moveData[i].Item5;
                MoveTextures[i]  = new CharacterAction(moveData[i].Item1, moveData[i].Item2, moveData[i].Item3, Scale);
                if (moveData[i].Item4 != null)
                {
                    MoveAudio[i] = new AudioHandler(moveData[i].Item4);
                }
            }
        }
 public void Stop()
 {
     foreach (ClipPlayer clipPlayer in clipPlayers)
     {
         AudioHandler.Stop(clipPlayer);
     }
 }
Ejemplo n.º 14
0
    /// <summary>Instantiates the clicked tower into the game somewhere.</summary>
    private void TowerClicked(GameObject prefab)
    {
        // Return if already purchasing to avoid nasty bugs :P
        if (selectedTowerForPurchase != null || bSelling)
        {
            return;
        }

        AudioHandler.ClickSound();

        GameObject ins = Object.Instantiate(prefab, TowerManager.towersContainer);

        ins.GetComponent <RectTransform>().anchoredPosition = new Vector2(GameManager.CANVAS_WIDTH / 2.0f, GameManager.CANVAS_HEIGHT / -2.0f);
        ins.SetActive(true);
        selectedTowerForPurchase = ins.GetComponent <ITower>();
        selectedCp         = ins.GetComponent <TowerClickPoint>();
        selectedCp.enabled = false;                                                                   // Don't allow clicking for sell while purchasing.
        selectedTd         = selectedTowerForPurchase.GetRangeCircle().AddComponent <TowerDisplay>(); // To allow dragging.
        selectedTd.Initialise();
        selectedTowerForPurchase.ShowRangeCircle(true);
        selectedTowerForPurchase.SetEnabled(false);

        // Show the buy options
        buyOptions.alpha = 1.0f;
        buyOptions.gameObject.SetActive(true);

        label_selectedInfoHeader.text  = selectedTowerForPurchase.MyInfo().towerName;
        label_selectedInfoContent.text = selectedTowerForPurchase.MyInfo().towerDescription;

        bBuying = true;
    }
Ejemplo n.º 15
0
 protected override void LoadContent()
 {
     // Load any game content
     // ================
     TextureHandler.LoadContent();
     AudioHandler.LoadContent();
 }
Ejemplo n.º 16
0
    IEnumerator GetManagers()
    {
        yield return(new WaitForSeconds(.1f));

        AH = FindObjectOfType <AudioHandler>();
        Debug.Log(AH.gameObject.GetInstanceID());
    }
Ejemplo n.º 17
0
    private void TowerPurchaseConfirm()
    {
        // Return if it's on the path.
        if (!selectedTd.validPosition)
        {
            return;
        }

        AudioHandler.ClickSound();

        //Debug.Log(selectedTowerForPurchase.GetGameobject().name);

        selectedTowerForPurchase.ShowRangeCircle(false);
        selectedTowerForPurchase.SetEnabled(true);
        selectedTowerForPurchase.LockMovement();

        selectedCp.enabled = true;

        // Remove the cost from the health (needs to be down here)
        healthFlag     = true;
        Player.health -= selectedTowerForPurchase.MyInfo().cost;
        healthFlag     = false;

        HideBuyOptions();
    }
Ejemplo n.º 18
0
 void Awake()
 {
     myRigidbody = GetComponent <Rigidbody2D>();
     fx          = FindObjectOfType <VFXHandler>();
     AH          = FindObjectOfType <AudioHandler>();
     Debug.Log(AH.gameObject.GetInstanceID());
 }
Ejemplo n.º 19
0
    //--------INITIALIZATION AND ACTIVATION-------------------------------------

    protected override void initializeTool()
    {
        glassesManager  = transform.GetComponent <GlassesManager> ();
        graphicLantern  = GetComponent <GraphicLantern> ();
        returnParticles = GetComponentInChildren <ReturnParticles> ();
        audioHandler    = GetComponent <AudioHandler> ();
    }
Ejemplo n.º 20
0
 void Awake()
 {
     if (!m_cameraHolder)
     {
         m_cameraHolder = GameObject.Find("CameraHolder");
     }
     if (!m_camera)
     {
         m_camera = gameObject.GetComponent <Camera>();
         gameObject.transform.rotation = Quaternion.Euler(73f, 0f, 0f);
         m_camera.fieldOfView          = 40;
     }
     if (!m_cameraHolderBoxCollider)
     {
         if (!m_cameraHolder.GetComponent <BoxCollider>())
         {
             m_cameraHolder.AddComponent <BoxCollider>();
         }
         m_cameraHolderBoxCollider = m_cameraHolder.gameObject.GetComponent <BoxCollider>();
     }
     m_cameraHolderBoxCollider.size.Set(136f, 10f, 74f);
     if (!m_cameraHolderRigidbody)
     {
         m_cameraHolderRigidbody = m_cameraHolder.GetComponent <Rigidbody>();
     }
     m_cameraHolderRigidbody.useGravity  = false;
     m_cameraHolderRigidbody.constraints = (RigidbodyConstraints)116;//freeze y position and all rotations
     if (!m_audioHandler)
     {
         m_audioHandler = gameObject.GetComponent <AudioHandler>();
         float soundAjustment = 0.6f - ((m_camera.fieldOfView - 5) * 0.01f);
         m_audioHandler.ChangeVolumeTo(soundAjustment);
     }
 }
Ejemplo n.º 21
0
 void TriggerAbout()
 {
     Disable();
     TriggerFade(About, new Color(0, 0, 0, 0));
     AudioHandler.Play("selection");
     ArrowFeedback.Up();
 }
        public async Task <IHttpActionResult> AddToLiveStream(Byte[] bytes)
        {
            try
            {
                if (bytes == null)
                {
                    String msg = "bytes parameter is null";
                    _logger.LogWarning(msg);
                    return(BadRequest(msg));
                }

                if (bytes.Length == 0)
                {
                    String msg = "bytes parameter contains zero elements";
                    _logger.LogWarning(msg);
                    return(BadRequest(msg));
                }

                await AudioHandler.WriteToBuffer(bytes);

                return(Ok());
            }
            catch (Exception ex)
            {
                String errMsg = "Exception in AddToLiveStream";
                _logger.LogError(ex, errMsg);

                return(InternalServerError(ex));
            }
        }
Ejemplo n.º 23
0
        public void Die()
        {
            AudioHandler.PlaySoundEffect("Debris");
            GameObject _particles = Instantiate(rockParticles, particlePoint.position, Quaternion.identity);

            Destroy(this.gameObject);
        }
        public IHttpActionResult StopLiveStream()
        {
            try
            {
                CurrentSessionHandler session = new CurrentSessionHandler(HttpContext.Current.Session);

                if (String.IsNullOrWhiteSpace(session.Username))
                {
                    return(Ok(false));
                }

                Boolean result = AudioHandler.FlagForceStopStream(session.Username);
                if (result)
                {
                    _logger.LogInfo($"Flagged stream for user '{session.Username}' to be stopped.");
                }

                return(Ok(result));
            }
            catch (Exception ex)
            {
                String errMsg = "Exception in AudioController.StopLiveStream";
                _logger.LogError(ex, errMsg);

                return(InternalServerError(ex));
            }
        }
Ejemplo n.º 25
0
 void TriggerExit()
 {
     Disable();
     TriggerFade(Exit, new Color(0, 0, 0, 0));
     AudioHandler.Play("selection");
     ArrowFeedback.Right();
 }
Ejemplo n.º 26
0
 public void Stop()
 {
     if (playing)
     {
         AudioHandler.Stop(clipPlayer);
     }
 }
Ejemplo n.º 27
0
 private void ExitItem_Click(object sender, EventArgs e)
 {
     closing            = true;
     notifyIcon.Visible = false;
     AudioHandler.Dispose();
     System.Windows.Application.Current.Shutdown();
 }
Ejemplo n.º 28
0
 // Collision detection
 private void OnCollisionEnter2D(Collision2D collision)
 {
     AudioHandler.PlaySound(Sounds.playerHurt);
     GameVariables.Health -= 100;
     hitObstacleEvent.Invoke(transform.position);
     Destroy(gameObject);
 }
Ejemplo n.º 29
0
    private void Start()
    {
        audioHandler      = GetComponentInChildren <AudioHandler>();
        dataHandler       = GetComponentInChildren <DataHandler>();
        objectHandler     = GetComponentInChildren <ObjectHandler>();
        errorHandler      = GetComponentInChildren <ErrorHandler>();
        networkHandler    = GetComponentInChildren <NetworkHandler>();
        preferenceHandler = GetComponentInChildren <PreferenceHandler>();
        languageHandler   = GetComponentInChildren <LanguageHandler>();

        screenHandler = GetComponentInChildren <ScreenHandler>();

        // Do the objectserching
        screenHandler.EnableAll();
        objectHandler.Initialize();
        languageHandler.Initialize();
        screenHandler.DisableAll();

        if (preferenceHandler.GetUsername() == "")
        {
            screenHandler.OpenPreferences();
        }
        else
        {
            screenHandler.OpenMainMenu();
        }
    }
Ejemplo n.º 30
0
 void TriggerGameStart()
 {
     Disable();
     TriggerFade(GameStart, new Color(1, 1, 1, 0));
     AudioHandler.Play("selection");
     ArrowFeedback.Right();
 }
Ejemplo n.º 31
0
    // Use this for initialization
    void Start () {
        anim = GetComponentInChildren<Animator>();
        if (audioHandler == null) audioHandler = GameObject.Find("AudioHandler").GetComponent<AudioHandler>();
        Oldmouseloc = Input.mousePosition;
		controllmethod = Controllmethod.Controller;
		ProgressBar progresbar = progressbar.GetComponent<ProgressBar> ();
		progresbar.DisableBar ();
	}
Ejemplo n.º 32
0
        public Cue PlaySound(string soundName, AudioListener audioListener, AudioEmitter audioEmitter, AudioHandler callback)
        {
            Cue result = PlaySound(soundName, audioListener, audioEmitter);

            // todo: need to make this multicast
            if (callbackList[result] != null)
            {
                callbackList[result].Invoke(result);
            }

            callbackList[result] = callback;
            return result;
        }
Ejemplo n.º 33
0
    void Awake()
    {
        AudioSource[] aSource = GetComponents<AudioSource>();

        m_BackgroundSource = aSource[0];
        m_SoundEffectSource = aSource[1];

        if (Instance != null && Instance != this)
        {
            Destroy(gameObject);
        }
        Instance = this;

        DontDestroyOnLoad(gameObject);
    }
Ejemplo n.º 34
0
        public AudioDriver(Settings settings, AudioHandler handler, byte[] data)
            : base(LibFluidsynth.Audio.new_fluid_audio_driver2 (settings.Handle, (dt, len, nin, inBuffer, nout, outBuffer) => {
				try {
					var bufPtrs = new IntPtr [nout];
					Marshal.Copy (outBuffer, bufPtrs, 0, nout);
					var buf = new float [nout] [];
					for (int i = 0; i < nout; i++)
						Marshal.Copy (bufPtrs [i], buf [i], 0, len);
					handler (dt, buf);
					return 0;
				} catch (Exception) {
					return -1;
				}
				}, data), true)
        {
        }
Ejemplo n.º 35
0
        public MediaManager(ICall call)
        {
            mediaConnector = new MediaConnector();

            phoneCallAudioReceiver = new AudioMixerMediaHandler();
            phoneCallAudioSender = new AudioMixerMediaHandler();

            incomingAudioMixer = new AudioMixerMediaHandler();
            outgoingAudioMixer = new AudioMixerMediaHandler();

            call.ConnectAudioSender(outgoingAudioMixer);
            call.ConnectAudioReceiver(incomingAudioMixer);
            //mediaConnector.Connect(phoneCallAudioReceiver, incomingAudioMixer);
            //mediaConnector.Connect(outgoingAudioMixer, phoneCallAudioSender);

            //phoneCallAudioReceiver.AttachToCall(call);
            //phoneCallAudioSender.AttachToCall(call);
        }
Ejemplo n.º 36
0
    // Use this for initialization
    void Start () {
        if (audioHandler == null) audioHandler = GameObject.Find("AudioHandler").GetComponent<AudioHandler>();
        if (hp == 0) hp = 150F;
        player = GameObject.Find("Player"); // TODO from creation
	}
Ejemplo n.º 37
0
        public Cue PlaySound(string soundName, AudioHandler callback)
        {
            Cue result = PlaySound(soundName);

            // todo: need to make this multicast
            if (callbackList.ContainsKey(result))
            {
                callbackList[result].Invoke(result);
            }

            callbackList[result] = callback;
            return result;
        }
Ejemplo n.º 38
0
 //only important 'event'
 void Awake()
 {
     _instance = this;
     audioSource = gameObject.AddComponent<AudioSource>();
     audioSource.loop = true;
     audioSource.playOnAwake = false;
     isPreparedToPlay = true;
     fadeTime = -1;
     DontDestroyOnLoad(transform.gameObject);
 }
Ejemplo n.º 39
0
 // Use this for initialization
 void Start () {
     audioHandler = GameObject.Find("AudioHandler").GetComponent<AudioHandler>();
     audioHandler.PlaySound(soundName);
 }
    // Use this for initialization
    void Start()
    {
        // Set the instance property equal to 'this' instance
        Instance = gameObject.GetComponent<AudioHandler>();

        // Make the music fade in
        musicState = MusicState.FadingIn;
    }
Ejemplo n.º 41
0
 public bool DisconnectAudioReceiver(CallParty side, AudioHandler receiver)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 42
0
 public bool ConnectAudioSender(CallParty side, AudioHandler sender)
 {
     throw new NotImplementedException();
 }