public void SpawnArea()
    {
        Area area = currentArea;

        RpcSpawnArea(area.starship.index);
        foreach (AreaCorridor corridor in area.corridors)
        {
            RpcSpawnCorridor(corridor.x, corridor.y, corridor.segments.Count);
            foreach (AreaSegment segment in corridor.segments)
            {
                RpcSpawnSegment(corridor.index, segment.index, segment.netId);
                for (int i = 0; i < 4; i++)
                {
                    AreaSegmentInstallation inst = segment.installations[i];
                    if (inst != null)
                    {
                        RpcSpawnInstallation(corridor.index, segment.index, i, inst.type, inst.name, inst.netId);
                    }
                    AreaSegmentWall wall = segment.walls[i];
                    if (wall != null)
                    {
                        //RpcSpawnWall(corridor.index, segment.index, i);
                    }
                }
            }
        }
    }
Ejemplo n.º 2
0
 public AreaSegment(AreaCorridor cor)
 {
     corridor = cor;
     index    = cor.segments.Count;
     for (int i = 0; i < 4; i++)
     {
         walls[i]         = new AreaSegmentWall(i, this);
         installations[i] = null;
     }
 }
Ejemplo n.º 3
0
    public void setWallSprite(GameObject obj, AreaSegmentWall wall)
    {
        switch (wall.directionId)
        {
        case 0:
            obj.transform.localScale = new Vector3(-1, 1, 1);
            obj.GetComponent <SpriteRenderer>().sprite = wallPanelsTop[wall.spriteId];
            obj.transform.Find("Foreground").gameObject.GetComponent <SpriteRenderer>().sprite = wallPanelsBottom[wall.spriteId];
            break;

        case 1:
            obj.GetComponent <SpriteRenderer>().sprite = backgroundPanels;
            break;

        case 2:
            obj.GetComponent <SpriteRenderer>().sprite = wallPanelsTop[wall.spriteId];
            obj.transform.Find("Foreground").gameObject.GetComponent <SpriteRenderer>().sprite = wallPanelsBottom[wall.spriteId];
            break;

        case 3:
            obj.GetComponent <SpriteRenderer>().sprite = foregroundPanel;
            break;
        }
    }