public override void OnCollisionEnter(Collision col) { if (col.gameObject.name.Contains("Rail")) { //we hit the wall. HOAudioManager.BallhitRail(m_rigidbody.velocity); if (!hitWall) { GameManager.Rules.BallHitRail(); hitWall = true; } } if (col.gameObject.CompareTag("Ball")) { PoolBall ball = col.transform.GetComponent <PoolBall>(); if (ball.ballType != BallType.WHITE && BallState == State.ROLL) { m_AbsorbList.Add(ball); //ball.Hide(); TemporarySlot.Add(ball); } else { HOAudioManager.BallhitBall(m_rigidbody.velocity); } } }
void Update() { if (m_Value == value) { return; } if (m_Value < value) { m_Value += Time.deltaTime * m_RollSpeed; HOAudioManager.PlayLoopClip("Scoreup"); if (m_Value > value) { m_Value = value; HOAudioManager.StopLoopClip(); } } else if (m_Value > value) { m_Value -= Time.deltaTime * m_RollSpeed; HOAudioManager.PlayLoopClip("Scoreup"); if (m_Value < value) { m_Value = value; HOAudioManager.StopLoopClip(); } } Pattern(); }
public override void OnCollisionEnter(Collision col) { if (GameManager.Rules.State == GlobalState.DRAG_WHITEBALL) { return; } if (col.gameObject.name.Contains("Rail")) { HOAudioManager.BallhitRail(m_rigidbody.velocity); GameManager.Rules.CueBallHitRail(); GameManager.Rules.BallHitRail(); GameStatistics.MarkCueballHitRail(1); } if (col.transform.CompareTag("Ball")) { HOAudioManager.BallhitBall(m_rigidbody.velocity); GameStatistics.MarkCueballHitBall(1); PoolBall ball = col.gameObject.GetComponent <PoolBall>(); GameManager.Rules.WhiteBallHitBall(ball); if (ball && ball == m_targetBall) { m_targetBall.PointAtTarget(m_targetPos); m_targetBall = null; } } }
private void Boom() { HOAudioManager.Explosion(); m_BombGO = Instantiate(m_BombEffect, transform.position, Quaternion.identity) as GameObject; Invoke("GameOverWithBoom", m_TimeToGameOver); gameObject.SetActive(false); }
void Start() { #if UNITY_ANDROID && !UNITY_EDITOR StartCoroutine(LoadPoolAsset(OnPoolAssetLoadedAtAndroidPlatform)); #endif HOAudioManager.PlayBGM(m_bgmName); }
public override void OnCollisionEnter(Collision col) { if (col.gameObject.name.Contains("Rail")) { //we hit the wall. //BaseGameManager.ballHitWall(rigidbody.velocity); HOAudioManager.BallhitRail(m_rigidbody.velocity); if (!hitWall) { GameManager.Rules.BallHitRail(); hitWall = true; } } if (col.gameObject.CompareTag("Ball")) { PoolBall ball = col.transform.GetComponent <PoolBall>(); if (ball.ballType != BallType.WHITE && BallState == State.ROLL) { Instantiate(m_BreakEffect, transform.position, Quaternion.identity); if (SingularityBreakBall != null) { SingularityBreakBall(ball); } HOAudioManager.Break(); } else { HOAudioManager.BallhitBall(m_rigidbody.velocity); } } }
void OnApplicationQuit() { m_ClipsPool.Clear(); m_Instance = null; m_ClipCache = null; m_BGMPlayer.DestroySelf(); }
public void SetValue(float fillAmount) { m_Image.fillAmount = fillAmount; if (m_Image.fillAmount < .25f) { m_Twinkle.enabled = true; } if (m_Image.fillAmount <= 0) { enabled = false; } else { enabled = true; } if (m_Twinkle.enabled) { HOAudioManager.PlayLoopClip("Clock"); } if (!enabled || !m_Twinkle.enabled) { HOAudioManager.StopLoopClip(); } }
void OnDestroy() { PoolRulesBase.onFireBall -= OnFireBall; PoolRulesBase.onNewTurn -= OnStartRound; m_Instance = null; GameStatistics.Serialize(); HOAudioManager.StopLoopClip(); }
public virtual void Begin() { if (!m_Outline.enabled) { HOAudioManager.PlayClip("Ready", 1); } //m_Outline.enabled = true; }
public void LoadScene(int sceneIndex) { //animation tools component attached at blackmask has a method named loadscene. we use this m_RiseMask.gameObject.SetActive(true); HOAudioManager.StopBGM(); m_RiseMask.GetComponent <AnimationTools>().sceneIndex = 1; //Application.LoadLevel(sceneIndex); }
void Awake() { if (m_BGMKey == default(int)) { HOAudioManager.StopBGM(true); } else { HOAudioManager.PlayBGM(m_BGMKey, true); } }
public void fireBall(float powerScalar, Vector3 fireDir, Vector3 hitPoint) { HOAudioManager.FireBall(); GameManager.Rules.OnBallFired(); m_slowTime = 0; Vector3 fireForce = fireDir * powerScalar * ConstantData.GetPoolDatas().MaxImpulse; m_rigidbody.AddForceAtPosition(fireForce, hitPoint, ForceMode.Impulse); m_state = State.ROLL; OpenDrag(); }
private void SetSound() { if (ConstantData.Sound) { m_SoundText.text = string.Format(HOLocalizationConfiguration.GetValue(161), HOLocalizationConfiguration.GetValue(421)); } else { m_SoundText.text = string.Format(HOLocalizationConfiguration.GetValue(161), HOLocalizationConfiguration.GetValue(422)); } HOAudioManager.SetSound(ConstantData.Sound); }
private void SetMusic() { if (ConstantData.Music) { m_MusicText.text = string.Format(HOLocalizationConfiguration.GetValue(160), HOLocalizationConfiguration.GetValue(421)); } else { m_MusicText.text = string.Format(HOLocalizationConfiguration.GetValue(160), HOLocalizationConfiguration.GetValue(422)); } HOAudioManager.SetMusic(ConstantData.Music); }
public void OnCollisionEnter(Collision collision) { if (collision.transform.CompareTag("Ball")) { if (!pocketTriggerBallList.Contains(collision.collider.GetInstanceID())) { HOAudioManager.PottedBall(); collision.transform.GetComponent <PoolBall>().CloseRenderer(); pocketTriggerBallList.Add(collision.collider.GetInstanceID()); } } }
public virtual void OnCollisionEnter(Collision col) { if (col.gameObject.name.Contains("Rail")) { //we hit the wall. HOAudioManager.BallhitRail(m_rigidbody.velocity); if (!hitWall) { GameManager.Rules.BallHitRail(); hitWall = true; } } if (col.gameObject.CompareTag("Ball")) { HOAudioManager.BallhitBall(m_rigidbody.velocity); } }
void Awake() { if (m_Instance == null) { m_Instance = this; DontDestroyOnLoad(gameObject); //Get music toggle if (!PlayerPrefs.HasKey(ConstantData.MusicVolumnKey)) { ConstantData.Music = true; } else { ConstantData.Music = PlayerPrefs.GetInt(ConstantData.MusicVolumnKey) == 1; } //Get sound toggggggggggggggggggggggggle if (!PlayerPrefs.HasKey(ConstantData.SoundVolumnKey)) { ConstantData.Sound = false; } else { ConstantData.Sound = PlayerPrefs.GetInt(ConstantData.SoundVolumnKey) == 1; } m_OneShotSource = GetComponent <AudioSource>(); m_LoopSource = SupportTools.AddChild <AudioSource>(gameObject); m_LoopSource.loop = true; m_LoopSource.playOnAwake = false; m_LoopSource.name = "Loop source"; m_ClipsPool = new System.Collections.Generic.Dictionary <string, AudioClip>(m_ClipsPoolCount); m_BGMPlayer = new BGMPlayer(gameObject); } else { Destroy(gameObject); } }
void OnFireBall() { m_Twinkle.enabled = false; HOAudioManager.StopLoopClip(); }
public void StopLoopClip() { HOAudioManager.StopLoopClip(); }
public void PlayLoopI(int key) { HOAudioManager.PlayLoopClip(key); }
public void PlayLoopS(string key) { HOAudioManager.PlayLoopClip(key); }
public void PlayI(int key) { HOAudioManager.PlayClip(key); }
public void PlayS(string key) { HOAudioManager.PlayClip(key, 1); }
void Awake() { if (m_Instance == null) { m_Instance = this; DontDestroyOnLoad(gameObject); //Get music toggle if (!PlayerPrefs.HasKey(ConstantData.MusicVolumnKey)) ConstantData.Music = true; else ConstantData.Music = PlayerPrefs.GetInt(ConstantData.MusicVolumnKey) == 1; //Get sound toggggggggggggggggggggggggle if (!PlayerPrefs.HasKey(ConstantData.SoundVolumnKey)) ConstantData.Sound = false; else ConstantData.Sound = PlayerPrefs.GetInt(ConstantData.SoundVolumnKey) == 1; m_OneShotSource = GetComponent<AudioSource>(); m_LoopSource = SupportTools.AddChild<AudioSource>(gameObject); m_LoopSource.loop = true; m_LoopSource.playOnAwake = false; m_LoopSource.name = "Loop source"; m_ClipsPool = new System.Collections.Generic.Dictionary<string, AudioClip>(m_ClipsPoolCount); m_BGMPlayer = new BGMPlayer(gameObject); } else { Destroy(gameObject); } }
public void OnPointerClick(PointerEventData eventData) { //GetComponent<AudioSource>().PlayOneShot(); HOAudioManager.PlayClip(m_AudioClip); }
void OnDestroy() { m_Instance = null; GameStatistics.Serialize(); HOAudioManager.StopLoopClip(); }