コード例 #1
0
 private void Awake()
 {
     _pickUp = GetComponent <ParticleSystem>();
     _colliderToDeactivate = GetComponent <Collider>();
     _gameAudio            = FindObjectOfType <GameAudio>();
     EnableObject();
 }
コード例 #2
0
 private void Awake()
 {
     _playerShipScript = _playerShip.GetComponent <PlayerShip>();
     _spawnObjects     = GetComponent <SpawnObjects>();
     _gameAudio        = GetComponent <GameAudio>();
     _uiController     = FindObjectOfType <UIController>();
 }
コード例 #3
0
 private void OnStartDialogEnd()
 {
     GameTimer.StartDecreasingTimerEvent(timeToSupportInSeconds, OnTimerEnd);
     GameAudio.StartAudiosEvent(audioClips, 0.12f, false);
     playerController.SetLockControl(false);
     isBattle = true;
 }
コード例 #4
0
ファイル: LobbyManager.cs プロジェクト: tdm1223/WildLife
        void Start()
        {
            if (s_Singleton == null)
            {
                s_Singleton = this;
            }
            else
            {
                if (s_Singleton != this)
                {
                    Destroy(gameObject);
                }
            }
            _lobbyHooks  = GetComponent <Prototype.NetworkLobby.LobbyHook>();
            currentPanel = mainMenuPanel;

            backButton.gameObject.SetActive(false);
            GetComponent <Canvas>().enabled = true;

            DontDestroyOnLoad(gameObject);

            SetServerInfo("Offline", "None");

            Audio = GetComponent <GameAudio>();
        }
コード例 #5
0
    void OnClick()
    {
        GameAudio.PlayEffect(GameAudioEffects.audio_effect_ui_button_1);
        Messenger <GameObject> .Broadcast(ButtonEvents.EVENT_BUTTON_CLICK_OBJECT, gameObject);

        //Messenger<string>.Broadcast(ButtonEvents.EVENT_BUTTON_CLICK, transform.name);
    }
コード例 #6
0
    private void Awake()
    {
        _laserTrans = _laserContainer.GetComponent <Transform>();
        _gameAudio  = FindObjectOfType <GameAudio>();

        _offset = this.transform.position - _laserTrans.position;
    }
コード例 #7
0
    public virtual void playSoundType(string type)
    {
        // play sound by world, level or character if overidden
        // TODO custom overrides

        if (playSoundTypeTimes == null)
        {
            playSoundTypeTimes = new Dictionary <string, float>();
        }

        foreach (GameDataSound sound in GetSounds(type))
        {
            float lastPlayed = 0f;

            if (playSoundTypeTimes.ContainsKey(sound.code))
            {
                lastPlayed = playSoundTypeTimes.Get(sound.code);
            }

            if (lastPlayed + sound.play_delay < Time.time)
            {
                GameAudio.PlayEffect(
                    sound.code,
                    GameProfiles.Current.GetAudioEffectsVolume() * sound.modifier,
                    sound.isPlayTypeLoop);

                playSoundTypeTimes.Set(sound.code, Time.time);
            }
        }
    }
コード例 #8
0
    private void Start()
    {
        systemStarships.InitializeStarshipsTeams(GetComponent <StarshipsSpawnMover>().MoveStarshipsOnSpawns());

        GameAudio.StartAudioEvent(audioClip, 0.4f, true);
        if (!StaticSettings.isRestart)
        {
            SetGameStop(true);
            GameDialogs.StartDialogEvent(StartGame);
        }
        else
        {
            GameGoals.SetActiveGoalEvent(true);
            StaticSettings.isRestart = false;
            systemStarships.SetStarshipsLock(false);
            systemStarships.SetStarshipsLock(1, true);
            GameDialogs.ShowInGameDialogEvent(0);
        }
        systemStarships.SetStarshipsActive(2, false);
        systemStarships.SetStarshipsLock(2, true);
        systemStarships.SetStarshipsActive(3, false);
        systemStarships.SetStarshipsLock(3, true);
        systemStarships.StarshipsTeams[1].OnTeamDevastated += FirstWaveDead;
        systemStarships.StarshipsTeams[2].OnTeamDevastated += SecondWaveDead;
    }
コード例 #9
0
ファイル: GameAudio.cs プロジェクト: sepaper/ScreamFly
 private void Awake()
 {
     if (GameAudio.instance == null)
     {
         GameAudio.instance = this;
     }
 }
コード例 #10
0
 public void QueueNotification(GameNotificationItem notification)
 {
     notificationQueue.Enqueue(notification);
     LogUtil.Log("Notification Queue(" + notificationQueue.Count + ") Notification Added :" + notification.title);
     ProcessNotifications();
     GameAudio.PlayEffect(GameAudioEffects.audio_effect_ui_button_1);
 }
コード例 #11
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            this.GetComponent <AudioSource> ().Stop();
            if (instance.GetComponent <AudioSource>().clip != this.GetComponent <AudioSource>().clip)
            {
                instance.GetComponent <AudioSource> ().clip = this.GetComponent <AudioSource> ().clip;
                instance.GetComponent <AudioSource> ().Play();
            }
//			audioS.Stop ();
//			if (instance.audioS.clip != audioS.clip) {
//				instance.audioS.clip = audioS.clip;
//				instance.audioS.Play ();
//			}
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
            instance.GetComponent <AudioSource> ().Play();
//			audioS.Play ();
        }
        DontDestroyOnLoad(this.gameObject);
    }
コード例 #12
0
    private IEnumerator Start()
    {
        systemStarships.InitializeStarshipsTeams(GetComponent <StarshipsSpawnMover>().MoveStarshipsOnSpawns());

        GameAudio.StartAudioEvent(audioClip, 0.125f, true);
        if (!StaticSettings.isRestart)
        {
            playerController.SetLockControl(true);
            playerCamera.SetLockMove(false);
            systemStarships.SetStarshipsLock(true);

            MoverStartPlayer.ToStartPosition(playerStarship);

            playerCamera.SetPositionWithOffset(PlayerStarshipTr.position);

            playerController.SetActiveCanvas(false);

            MoverStartZ2.Move(Z2Starship);

            Z5_Scene.SetActive(true);
            Z2_Scene.SetActive(true);
            Z5animator.SetFloat("Part(speed)", 1);

            yield return(MoverStartPlayer.IStarshipMove(playerStarship));


            cruiserAttack.StartAim();

            Z5Image.SetActive(true);
            Z2Image.SetActive(true);


            playerCamera.EnableTargetMove(cameraTarget);

            GameDialogs.StartDialogEvent(OnStartDialogEnd);
            GameDialogs.OnNextDialog += OnNextDialog;
        }
        else
        {
            GameGoals.SetActiveGoalEvent(true);

            StaticSettings.isRestart = false;

            systemStarships.SetStarshipsLock(false);

            MoverStartPlayer.ToEndPosition(playerStarship);
            MoverStartZ2.ToEndPosition(Z2Starship);

            Z2StarshipAI.SetTargetToFollowWithMaxDistance(PlayerStarshipTr);

            systemStarships.SetStarshipsFollowEnemy(true);

            cruiserAttack.StartAim();

            FrigateHealth.SetActive(true);

            cruiserAttack.StartAttack(OnBattleEnd);
            isBattle = true;
        }
    }
コード例 #13
0
ファイル: LobbyPlayer.cs プロジェクト: tdm1223/WildLife
        //static Color OddRowColor = new Color(250.0f / 255.0f, 250.0f / 255.0f, 250.0f / 255.0f, 1.0f);
        //static Color EvenRowColor = new Color(180.0f / 255.0f, 180.0f / 255.0f, 180.0f / 255.0f, 1.0f);


        public override void OnClientEnterLobby()
        {
            base.OnClientEnterLobby();

            if (LobbyManager.s_Singleton != null)
            {
                LobbyManager.s_Singleton.OnPlayersNumberModified(1);
            }

            LobbyPlayerList._instance.AddPlayer(this);
            LobbyPlayerList._instance.DisplayDirectServerWarning(isServer && LobbyManager.s_Singleton.matchMaker == null);

            if (isLocalPlayer)
            {
                SetupLocalPlayer();
            }
            else
            {
                SetupOtherPlayer();
            }

            //setup the player data on UI. The value are SyncVar so the player
            //will be created with the right value currently on server
            OnMyName(playerName);
            OnMyColor(playerColor);

            Audio = GetComponent <GameAudio>();
        }
コード例 #14
0
 private void Awake()
 {
     _gameController = FindObjectOfType <GameController>();
     _mesh           = GetComponent <MeshRenderer>();
     _collider       = GetComponent <Collider>();
     _gameAudio      = FindObjectOfType <GameAudio>();
 }
コード例 #15
0
    public static void PlayCustomOrDefaultEffect(string audioEffectName)
    {
        bool  hasCustomAudioItem = GameAudio.CheckIfEffectHasCustom(audioEffectName);
        float volume             = GetCurrentVolumeAdjust();

        PlayCustomOrDefaultEffect(audioEffectName, volume, hasCustomAudioItem);
    }
コード例 #16
0
ファイル: GameAudioWrap.cs プロジェクト: 737871854/S6Client
    static int PlayAudio(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(GameAudio), typeof(int)))
        {
            GameAudio obj  = LuaScriptMgr.GetNetObject <GameAudio>(L, 1);
            int       arg0 = (int)LuaScriptMgr.GetNumber(L, 2);
            obj.PlayAudio(arg0);
            return(0);
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(GameAudio), typeof(AudioName)))
        {
            GameAudio obj  = LuaScriptMgr.GetNetObject <GameAudio>(L, 1);
            AudioName arg0 = LuaScriptMgr.GetNetObject <AudioName>(L, 2);
            obj.PlayAudio(arg0);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: GameAudio.PlayAudio");
        }

        return(0);
    }
コード例 #17
0
    public void play(AudioClip clip, double tick_time, double attack_time, double release_time, int midi_note_number = 60)
    {
        float pitch = midi_note_to_pitch(midi_note_number, Midi_Note_C4);

        int cnt = 0;

        while (sfx_audio_list[next_index].state != ASREnvelope.State.Idle)
        {
            if (cnt >= sfx_index)
            {
                GameObject audio_obj  = Instantiate(Prefab_GameAudio, transform);
                GameAudio  game_audio = audio_obj.GetComponent <GameAudio>();
                audio_obj.name         = "Sfx Game Audio - Destroy";
                game_audio.mixer_group = sfx_group;
                game_audio.play(clip, pitch, tick_time, attack_time, release_time, true);
                next_index = (next_index + 1) % sfx_audio_list.Count;
                return;
            }
            cnt++;
            next_index = (next_index + 1) % sfx_audio_list.Count;
        }

        sfx_audio_list[next_index].play(clip, pitch, tick_time, attack_time, release_time);
        next_index = (next_index + 1) % sfx_audio_list.Count;
    }
コード例 #18
0
 public void NextBar()
 {
     GameAudio.StopAudioEvent();
     StaticSettings.isCompleteSomething = true;
     Settings.OnSensitivityChanged     -= OnSensitivityChanged;
     SceneController.LoadNextStoryScene();
 }
コード例 #19
0
ファイル: GameAudio.cs プロジェクト: whoadrian/GGJ20
 private void Awake()
 {
     if (Instance != null)
     {
         Destroy(gameObject);
     }
     Instance = this;
 }
コード例 #20
0
 private void Awake()
 {
     _gameController    = FindObjectOfType <GameController>();
     _asteroidExplosion = GetComponent <ParticleSystem>();
     _mesh      = GetComponent <MeshRenderer>();
     _collider  = GetComponent <Collider>();
     _gameAudio = FindObjectOfType <GameAudio>();
 }
コード例 #21
0
 public void StartBigWildSpawn()
 {
     if (GetComponent <GameAudio>() != null)
     {
         Audio = GetComponent <GameAudio>();
     }
     StartCoroutine(BigWildSpawn());
 }
コード例 #22
0
ファイル: GameAudioWrap.cs プロジェクト: 737871854/S6Client
    static int InitBetAudios(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        GameAudio obj = LuaScriptMgr.GetNetObject <GameAudio>(L, 1);

        obj.InitBetAudios();
        return(0);
    }
コード例 #23
0
    void Start()
    {
        tower     = GetComponent <Tower>();
        intialHp  = tower.Hp;
        currentHp = intialHp;
        tower.onCollisionEnemy += OnTrigger;

        gameAudio = FindObjectOfType <GameAudio>();
    }
コード例 #24
0
 private void OpenMenu()
 {
     SetTimeScale(0);
     GameAudio.PauseAudioEvent();
     isMenuOpened = true;
     mainGameMenu.SetActive(true);
     GameCursor.SetCursorLock(false, CursorLockMode.None);
     OnMenuOpen?.Invoke();
 }
コード例 #25
0
 private void Awake()
 {
     if (instance == null)
     {
         instance            = this;
         sfxAudio.loop       = false;
         playerSfxAudio.loop = false;
     }
 }
コード例 #26
0
    private IEnumerator IEndEvent()
    {
        isEnd = true;
        playerController.SetLockControl(false);
        GameAudio.StopAudioEvent();
        Z2Health.Kill();
        yield return(new WaitForSeconds(timeToEnd));

        SceneController.LoadNextStoryScene();
    }
コード例 #27
0
ファイル: GameUI.cs プロジェクト: Praeire/game-lib-games
    public void PlayGameAudio()
    {
        if (!gameLoopsStarted)
        {
            GameAudio.StartGameLoops();
        }

        //GameAudio.StopAmbience();
        //GameAudio.StartGameLoop(GameUIPanel.Instance.currentLevelNumber);
    }
コード例 #28
0
	void Awake ()
	{
		if (mInst == null)
		{
			mInst = this;
			mTrans = transform;
			DontDestroyOnLoad(gameObject);
		}
		else Destroy(gameObject);
	}
コード例 #29
0
ファイル: GameAudio.cs プロジェクト: liamzhu/Bridge
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        DontDestroyOnLoad(gameObject);

        //InitSoundVolume();
    }
コード例 #30
0
    private void Awake()
    {
        _rb           = GetComponent <Rigidbody>();
        _gameAudio    = FindObjectOfType <GameAudio>();
        _uiController = FindObjectOfType <UIController>();
        _spawnObjects = FindObjectOfType <SpawnObjects>();

        _trailLeft.enabled  = false;
        _trailRight.enabled = false;
        _currentHeath       = _maxHealth;
    }
コード例 #31
0
    public void Setup(GameManager setManager, GameAudio setGameAudio)
    {
        gameManager = setManager;

        Body playerBody = GetComponentInChildren <Body>();

        Debug.Assert(playerBody != null, "playerBody script is NULL");
        playerBody.Setup(setManager, this);

        gameAudio = setGameAudio;
    }
コード例 #32
0
ファイル: GameAudio.cs プロジェクト: jonmann20/GameJam14
 void Awake()
 {
     that = this;
 }