Exemplo n.º 1
0
    private void CacheSphericalProxyInfo(BoardSlot slot, BoardSlotSphericalProxy slotproxy)
    {
        int VisualX;
        int VisualY;
        int VisualZ;

        GetVisualPositionsForBoardSlot(slot, out VisualX, out VisualY, out VisualZ);
        float AzimuthToCenterDeg;
        float SlotAzimuthBreadthDeg;
        float ElevationToCenterDeg;
        float SlotElevationBreadthDeg;
        float SlotCenterRadius;

        GetSlotSphericalInfo(VisualX, VisualY, VisualZ, out AzimuthToCenterDeg, out SlotAzimuthBreadthDeg, out ElevationToCenterDeg, out SlotElevationBreadthDeg, out SlotCenterRadius);
        slotproxy.SetSphericalPositions(AzimuthToCenterDeg, SlotAzimuthBreadthDeg, ElevationToCenterDeg, SlotElevationBreadthDeg);
    }
Exemplo n.º 2
0
    private void AddShapeToAllSlots()
    {
        if (board == null || (UnityEngine.Object)ShapeSpawner == (UnityEngine.Object)null)
        {
            return;
        }
        BoardSlot[, ,] boardSlotArray = board.TheGameBoard;
        int length1 = boardSlotArray.GetLength(0);
        int length2 = boardSlotArray.GetLength(1);
        int length3 = boardSlotArray.GetLength(2);

        for (int index1 = 0; index1 < length1; ++index1)
        {
            for (int index2 = 0; index2 < length2; ++index2)
            {
                for (int index3 = 0; index3 < length3; ++index3)
                {
                    BoardSlot  boardSlot = boardSlotArray[index1, index2, index3];
                    Vector3    zero      = Vector3.zero;
                    Quaternion identity  = Quaternion.identity;
                    GetLayoutStuff(boardSlot, ref zero, ref identity);

                    // Add object
                    GameObject gameObject = UnityEngine.Object.Instantiate((UnityEngine.Object)ShapeSpawner, zero, identity) as GameObject;
                    BoardSlotToVisualMap.Add(boardSlot, gameObject);
                    BoardSlotSphericalProxy slotproxy = gameObject.GetComponent <BoardSlotSphericalProxy>();
                    if ((UnityEngine.Object)slotproxy == (UnityEngine.Object)null)
                    {
                        slotproxy = gameObject.AddComponent <BoardSlotSphericalProxy>();
                        slotproxy.SetSlot(boardSlot);
                    }
                    BoardSlotToProxyMap.Add(boardSlot, slotproxy);
                    CacheSphericalProxyInfo(boardSlot, slotproxy);
                }
            }
        }
    }