Ejemplo n.º 1
0
        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 };
            }
        }
Ejemplo n.º 2
0
        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
            {
            }
        }
Ejemplo n.º 3
0
        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;
            }
        }
Ejemplo n.º 4
0
        protected virtual void CreatePreviewSign(ref ElimlnateGrid target, ref GameObject effect, ref GridEffectParam param)
        {
            if (effect == default)
            {
                return;
            }
            else
            {
            }

            Transform trans = effect.transform;

            target.AlignmentInGrid(trans, true, false);
            trans.localPosition += new Vector3(-0.1f, -0.09f, 0f);

            if (param.IsInited)
            {
                param.IsInited = false;
                trans.SetParent(default);
Ejemplo n.º 5
0
        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
                {
                }
            }
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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 };
        }
Ejemplo n.º 8
0
        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();
            });
        }