Esempio n. 1
0
        // 反射一个球
        void OnFire()
        {
            SCSound.monkey_fashe();
            GameBulletinBoard.FireBallManager.OnFire(newBallType, transform.right);

            fireBall.gameObject.SetActive(false);
            ScheduleOnce.CreateActive(this, 0.1f, RefreshNewBall);
        }
Esempio n. 2
0
        void CheckGameFailurePoint()
        {
            int count = mSnakeSegment.Count;

            if (count == 0)
            {
                return;
            }

            Ball ptr = mSnakeSegment[count - 1];

            if (ptr.Tail.IsArriveFailurePoint())
            {
                SCSound.monkey_shibai();

                mAttackSpeed = 20;
                mAttackState = -1;
                ScheduleOnce.CreateActive(this, 2, () => {
                    mAttackSpeed = 2;
                    mAttackState = 1;
                });
            }
        }
Esempio n. 3
0
        // Use this for initialization
        IEnumerator Start()
        {
            // 初始背景音效
            PlayBakcgroundMusic();

            // 初始对象池
            InitObjectPool();

            // 测试mapconfig是否有数据
            if (Debug.isDebugBuild)
            {
                Debug.Log(mMapConfig.MapInfo.Length);
            }

            yield return(new WaitForSeconds(0.2f));

            mgameState = GameState.runningTime;

            SCSound.monkey_yundong();
            mAttackSpeed = 20;
            yield return(new WaitForSeconds(1));

            mAttackSpeed = 2;
        }
Esempio n. 4
0
 void Awake()
 {
     _single = this;
     InitScriptData();
 }
Esempio n. 5
0
        void CheckEliminate()
        {
            bool misEliminate = false;

            int i = EliminateQueue.Count;

            while (i-- > 0)
            {
                Ball ball = EliminateQueue[i];
                Ball _pre, _next;
                if (ball.TheSameColorQueue(out _pre, out _next) >= 3)
                {
                    misEliminate       = true;
                    _next.IsNextDelete = true;
                    do
                    {
                        _pre.IsNextDelete = true;
                        _pre = _pre.Next;
                    } while (_pre != _next);

                    SCSound.monkey_xiaochu1();
                }
                else
                {
                    SCSound.monkey_qiu();
                }
            }
            EliminateQueue.Clear();

            if (!misEliminate)
            {
                return;
            }

            int x = mSnakeSegment.Count;

            while (x-- > 0)
            {
                Ball pointer       = mSnakeSegment[x];
                Ball head          = pointer.Head;
                Ball tail          = pointer.Tail;
                bool isExistDelete = false;
                do
                {
                    if (pointer.IsNextDelete)
                    {
                        isExistDelete = true;
                        if (pointer.Pre != null)
                        {
                            pointer.Pre.SetNext(null);
                        }
                        if (pointer.Next != null)
                        {
                            pointer.Next.SetPre(null);
                        }
                        if (pointer == head)
                        {
                            head = null;
                        }
                        if (pointer == tail)
                        {
                            tail = null;
                        }

                        GameBulletinBoard.Fx.PlayEffectAtPoint(pointer.getPosition());
                        pointer.OnDestroy();
                    }
                    pointer = pointer.Next;
                } while (pointer != null);

                if (!isExistDelete)
                {
                    continue;
                }

                // 回退球
                Ball _backforward = null;
                if (head != null)
                {
                    _backforward = head.Tail;
                }
                else if (x > 0)
                {
                    _backforward = mSnakeSegment[x - 1].Tail;
                }

                if (_backforward != null)
                {
                    Ball _p = null;
                    if (tail != null)
                    {
                        _p = tail.Head;
                    }
                    else if (x + 1 <= mSnakeSegment.Count - 1)
                    {
                        _p = mSnakeSegment[x + 1];
                    }

                    if (_p != null && _backforward.Type == _p.Type)
                    {
                        _p.BallTowards = _backforward;
                        FallbackQueue.Add(_p);
                    }
                }

                // 队伍分裂
                if (head != null)
                {
                    mSnakeSegment[x] = head;
                    if (tail != null && head != tail.Head)
                    {
                        mSnakeSegment.Insert(x + 1, tail.Head);
                    }
                    else
                    {
                    }
                }
                else
                {
                    if (tail != null)
                    {
                        tail             = tail.Head;
                        mSnakeSegment[x] = tail;
                    }
                    else
                    {
                        mSnakeSegment.RemoveAt(x);
                    }
                }
            }
        }