Exemplo n.º 1
0
        public void __Gen_Delegate_Imp12(object p0, eBubbleType p1, eTileDir p2, ref int p3)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushAny(L, p0);
            translator.Push(L, p1);
            translator.Push(L, p2);
            LuaAPI.xlua_pushinteger(L, p3);

            PCall(L, 4, 1, errFunc);

            p3 = LuaAPI.xlua_tointeger(L, errFunc + 1);


            LuaAPI.lua_settop(L, errFunc - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Exemplo n.º 2
0
    public void CheckChainBomb(eBubbleType bubbleType, eTileDir dir, ref int chainCount)
    {
        if (bubbleType == BubbleType)
        {
            chainCount++;
            MapTile tile = _targetMapTile.GetNearbMapTile(dir);
            if (tile != null && tile.TargetBubble != null)
            {
                tile.TargetBubble.CheckChainBomb(bubbleType, dir, ref chainCount);
            }
            _chainBombArry[(int)dir] = chainCount;
            _chainBombArry[((int)dir + (int)eTileDir.Bottom) % (int)(eTileDir.LeftTop + 1)] = chainCount;
        }

        //if (_chainBombArry[(int)eTileDir.LeftBottom] >= GameManager.Instance.MatchBubbleCount ||
        //   _chainBombArry[(int)eTileDir.RightBottom] >= GameManager.Instance.MatchBubbleCount ||
        //   _chainBombArry[(int)eTileDir.Bottom] >= GameManager.Instance.MatchBubbleCount)
        if (_chainBombArry[(int)eTileDir.LeftBottom] >= MatchBubbleCount ||
            _chainBombArry[(int)eTileDir.RightBottom] >= MatchBubbleCount ||
            _chainBombArry[(int)eTileDir.Bottom] >= MatchBubbleCount)
        {
            transform.localScale = new Vector3(1.2f, 1.2f, 1f);
            IsBomb = true;
        }
        else
        {
            transform.localScale = Vector3.one;
            IsBomb = false;
        }
    }
Exemplo n.º 3
0
    bool SwapBubble(BubbleScript bubble1, BubbleScript bubble2)
    {
        eBubbleType tempType = bubble1.BubbleType;

        bubble1.BubbleType = bubble2.BubbleType;
        bubble2.BubbleType = tempType;

        bool isBomb = CalcBubbleBomb(false);

        tempType           = bubble1.BubbleType;
        bubble1.BubbleType = bubble2.BubbleType;
        bubble2.BubbleType = tempType;

        return(isBomb);
    }
Exemplo n.º 4
0
        public void __Gen_Delegate_Imp6(object p0, eBubbleType p1)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            translator.PushAny(L, p0);
            translator.Push(L, p1);

            PCall(L, 2, 0, errFunc);



            LuaAPI.lua_settop(L, errFunc - 1);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Exemplo n.º 5
0
        public static void Begin(GameObject obj, Vector3 startPos, Vector3 endPos, string text, float speed = 1f, float delay = 0f, eBubbleType type = eBubbleType.Bubble, UISprite background = null)
        {
            Bubble bubble = obj.AddComponent <Bubble>();

            if (bubble != null)
            {
                bubble.StartPosition = startPos;
                bubble.EndPosition   = endPos;
                bubble.Text          = text;
                bubble.Type          = type;
                bubble.Speed         = speed;
                bubble.Delay         = delay;
                bubble.Run();

                if (background != null)
                {
                    string[] strs = text.Split('\n');
                    if (strs.Length > 0)
                    {
                        int max   = 0;
                        int count = 0;
                        for (int i = 0; i < strs.Length; i++)
                        {
                            count = strs[i].GetStringLength();
                            if (count > max)
                            {
                                max = count;
                            }
                        }
                        background.height = bubble.Height + bubble.Size;
                        background.width  = max * bubble.Size / 2 + bubble.Size;
                    }
                    else
                    {
                        background.height = bubble.Height + bubble.Size;
                        background.width  = bubble.Width + bubble.Size;
                    }
                }
            }
        }
Exemplo n.º 6
0
 public ActionBubbleData(string i_ActionData, eBubbleType i_BubbleType)
 {
     ActionData = i_ActionData;
     BubbleType = i_BubbleType;
 }
Exemplo n.º 7
0
 public ActionBubbleData()
 {
     ActionData = null;
     BubbleType = eBubbleType.Empty;
 }
Exemplo n.º 8
0
 public void GenerateBubble()
 {
     //_bubbleType = (eBubbleType)(UnityEngine.Random.Range((int)eBubbleType.None, GameManager.Instance.BubbleTypeCount))+1;
     _bubbleType = (eBubbleType)(UnityEngine.Random.Range((int)eBubbleType.None, BubbleTypeCount)) + 1;
     SetSprite();
 }