Exemplo n.º 1
0
 void OnDisable()
 {
     if (trigger == Trigger.OnDisable)
     {
         AudioManger.Get().PlayEffect(audioClip, volume);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 廃業描画メイン
        /// </summary>
        private void DrawClosed()
        {
            //while (_DrawDataList[0][0] != (int)CardName.DrawClosedEnd)
            for (int i = 0; i < _DrawDataList.Count; i++)
            {
                // 廃業エフェクトの生成
                CreateClosedEffect(_DrawDataList[i]);

                AudioManger.PlayAudioEffectA("collapse");

                // 建物を削除
                Destroy(_DrawDataList[i]);

                //最初の描画リストを削除
                _DrawDataList.RemoveAt(i);
            }

            //廃業描画終了が来たら描画フェーズを次の段階に進める
            if (_DrawDataList[0][0] == (int)CardName.DrawClosedEnd)
            {
                _NowDrowFaze++;
                AllSetTime = Time.time;
                //コマンドの削除
                _DrawDataList.RemoveAt(0);
            }
        }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     if (GetComponent <AudioManger>() != null)
     {
         audioManger = GetComponent <AudioManger>();
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// ランクアップ描画メイン
        /// </summary>
        private void DrawRankUp()
        {
            //while (_DrawDataList[0][0] != (int)CardName.DrawRankUpEnd)
            for (int i = 0; i < _DrawDataList.Count; i++)
            {
                // ランクアップエフェクトの生成
                CreateRankUpEffect(_DrawDataList[i]);

                AudioManger.PlayAudioEffectA("kira2");

                // ランクアップしたオブジェクト描画
                CreateRankUp(_DrawDataList[i]);

                //最初の描画リストを削除
                _DrawDataList.RemoveAt(i);
            }

            //バッティング描画終了が来たら描画フェーズを次の段階に進める
            if (_DrawDataList[0][0] == (int)CardName.DrawRankUpEnd)
            {
                _NowDrowFaze++;
                AllSetTime = Time.time;
                //コマンドの削除
                _DrawDataList.RemoveAt(0);
            }
        }
Exemplo n.º 5
0
    /// <summary>
    /// 更新倒计时窗口
    /// </summary>
    private void UpdateStartCountTime()
    {
        // 倒计时
        --startCountTime;

        if (startCountTime > 0)
        {
            // 显示
            timeLabel.text = string.Format("{0}", startCountTime);
            AudioManger.Get().PlayEffect("click");
            timeLabel.transform.parent.gameObject.SetActive(true);
        }
        else
        {
            timeLabel.transform.parent.gameObject.SetActive(false);
        }

        if (startCountTime <= 0)
        {
            // 进入游戏,先还是不改变之前的流程,全部收到包时就进入游戏页,然后让这个页盖上它,倒计时
            OnCloseClick();
        }
        else
        {
            Invoke("UpdateStartCountTime", 1.0f);
        }
    }
Exemplo n.º 6
0
 void OnClick()
 {
     if (canPlay && trigger == Trigger.OnClick)
     {
         AudioManger.Get().PlayEffect(audioClip, volume);
     }
 }
Exemplo n.º 7
0
    //FindObjectOfType<AudioManger>().Play("PlayerDamage");
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }


        DontDestroyOnLoad(gameObject);

        /* foreach(AmountSounds s in Sounds)
         * {
         *   s.source = gameObject.AddComponent<AudioSource>();
         *   s.source.clip = s.clip;
         *
         *   s.source.volume = s.volume;
         *   s.source.pitch = s.pitch;
         *   s.source.loop = s.loop;
         *
         * }*/
    }
Exemplo n.º 8
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);


        foreach (sound s in sounds)
        {
            s.source      = gameObject.AddComponent <AudioSource>();
            s.source.clip = s.clip;

            s.source.volume = s.volume;
            s.source.pitch  = s.pitch;

            s.source.loop = s.loop;
        }
    }
Exemplo n.º 9
0
 public override void OnShow()
 {
     base.OnShow();
     SetPlayerInfo();
     AudioManger.Get().PlayAudioBG("Empty");
     //string[] strName = gameObject.name.Split('(');
     //GuideManager.StartGuide(GuildCondition.GC_Ui, strName[0], gameObject);
 }
Exemplo n.º 10
0
 void Start()
 {
     anim        = GetComponent <Animator>();
     audioManger = GetComponent <AudioManger>();
     GameEvents.current.onPlayerRespawn += ResetSelf;
     GameEvents.current.onPlayerDeath   += StopShooting;
     startPos = transform.position;
 }
 public override void Update()
 {
     if (Source == null && State == eTaskState.CanStart)
     {
         Logger.Log($"AudioTriggerTask play audio: {AudioEvent}");
         Source = AudioManger.PlayEvent(AudioEvent);
     }
     base.Update();
 }
Exemplo n.º 12
0
    public void SetState(eSceneState state)
    {
        if (state == eSceneState.Completed &&
            State != eSceneState.Completed)
        {
            AudioManger.PlayEvent("SceneComplete");
        }

        State = state;
    }
Exemplo n.º 13
0
    void Awake()
    {
        if (Instance != null)
        {
            return;
        }

        Instance = this;
        LoadSounds();
    }
 private void Start()
 {
     audio          = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <AudioManger>();
     playerPosiiton = GameObject.FindGameObjectWithTag("Player");
     manager        = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();
     SetTheTImeAgain();
     stopRange     = 2f;
     startPosition = transform.position;
     Rtime         = reloadTime;
 }
Exemplo n.º 15
0
    public override void OnInspectorGUI()
    {
        var targetSound = (Sound)target;

        EditorUtility.SetDirty(targetSound);

        //play button
        GUI.backgroundColor = Application.isPlaying ? Color.green : Color.grey;

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Play Sound"))
        {
            AudioManger.PlayEvent(targetSound.Name);
        }
        EditorGUILayout.EndHorizontal();

        GUI.backgroundColor = Color.white;

        EditorGUILayout.Space(20);

        DrawDefaultInspector();

        EditorGUILayout.Space(20);

        EditorGUILayout.BeginHorizontal();
        GUILayout.Label("Add");
        var clip = (AudioClip)EditorGUILayout.ObjectField(null, typeof(AudioClip), false);

        if (clip != null)
        {
            var soundClip = new Sound.ClipAndVolume();
            soundClip.Clip = clip;
            targetSound.Clips.Add(soundClip);
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.Space(10);

        //draw clip list
        DrawClipList(targetSound);

        //update name
        if (targetSound.name != targetSound.Name)
        {
            if (string.IsNullOrEmpty(targetSound.Name))
            {
                targetSound.Name = targetSound.name;
            }
            else
            {
                string path = AssetDatabase.GetAssetPath(target);
                AssetDatabase.RenameAsset(path, targetSound.Name);
            }
        }
    }
Exemplo n.º 16
0
    public override void OnShow()
    {
        base.OnShow();
        // 隐藏所有位置节点
        for (int i = 0; i < posRoots.Length; ++i)
        {
            posRoots [i].SetActive(false);
        }

        AudioManger.Get().PlayAudioBG("Wandering");
    }
Exemplo n.º 17
0
 private void Start()
 {
     audio          = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <AudioManger>();
     manager        = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();
     isMoving       = false;
     animator       = GetComponent <Animator>();
     playerPosiiton = GameObject.FindGameObjectWithTag("Player");
     Rtime          = reloadTime;
     SetTheTImeAgain();
     rotatingTime = 0f;
 }
Exemplo n.º 18
0
    void Start()
    {
        audioManger = AudioManger.instance;

        seeker = GetComponent <Seeker>();
        rb     = GetComponent <Rigidbody2D>();

        //Initialize behaviors
        currentState = MonsterState.idle;
        state        = MonsterState.pursue_player;
    }
Exemplo n.º 19
0
    /// <summary>
    /// Call the listener function.
    /// </summary>

    protected virtual void OnClick()
    {
        if (current == null && isEnabled && UICamera.currentTouchID != -2 && UICamera.currentTouchID != -3)
        {
            current = this;
                        #if !SERVER
            //Debug.Log ("Play click");
            AudioManger.Get().PlayEffect(clickSound, clickSoundVolumn);
                        #endif
            EventDelegate.Execute(onClick);
            current = null;
        }
    }
    public override void DrawTask(Scene scene)
    {
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("AudioEvent");
        AudioEvent = EditorGUILayout.TextField(AudioEvent);
        EditorGUILayout.EndHorizontal();

        if (!AudioManger.IsPathValid(AudioEvent))
        {
            EditorGUILayout.HelpBox($"AudioEvent path: \"{AudioEvent}\" is not valid", MessageType.Error);
        }

        base.DrawTask(scene);
    }
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Exemplo n.º 22
0
    public void OnClickEnglish(GameObject go)
    {
        AudioManger.Get().PlayEffect("click_down");
        SystemLanguage curLanguage = (SystemLanguage)LocalAccountStorage.Get().localLanguage;

        if (curLanguage == SystemLanguage.English)
        {
            return;
        }

        SelectLanguage = SystemLanguage.English;
        UISystem.Get().ShowWindow("CommonDialogWindow");
        UISystem.Get().OnEventHandler((int)EventId.OnCommonDialog, "CommonDialogWindow",
                                      2, LanguageDataProvider.GetValue(208), new EventDelegate(ModifyLanguange));
    }
Exemplo n.º 23
0
        //シャッフルの描画
        void DrawActShuffle()
        {
            for (int i = 0; i < _DrawDataList.Count; i++)
            {
                ShuffleImage.GetComponent <Image>().color = new Color(1.0f, 1.0f, 1.0f, 1.0f);

                AudioManger.PlayAudioEffectA("shuffl");

                Shuffle(_DrawDataList[i]);

                StartCoroutine(ShuffleEffect());

                _DrawDataList.RemoveAt(i);
            }
        }
Exemplo n.º 24
0
    void OnPress(bool isPressed)
    {
        if (trigger == Trigger.OnPress)
        {
            if (mIsOver == isPressed)
            {
                return;
            }
            mIsOver = isPressed;
        }

        if (canPlay && ((isPressed && trigger == Trigger.OnPress) || (!isPressed && trigger == Trigger.OnRelease)))
        {
            AudioManger.Get().PlayEffect(audioClip, volume);
        }
    }
Exemplo n.º 25
0
    void OnHover(bool isOver)
    {
        if (trigger == Trigger.OnMouseOver)
        {
            if (mIsOver == isOver)
            {
                return;
            }
            mIsOver = isOver;
        }

        if (canPlay && ((isOver && trigger == Trigger.OnMouseOver) || (!isOver && trigger == Trigger.OnMouseOut)))
        {
            AudioManger.Get().PlayEffect(audioClip, volume);
        }
    }
Exemplo n.º 26
0
    void AddPlayer(int controlType)
    {
        var parent = transform;

        if (MainManager.Instance != null)
        {
            parent = MainManager.Instance.transform;
        }

        var player = Instantiate <PlayerAgent>(Player, transform);

        Players[controlType]             = player;
        Players[controlType].ControlType = controlType;

        AudioManger.PlayEvent("PlayerJoin", player.transform);
    }
Exemplo n.º 27
0
 public void OnMusicClick(GameObject go)
 {
     LocalSettingStorage.Get().music = !LocalSettingStorage.Get().music;
     SetPage();
     AudioManger.Get().PlayEffect("click_down");
     // 播放/停止背景音
     if (LocalSettingStorage.Get().music)
     {
         AudioManger.Get().MuteBGAudio(false);
         AudioManger.Get().PlayAudioBG("Empty");
     }
     else
     {
         AudioManger.Get().MuteBGAudio(true);
     }
 }
Exemplo n.º 28
0
    public void OnSoundClick(GameObject go)
    {
        LocalSettingStorage.Get().sound = !LocalSettingStorage.Get().sound;
        SetPage();

        // 播放/停止音效
        if (LocalSettingStorage.Get().sound)
        {
            AudioManger.Get().PlayEffect("click_down");
            AudioManger.Get().MuteEffectAudio(false);
        }
        else
        {
            AudioManger.Get().MuteEffectAudio(true);
        }
    }
Exemplo n.º 29
0
    public virtual void StartInteraction(PlayerAgent playerAgent)
    {
        if (CurrentUser != null)
        {
            Logger.Log($"Cannot start interaction as user({CurrentUser}) already using it");
            return;
        }

        Logger.Log($"StartInteraction user \"{playerAgent}\"");
        CurrentUser = playerAgent;
        if (Icon != null)
        {
            Icon.SetBeingUsed(true);
        }

        AudioManger.PlayEvent("Interact");
    }
Exemplo n.º 30
0
        //メテオの描画
        void DrawActMeteor()
        {
            if (SetTime[0] + WaitTime < Time.time)
            {
                switch (NowFase[0])
                {
                case (int)ActFaze.set:
                    //メテオオブジェクトの生成&範囲指定
                    MakeActMeteor(_DrawDataList[0]);
                    NowFase[0]++;
                    SetTime[0] = Time.time;
                    break;

                case (int)ActFaze.move:
                    // メテオオブジェクト移動
                    AudioManger.PlayAudioEffectA("meteo");
                    if (MoveActMeteor(_DrawDataList[0]))
                    {
                        Debug.Log("メテオの移動完了");
                        NowFase[0]++;
                        SetTime[0] = Time.time;
                    }
                    //同時にエフェクトを生成

                    break;

                case (int)ActFaze.effect:
                    Destroy(actMeteor.moveObj);
                    Destroy(actMeteor.effectObj);
                    //メテオ建物作成
                    AudioManger.PlayAudioEffectA("bom");
                    CreateMeteorBldg(_DrawDataList[0]);
                    NowFase[0]++;

                    //SetTime = Time.time;
                    break;

                case (int)ActFaze.end:
                    //データリストの中からアクションカードナンバー「メテオ」のものを削除
                    _DrawDataList.RemoveAt(0);
                    NowFase.RemoveAt(0);
                    SetTime.RemoveAt(0);
                    break;
                }
            }
        }