private void OnEffect(ElimlnateGrid target, TweenEffectBase <GridEffectParam> tw, GridEffectParam param) { if (GamePlayCore == default) { GamePlayCore = ElimlnateCore.Instance; } else { } if (!param.IsInited) { Vector2Int pos = target.GridPos; param.IsInited = true; ElimlnateGrid grid1 = GamePlayCore.BoardGrids.GetGridByRowColumn(pos.x, pos.y - 1); ElimlnateGrid grid2 = GamePlayCore.BoardGrids.GetGridByRowColumn(pos.x - 1, pos.y - 1); ElimlnateGrid grid3 = GamePlayCore.BoardGrids.GetGridByRowColumn(pos.x + 1, pos.y - 1); if (!grid2.IsObstacle || !grid3.IsObstacle) { } else { } } else { } }
protected virtual void OnEffect(ElimlnateGrid target, TweenEffectBase <GridEffectParam> tw, GridEffectParam param) { EffectCount++; GridCreateEffectItem item = new GridCreateEffectItem(); TweenCallback callback = GetCompolete(target); item.Play(ApplyEndPosition, ref target, ref tw, callback); }
private void OnEffect(ElimlnateGrid target, TweenEffectBase <GridEffectParam> tw, GridEffectParam param) { if (param.IsInited) { GridCreater gridsCreate = ElimlnateCore.Instance.GridCreater; AnimationCurve curve = gridsCreate.EnterEffectCurve; int gridID = target.GridID; float start = mStartPos[gridID]; float end = mEndDistance[gridID]; float time = mCurveTime[gridID]; float curveValue = curve.Evaluate(time / param.DuringTime); Vector3 pos = target.GridTrans.position; bool isFinished = curveValue >= 1f; if (isFinished) { mStartPos.Remove(gridID); mEndDistance.Remove(gridID); mCurveTime.Remove(gridID); pos.Set(pos.x, end, pos.z); } else { pos.Set(pos.x, end * curveValue, pos.z); time += Time.deltaTime; mCurveTime[gridID] = time; } target.GridTrans.position = pos; if (isFinished) { OnEffectCompleted(); } else { } } else { EffectCount++; tw.ResetTweenRefs(); float start = target.GridTrans.position.y; float endValue = start + EndValueOffset; mStartPos[target.GridID] = start; mEndDistance[target.GridID] = endValue; mCurveTime[target.GridID] = 0f; } }
private void TweenFinished() { mTw.TweenRef = default; mTw = default; CompleteCallback?.Invoke(); CompleteCallback = default; Target.GridTrans.localScale = Vector3.one; Target = default; }
protected virtual void OnEffect(ElimlnateGrid target, TweenEffectBase <GridEffectParam> tw, GridEffectParam param) { tw.ResetTweenRefs(); Sequence seq = DOTween.Sequence(); seq.Append(target.GridTrans.DOScale(mScale_1, 0.1f)); seq.Append(target.GridTrans.DOScale(mScale_2, 0.1f)); tw.TweenRef = new Tween[] { seq }; }
private void OnEffect(ElimlnateGrid target, TweenEffectBase <ElimlnateEffectParam> tw, ElimlnateEffectParam param) { Sequence queue = DOTween.Sequence(); #if APPLY_GRID_RANK float interval = 0.1f; queue.AppendInterval(interval * param.Index); #endif #if DO_PUNCH_ROT float z = Utils.RangeRandom(45f, 90f); Vector3 punch = new Vector3(0f, 0f, z); queue.Append(target.GridTrans.DOPunchRotation(punch, 0.4f, 15)); //摇晃 queue.AppendInterval(0.05f * param.Index); //摇晃后间隔时间 #endif queue.Append(target.GridTrans.DOScale(Vector3.one * 1.2f, 0.18f)); //1.5f, 0.25f queue.Append(target.GridTrans.DOScale(Vector3.zero, 0.1f)); //zero, 0.15f BeforeFinish(ref queue, ref target, ref param); #if DIRECT_FINISH queue.AppendCallback(Finish); //直接结束 #else queue.Join(target.GridSprite.DOFade(0f, 0.1f)) //褪为透明 .OnComplete(Finish); #endif void Finish() { if (UpperStrata.HasFollowUpEffect) { UpperStrata.CheckFollowEffect(); } else { UpperStrata.AfterGridEffectFinished?.Invoke(); target.WillDestroy(); queue.Kill(); } } OnPlaySound?.Invoke(); }
private void OnEffect(ElimlnateGrid target, TweenEffectBase <GridEffectParam> info, GridEffectParam param) { if (mRangeSigns.ContainsKey(target)) { Transform trans = mRangeSigns[target].transform; ApplyPriviewSign(ref trans, ref target, ref param); } else { ShipDockApp.Instance.Effects.CreateEffect(RangeSignResPoolName, out GameObject effect); CreatePreviewSign(ref target, ref effect, ref param); if (effect != default) { mRangeSigns[target] = effect; } else { } } }
public void Play(bool applyMoveToEndPos, ref ElimlnateGrid target, ref TweenEffectBase <GridEffectParam> tw, TweenCallback completed) { Target = target; if (completed != default) { AddCompleteCallback(completed);//外部的完成回调 } else { } mTw = tw; GridEffectParam param = mTw.Param; float duringTime = param.DuringTime; AnimationCurve curve = param.Curve; EndPosition = param.EndPosition; Tween punch = Target.GridTrans.DOPunchScale(new Vector3(0.15f, -0.1f, 0f), 1f, 7, 1) .SetEase(Ease.InCubic); if (applyMoveToEndPos) { Sequence seq = DOTween.Sequence(); Tween move = DOTween.To(GetValue, SetValue, EndPosition, duringTime) .SetEase(curve); seq.Append(move); seq.Append(punch); seq.OnKill(TweenFinished); mTw.TweenRef = new Tween[] { punch, seq }; } else { punch.OnKill(TweenFinished); mTw.TweenRef = new Tween[] { punch }; } }
private void OnEffect(ElimlnateGrid target, TweenEffectBase <ElimlnateEffectParam> tw, GridEffectParam param) { //target.StopEffect(GameEffects.EffectChoosen);//, "Glow"); Transform tf = target.GridTrans; ElimlnateEffectParam effectParam = param as ElimlnateEffectParam; //Vector3 end = GetdAttrackOutTween(ref tf, effectParam, out Vector3 center); Tween attracktOut = AttrackOutTween(ref tf, effectParam, out Vector3 center) .SetEase(Ease.OutSine); Sequence queue = DOTween.Sequence(); queue.AppendInterval(0.2f * effectParam.Index); queue.Append(attracktOut); queue.Append( tf.DOMove(center, 0.4f) .SetEase(Ease.InSine)) .OnComplete(() => { target.WillDestroy(); UpperStrata.AfterGridEffectFinished?.Invoke(); queue.Kill(); }); }