コード例 #1
0
    public bool GetNeighBorsOfvalue(BubbleValue value, ref List <BubbleScript> BubbleList)
    {
        bool NeighborAdded = false;

        if (NE != null && !BubbleList.Contains(NE))
        {
            if (NE.ThisValue == value)
            {
                BubbleList.Add(NE);
                NeighborAdded = true;
            }
        }

        if (NW != null && !BubbleList.Contains(NW))
        {
            if (NW.ThisValue == value)
            {
                BubbleList.Add(NW);
                NeighborAdded = true;
            }
        }

        if (W != null && !BubbleList.Contains(W))
        {
            if (W.ThisValue == value)
            {
                BubbleList.Add(W);
                NeighborAdded = true;
            }
        }

        if (E != null && !BubbleList.Contains(E))
        {
            if (E.ThisValue == value)
            {
                BubbleList.Add(E);
                NeighborAdded = true;
            }
        }

        if (SW != null && !BubbleList.Contains(SW))
        {
            if (SW.ThisValue == value)
            {
                BubbleList.Add(SW);
                NeighborAdded = true;
            }
        }

        if (SE != null && !BubbleList.Contains(SE))
        {
            if (SE.ThisValue == value)
            {
                BubbleList.Add(SE);
                NeighborAdded = true;
            }
        }

        return(NeighborAdded);
    }
コード例 #2
0
    public BubbleValue SetValue(BubbleValue value)
    {
        ThisValue = value;
        SetBubbleLooks();

        return(ThisValue);
    }
コード例 #3
0
    public BubbleValue SetRandomValue(BubbleValue min, BubbleValue max)
    {
        int a = ((int)min < (int)max) ? (int)min : (int)max;
        int b = ((int)min < (int)max) ? (int)max : (int)min;

        ThisValue = (BubbleValue)Random.Range(a, b + 1);

        SetBubbleLooks();

        return(ThisValue);
    }
コード例 #4
0
    public void SetBubblePosition(int i, int j)
    {
        _bubbleValue = GetComponent <BubbleValue>();

        _bubbleArrayI = i;
        _bubbleArrayJ = j;

        ArrayData.Array[i, j] = _bubbleValue.GetBubbleValue();

        //ゲームオブジェクト配列に格納
        ArrayData.GameObjectsArray[i, j] = gameObject;

        ArrayData.InstalledBubble[0] = i;
        ArrayData.InstalledBubble[1] = j;
    }