public void AbilityTest01()
        {
            var serializer = new PineappleSerializer();
            var slap       = new Slap();

            var data      = serializer.Serialize(slap);
            var slapClone = (Slap)serializer.Deserialize(data);

            Assert.Equal(slap.Damage, slapClone.Damage);
            Assert.Equal(slap.AbilityEffects.Count, slapClone.AbilityEffects.Count);
        }
Example #2
0
        protected void FirstFinger(GameFrameworkAction firstEvent)
        {
            m_Finger.gameObject.SetActive(true);
            Vector3 pos = m_Finger.localPosition + Vector3.down * 20;

            m_Finger.localPosition = pos;
            //Finger.DOLocalMoveY(pos.y + 20, 0.5f).SetLoops(3, LoopType.Yoyo);
            Sequence sequence = DOTween.Sequence();

            for (int i = 0; i < 3; i++)
            {
                Tween move_up   = m_Finger.DOLocalMoveY(pos.y + 20, 0.5f);
                Tween move_down = m_Finger.DOLocalMoveY(pos.y - 20, 0.5f);
                sequence.Append(move_up);
                sequence.Append(move_down);
            }
            Tween move = m_Finger.DOLocalMoveY(pos.y + 20, 0.5f).OnComplete(() =>
            {
                m_Finger.gameObject.SetActive(false);
                Slap.gameObject.SetActive(true);
                Slap.Rewind(() =>
                {
                    Slap.Rewind(() =>
                    {
                        Slap.Rewind(() =>
                        {
                            Slap.Stop();
                            Slap.gameObject.SetActive(false);
                            if (firstEvent != null)
                            {
                                firstEvent();
                            }
                        });
                    });
                });
            });

            sequence.Append(move);
        }