public void Show() { if (currentState == State.Show) { return; } currentState = State.Show; myCanvasGroup.alpha = 0f; transform.localScale = Vector3.one * 0.5f; MySimplePoolObjectController _effect = LeanPool.Spawn(particleEffPrefab, Vector3.zero, Quaternion.identity).GetComponent <MySimplePoolObjectController>(); Uno_GamePlay_Manager.instance.UIManager.effectPoolManager.AddObject(_effect); _effect.transform.position = transform.position; if (Uno_GamePlay_Manager.instance.CanPlayMusicAndSfx()) { MyAudioManager.instance.PlaySfx(Uno_GamePlay_Manager.instance.myAudioInfo.sfx_CallUno); } LeanTween.alphaCanvas(myCanvasGroup, 1f, timeShowEffect).setOnComplete(() => { LeanTween.alphaCanvas(myCanvasGroup, 0.8f, 0.5f).setLoopPingPong(-1); }); LeanTween.scale(gameObject, Vector3.one * 1f, timeShowEffect).setEase(LeanTweenType.easeOutBack).setOnComplete(() => { LeanTween.scale(gameObject, Vector3.one * 0.8f, 0.5f).setEase(LeanTweenType.easeInOutSine).setLoopPingPong(-1); }); }
IEnumerator DoActionShowEffAtkUno(Uno_PlayerGroup _playerAtk, Uno_PlayerGroup _playerBeAttacked) { Uno_EffectAttackUno_Sword_Controller _effectSword = LeanPool.Spawn(effAtkUnoSwordPrefab, Vector3.zero, Quaternion.identity).GetComponent <Uno_EffectAttackUno_Sword_Controller>(); effectPoolManager.AddObject(_effectSword); _effectSword.transform.position = _playerAtk.panelPlayerInfo.transform.position; if (Uno_GamePlay_Manager.instance.CanPlayMusicAndSfx()) { MyAudioManager.instance.PlaySfx(Uno_GamePlay_Manager.instance.myAudioInfo.sfx_AtkUno_Charge); } yield return(_effectSword.SetUpMove(_playerBeAttacked.panelPlayerInfo.transform.position)); if (Uno_GamePlay_Manager.instance.CanPlayMusicAndSfx()) { MyAudioManager.instance.PlaySfx(Uno_GamePlay_Manager.instance.myAudioInfo.sfx_AtkUno_Hit); } MySimplePoolObjectController _effectHit = LeanPool.Spawn(effAtkUnoHitPrefab, Vector3.zero, Quaternion.identity).GetComponent <MySimplePoolObjectController>(); effectPoolManager.AddObject(_effectHit); _effectHit.transform.position = _playerBeAttacked.panelPlayerInfo.transform.position; _playerBeAttacked.panelPlayerInfo.myShakeController.SetUpShakeLocalPoint(0.3f, 10f); yield return(Yielders.Get(0.5f)); }
public void DestroyPopUpChat(MySimplePoolObjectController _popUpChat) { if (currentPopupChat != _popUpChat) { #if TEST Debug.LogError("BUG Logic"); #endif } if (currentPopupChat != null) { currentPopupChat.onSelfDestruction -= DestroyPopUpChat; currentPopupChat.SelfDestruction(); } currentPopupChat = null; }
public void AddObject(MySimplePoolObjectController _newObject) { listObjects.Add(_newObject); _newObject.onSelfDestruction = (_o) => { listObjects.Remove(_o); }; if (maxLength != -1) { if (listObjects.Count > maxLength) { listObjects[0].onSelfDestruction = null; listObjects[0].SelfDestruction(); listObjects.RemoveAt(0); } } }
public void DestroyPopUpChat(MySimplePoolObjectController _popUpChat) { if (currentPopupChatTop == _popUpChat) { #if TEST Debug.LogError("popup Top"); #endif if (currentPopupChatTop != null) { currentPopupChatTop.onSelfDestruction -= DestroyPopUpChat; currentPopupChatTop.SelfDestruction(); } currentPopupChatTop = null; } else if (currentPopupChatLeft == _popUpChat) { #if TEST Debug.LogError("popup Left"); #endif if (currentPopupChatLeft != null) { currentPopupChatLeft.onSelfDestruction -= DestroyPopUpChat; currentPopupChatLeft.SelfDestruction(); } currentPopupChatLeft = null; } else if (currentPopupChatRight == _popUpChat) { #if TEST Debug.LogError("popup Right"); #endif if (currentPopupChatRight != null) { currentPopupChatRight.onSelfDestruction -= DestroyPopUpChat; currentPopupChatRight.SelfDestruction(); } currentPopupChatRight = null; } }