Exemple #1
0
    void ShowFurnitureSpriteAtTile(string furnitureType, Tile t)
    {
        GameObject go = new GameObject();

        go.transform.SetParent(this.transform, true);
        dragPreviewGameObjects.Add(go);


        SpriteRenderer sr = go.AddComponent <SpriteRenderer>();

        sr.sortingLayerName = "Jobs";
        sr.sprite           = fsc.GetSpriteForFurniture(furnitureType);

        if (WorldController.Instance.world.IsFurniturePlacementValid(furnitureType, t))
        {
            sr.color = new Color(0.5f, 1f, 0.5f, 0.25f);
        }
        else
        {
            sr.color = new Color(1f, 0.5f, 0.5f, 0.25f);
        }

        Furniture proto = World.current.furniturePrototypes[furnitureType];

        go.transform.position = new Vector3(t.X + ((proto.Width - 1) / 2f), t.Y + ((proto.Height - 1) / 2f), 0);
    }
    void OnJobCreated(Job job)
    {
        //FIXME we can only do furniture building jobs

        //TODO sprite
        GameObject job_go = new GameObject();

        jobGameObjectMap.Add(job, job_go);

        // Create new gameobject for a tile
        job_go.name = "JOB_" + job.jobObjectType + "_" + job.tile.X + "_" + job.tile.Y;
        job_go.transform.position = new Vector3(job.tile.X, job.tile.Y, 0);
        job_go.transform.SetParent(this.transform, true);

        // Update visuals
        SpriteRenderer job_sr = job_go.AddComponent <SpriteRenderer> ();

        job_sr.sortingLayerName = "Jobs";
        job_sr.sprite           = fsc.GetSpriteForFurniture(job.jobObjectType);
        job_sr.color            = new Color(0.5f, 1f, 0.5f, 0.3f);


        job.RegisterJobCompleteCallback(OnJobEnded);
        job.RegisterJobCancelCallback(OnJobEnded);
    }
    void OnJobCreated(Job job)
    {
        //FIXME wecan only do furniture building jobs !!
        //TODO sprite

        GameObject job_go = new GameObject();

        if (jobGameObjectMap.ContainsKey(job))
        {
            Debug.LogError("OnJobCreated for a jobGO that already exist -- most likely a job being re queued, as opposed to created");
            return;
        }

        //Add our tile/go pair to the dictionary
        jobGameObjectMap.Add(job, job_go);

        job_go.name = "JOB_" + job.jobObjectType + "_" + job.tile.X + "_" + job.tile.Y;
        job_go.transform.position = new Vector3(job.tile.X, job.tile.Y, 0);
        job_go.transform.SetParent(this.transform, true);

        SpriteRenderer sr = job_go.AddComponent <SpriteRenderer> ();

        sr.sprite           = fsc.GetSpriteForFurniture(job.jobObjectType);
        sr.color            = new Color(0.5f, 1f, 0.5f, 0.5f);
        sr.sortingLayerName = "Jobs";

        job.RegisterJobCompleteCallback(OnJobEnded);
        job.RegisterJobCancelCallback(OnJobEnded);
    }
Exemple #4
0
    void OnJobCreated(Job Job)
    {
        // FIXME: We can only do furniture-building jobs.

        // TODO: Sprite


        if (jobGameObjectMap.ContainsKey(Job))
        {
            //Debug.LogError("OnJobCreated for a jobGO that already exists -- most likely a job being RE-QUEUED, as opposed to created.");
            return;
        }

        GameObject JobGo = new GameObject();

        // Add our tile/GO pair to the dictionary.
        jobGameObjectMap.Add(Job, JobGo);

        JobGo.name = "JOB_" + Job.JobObjectType + "_" + Job.Tile.X + "_" + Job.Tile.Y;
        JobGo.transform.position = new Vector3(Job.Tile.X, Job.Tile.Y, 0);
        JobGo.transform.SetParent(this.transform, true);

        SpriteRenderer SR = JobGo.AddComponent <SpriteRenderer>();

        SR.sprite           = fsc.GetSpriteForFurniture(Job.JobObjectType);
        SR.color            = new Color(0.5f, 1f, 0.5f, 0.25f);
        SR.sortingLayerName = "Jobs";

        Job.RegisterJobCompleteCallback(OnJobEnded);
        Job.RegisterJobCancelCallback(OnJobEnded);
    }
Exemple #5
0
    void OnJobCreated(Job job)
    {
        if (job.jobObjectType == null)
        {
            // This job doesn't really have an associated sprite with it, so no need to render.
            return;
        }

        // FIXME: We can only do furniture-building jobs.

        // TODO: Sprite


        if (jobGameObjectMap.ContainsKey(job))
        {
            //Debug.LogError("OnJobCreated for a jobGO that already exists -- most likely a job being RE-QUEUED, as opposed to created.");
            return;
        }

        GameObject job_go = new GameObject();

        // Add our tile/GO pair to the dictionary.
        jobGameObjectMap.Add(job, job_go);

        job_go.name = "JOB_" + job.jobObjectType + "_" + job.tile.X + "_" + job.tile.Y;
        job_go.transform.position = new Vector3(job.tile.X + ((job.furniturePrototype.Width - 1) / 2f), job.tile.Y + ((job.furniturePrototype.Height - 1) / 2f), 0);
        job_go.transform.SetParent(this.transform, true);

        SpriteRenderer sr = job_go.AddComponent <SpriteRenderer>();

        sr.sprite           = fsc.GetSpriteForFurniture(job.jobObjectType);
        sr.color            = new Color(0.5f, 1f, 0.5f, 0.25f);
        sr.sortingLayerName = "Jobs";

        // FIXME: This hardcoding is not ideal!  <== Understatement
        if (job.jobObjectType == "Door")
        {
            // By default, the door graphic is meant for walls to the east & west
            // Check to see if we actually have a wall north/south, and if so
            // then rotate this GO by 90 degrees

            Tile northTile = World.current.GetTileAt(job.tile.X, job.tile.Y + 1);
            Tile southTile = World.current.GetTileAt(job.tile.X, job.tile.Y - 1);

            if (northTile != null && southTile != null && northTile.furniture != null && southTile.furniture != null &&
                northTile.furniture.objectType.Contains("Wall") && southTile.furniture.objectType.Contains("Wall"))
            {
                job_go.transform.rotation = Quaternion.Euler(0, 0, 90);
            }
        }


        job.RegisterJobCompletedCallback(OnJobEnded);
        job.RegisterJobStoppedCallback(OnJobEnded);
    }
    void OnJobCreated(Job job)
    {
        if (job.jobObjectType == null)
        {
            // This job doesn't really have an associated sprite with it, so no need to render.
            return;
        }

        // FIXME: We can only do furniture-building jobs.


        if (jobGameObjectMap.ContainsKey(job))
        {
            Debug.LogError("OnJobCreated for a jobGo that already exists -- most likely, a job being RE-QUEUED, as opposed to created.");
            // Can't do job right now, do wander.
            return;
        }

        GameObject job_go = new GameObject();

        // Add our job/GO pair to the dictionary
        jobGameObjectMap.Add(job, job_go);

        job_go.name = "JOB_" + job.jobObjectType + "_" + job.tile.X + "_" + job.tile.Y;
        job_go.transform.position = new Vector3(job.tile.X + ((job.furniturePrototype.Width - 1) / 2f), job.tile.Y + ((job.furniturePrototype.Height - 1) / 2f));
        job_go.transform.SetParent(this.transform, true);

        SpriteRenderer job_sr = job_go.AddComponent <SpriteRenderer>(); // FIXME:

        job_sr.sprite = fsc.GetSpriteForFurniture(job.jobObjectType);
        //job_sr.sprite = buildSprite;
        job_sr.sortingLayerName = "Over Tile";
        job_sr.color            = new Color(1f, 1f, 1f, 0.4f);
        job_sr.sortingLayerName = "Jobs";

        // FIXME: This hardcoding is not ideal!
        if (job.jobObjectType == "Door")
        {
            // By default it is connected to East & West walls.
            Tile northTile = job.tile.world.GetTileAt(job.tile.X, job.tile.Y + 1);
            Tile southTile = job.tile.world.GetTileAt(job.tile.X, job.tile.Y - 1);

            if (northTile != null && southTile != null && ((northTile.pendingFurnitureJob != null && southTile.pendingFurnitureJob != null &&
                                                            northTile.pendingFurnitureJob.jobObjectType == "Wall" && southTile.pendingFurnitureJob.jobObjectType == "Wall") ||
                                                           (northTile.furniture != null && southTile.furniture != null && northTile.furniture.objectType == "Wall" &&
                                                            southTile.furniture.objectType == "Wall")))
            {
                job_go.transform.rotation = Quaternion.Euler(0, 0, 90);
            }
        }

        job.RegisterJobCompleteCallback(OnJobEnded);
        job.RegisterJobCancelCallback(OnJobEnded);
    }
    void OnJobCreated(Job j)
    {
        //FIXME: We can only do furniture-building jobs.

        //TODO: Sprite


        //FIXME: Does not consider multi-tile objects nor rotated objects

        if (jobGameObjectMap.ContainsKey(j))
        {
            Debug.LogError("OnJobCreated for a jobGO that already exists -- most likely a job being RE-QUEUED, as opposed to created");
            return;
        }
        GameObject job_go = new GameObject();

        jobGameObjectMap.Add(j, job_go);

        job_go.name = "JOB_" + j.jobObjectType + "(" + j.tile.X + ", " + j.tile.Y + ")";
        job_go.transform.position = new Vector3(j.tile.X, j.tile.Y, 0);
        job_go.transform.SetParent(this.transform, true);

        //FIXME: We assume that the object must be a wall, so use the hardcoded reference to the wall sprite.
        SpriteRenderer sr = job_go.AddComponent <SpriteRenderer>();

        sr.sprite = fsc.GetSpriteForFurniture(j.jobObjectType);
        //Set transparency
        sr.color            = new Color(0.7f, 1f, 0.7f, 0.3f);
        sr.sortingLayerName = "Jobs";

        //FIXME: This hardconding is not ideal!
        if (j.jobObjectType == "Door")
        {
            //By default, the door graphic is meant for walls to the east & west
            //Check to see if we actually have a wall noirth/south, and if so, then
            //rotate this GO by 90 degrees
            Tile northTile = j.tile.world.GetTileAt(j.tile.X, j.tile.Y + 1);
            Tile southTile = j.tile.world.GetTileAt(j.tile.X, j.tile.Y - 1);
            if (northTile != null && southTile != null && northTile.furniture != null && southTile.furniture != null &&
                northTile.furniture.ObjectType == "Wall" && southTile.furniture.ObjectType == "Wall")
            {
                job_go.transform.rotation = Quaternion.Euler(0, 0, 90);
                job_go.transform.Translate(1f, 0, 0, Space.World);                //Ugly hack to compensate for bottom_left anchor point
            }
        }

        j.RegisterJobCompleteCallback(OnJobEnded);
        j.RegisterJobCancelCallback(OnJobEnded);
    }
    void OnJobCreated(Job j)
    {
        GameObject job_go = new GameObject();

        jobGameObjectMap.Add(j, job_go);

        job_go.name = "JOB_" + j.jobObjectType + "_" + j.Tile.X + "_" + j.Tile.Y;
        job_go.transform.position = new Vector3(j.Tile.X, j.Tile.Y, 0);
        job_go.transform.SetParent(this.transform, true);

        SpriteRenderer sr = job_go.AddComponent <SpriteRenderer>();

        sr.sprite = fsc.GetSpriteForFurniture(j.jobObjectType);
        sr.color  = new Color(0.5f, 1f, 0.5f, 0.25f);

        j.RegisterJobCompleteCallback(OnJobEnded);
        j.RegisterJobCancelCallback(OnJobEnded);
    }
    void onJobCreated(Job job)
    {
        if (job.jobObjectType == null)
        {
            return;
        }

        if (jobGameObjectMap.ContainsKey(job))
        {
            //Debug.LogError ("onJobCreated -- job_go already exists -- job re-enqueued?");
            return;
        }

        GameObject job_go = new GameObject();

        jobGameObjectMap.Add(job, job_go);

        job_go.name = "JOB_" + job.jobObjectType + "_" + job.tile.X + "_" + job.tile.Y;
        job_go.transform.position = new Vector3(job.tile.X + ((job.furniturePrototype.width - 1) / 2f), job.tile.Y + ((job.furniturePrototype.height - 1) / 2f), 0);
        job_go.transform.SetParent(this.transform, true);

        SpriteRenderer sr = job_go.AddComponent <SpriteRenderer> ();

        sr.sprite           = fsc.GetSpriteForFurniture(job.jobObjectType);
        sr.sortingLayerName = "Jobs";
        sr.color            = new Color(0.5f, 1f, 0.5f, 0.25f);

        if (job.jobObjectType == "Door")
        {
            Tile westTile = World.worldInstance.getTileAt(job.tile.X - 1, job.tile.Y);
            Tile eastTile = World.worldInstance.getTileAt(job.tile.X + 1, job.tile.Y);

            if (westTile != null && eastTile != null && westTile.furniture != null && eastTile.furniture != null && westTile.furniture.furnitureType == "Wall" && eastTile.furniture.furnitureType == "Wall")
            {
                job_go.transform.rotation = Quaternion.Euler(0, 0, 90);
            }
        }

        job.RegisterJobCompletedCallback(onJobEnded);
        job.RegisterJobStoppedCallback(onJobEnded);
    }
    void OnJobCreated(Job j)
    {
        // FIXME: We can only do furniture-building jobs
        GameObject job_go = new GameObject();

        // Add our tile/GO pair to the dictionary.
        jobGameObjectMap.Add(j, job_go);

        job_go.name = "JOB_" + j.jobObjectType + "_" + j.tile.X + "_" + j.tile.Y;
        job_go.transform.position = new Vector3(j.tile.X, j.tile.Y, 0);
        job_go.transform.SetParent(this.transform, true);

        SpriteRenderer sr = job_go.AddComponent <SpriteRenderer>();

        sr.sprite           = fsc.GetSpriteForFurniture(j.jobObjectType);
        sr.color            = new Color(0.5f, 1f, 0.5f, 0.3f);
        sr.sortingLayerName = "Jobs";

        j.RegisterJobCompleteCallback(OnJobEnded);
        j.RegisterJobCancelCallback(OnJobEnded);
    }
Exemple #11
0
    void ShowFurnitureSpriteAtTile(string furnitureType, Tile t)
    {
        furniturePreview.SetActive(true);

        SpriteRenderer job_sr = furniturePreview.GetComponent <SpriteRenderer>();

        job_sr.sprite = fsc.GetSpriteForFurniture(furnitureType);

        if (WorldController.Instance.world.IsFurniturePlacementValid(furnitureType, t))
        {
            job_sr.color = new Color(0.5f, 1f, 0.5f, 0.25f);
        }
        else
        {
            job_sr.color = new Color(1f, 0.5f, 0.5f, 0.25f);
        }

        job_sr.sortingLayerName = "Jobs";

        Furniture proto = t.world.furniturePrototypes[furnitureType];

        furniturePreview.transform.position = new Vector3(t.X + ((proto.Width - 1) / 2f), t.Y + ((proto.Height - 1) / 2f));
    }
    void OnJobCreated(Job j)
    {
        //TODO only can build furniture

        GameObject job_go = new GameObject();

        jobGOMap.Add(j, job_go); // Pair to dictionary

        job_go.name = "JOB_" + j.jobObjectType + "_" + j.Tile.X + "_" + j.Tile.Y;

        job_go.transform.position = new Vector3(j.Tile.X, j.Tile.Y, 0);

        job_go.transform.SetParent(this.transform, true);

        SpriteRenderer sr = job_go.AddComponent <SpriteRenderer>();

        sr.sprite           = fsc.GetSpriteForFurniture(j.jobObjectType);
        sr.sortingLayerName = "Jobs";
        sr.color            = new Color(0.5f, 1f, 0.5f, 0.25f);

        j.RegisterJobComplete(OnJobEnded);
        j.RegisterJobCancel(OnJobEnded);
    }
Exemple #13
0
    void ShowFurnitureSpriteAtTile(string furnitureType, Tile tile)
    {
        go = new GameObject();
        go.transform.SetParent(this.transform, true);
        dragCursors.Add(go);

        SpriteRenderer sr = go.AddComponent <SpriteRenderer> ();

        sr.sprite           = furnitureSpriteController.GetSpriteForFurniture(furnitureType);
        sr.sortingLayerName = "Jobs";

        if (WorldController.Instance.world.IsFurniturePlacementValid(furnitureType, tile))
        {
            sr.color = new Color(0.5f, 1f, 0.5f, 0.25f);
        }
        else
        {
            sr.color = new Color(1f, 0.5f, 0.5f, 0.25f);
        }

        Furniture furniturePrototype = World.worldInstance.GetFurniturePrototype(furnitureType);

        go.transform.position = new Vector3(tile.X + ((furniturePrototype.width - 1) / 2f), tile.Y + ((furniturePrototype.height - 1) / 2f), 0);
    }
Exemple #14
0
    protected override void OnCreated(Job job)
    {
        if (job.JobTileType == null && job.JobObjectType == null)
        {
            // This job doesn't really have an associated sprite with it, so no need to render.
            return;
        }

        // FIXME: We can only do furniture-building jobs.
        // TODO: Sprite
        if (objectGameObjectMap.ContainsKey(job))
        {
            return;
        }

        GameObject job_go = new GameObject();

        // Add our tile/GO pair to the dictionary.
        objectGameObjectMap.Add(job, job_go);

        job_go.name = "JOB_" + job.JobObjectType + "_" + job.tile.X + "_" + job.tile.Y + "_" + job.tile.Z;
        job_go.transform.SetParent(objectParent.transform, true);

        SpriteRenderer sr = job_go.AddComponent <SpriteRenderer>();

        if (job.JobTileType != null)
        {
            // This job is for building a tile.
            // For now, the only tile that could be is the floor, so just show a floor sprite
            // until the graphics system for tiles is fleshed out further.
            job_go.transform.position = job.tile.Vector3;
            sr.sprite = SpriteManager.GetSprite("Tile", "Solid");
            sr.color  = new Color32(128, 255, 128, 192);
        }
        else if (job.JobDescription.Contains("deconstruct"))
        {
            sr.sprite = SpriteManager.GetSprite("UI", "CursorCircle");
            sr.color  = Color.red;
            job_go.transform.position = job.tile.Vector3;
        }
        else if (job.JobDescription.Contains("mine"))
        {
            sr.sprite = SpriteManager.GetSprite("UI", "MiningIcon");
            sr.color  = new Color(1, 1, 1, 0.25f);
            job_go.transform.position = job.tile.Vector3;
        }
        else
        {
            // If we get this far we need a buildable prototype, bail if we don't have one
            if (job.buildablePrototype == null)
            {
                return;
            }

            // This is a normal furniture job.
            if (job.buildablePrototype.GetType().ToString() == "Furniture")
            {
                Furniture furnitureToBuild = (Furniture)job.buildablePrototype;
                sr.sprite = fsc.GetSpriteForFurniture(job.JobObjectType);
                job_go.transform.position = job.tile.Vector3 + ImageUtils.SpritePivotOffset(sr.sprite, furnitureToBuild.Rotation);
                job_go.transform.Rotate(0, 0, furnitureToBuild.Rotation);
            }
            else if (job.buildablePrototype.GetType().ToString() == "Utility")
            {
                sr.sprite = usc.GetSpriteForUtility(job.JobObjectType);
                job_go.transform.position = job.tile.Vector3 + ImageUtils.SpritePivotOffset(sr.sprite);
            }

            sr.color = new Color32(128, 255, 128, 64);
        }

        sr.sortingLayerName = "Jobs";

        // FIXME: This hardcoding is not ideal!  <== Understatement
        if (job.JobObjectType == "Door")
        {
            // By default, the door graphic is meant for walls to the east & west
            // Check to see if we actually have a wall north/south, and if so
            // then rotate this GO by 90 degrees
            Tile northTile = world.GetTileAt(job.tile.X, job.tile.Y + 1, job.tile.Z);
            Tile southTile = world.GetTileAt(job.tile.X, job.tile.Y - 1, job.tile.Z);

            if (northTile != null && southTile != null && northTile.Furniture != null && southTile.Furniture != null &&
                northTile.Furniture.HasTypeTag("Wall") && southTile.Furniture.HasTypeTag("Wall"))
            {
                job_go.transform.rotation = Quaternion.Euler(0, 0, 90);
            }
        }

        job.OnJobCompleted += OnRemoved;
        job.OnJobStopped   += OnRemoved;
    }
    protected override void OnCreated(Job job)
    {
        if (job.JobObjectType == null && job.JobTileType == null)
        {
            // This job doesn't really have an associated sprite with it, so no need to render.
            return;
        }

        // FIXME: We can only do furniture-building jobs.
        // TODO: Sprite
        if (objectGameObjectMap.ContainsKey(job))
        {
            return;
        }

        GameObject job_go = new GameObject();

        // Add our tile/GO pair to the dictionary.
        objectGameObjectMap.Add(job, job_go);

        job_go.name = "JOB_" + job.JobObjectType + "_" + job.tile.X + "_" + job.tile.Y + "_" + job.tile.Z;
        job_go.transform.SetParent(objectParent.transform, true);

        SpriteRenderer sr = job_go.AddComponent <SpriteRenderer>();

        if (job.JobTileType != null)
        {
            // This job is for building a tile.
            // For now, the only tile that could be is the floor, so just show a floor sprite
            // until the graphics system for tiles is fleshed out further.
            job_go.transform.position = new Vector3(job.tile.X, job.tile.Y, job.tile.Z);
            sr.sprite = SpriteManager.current.GetSprite("Tile", "Solid");
        }
        else
        {
            // This is a normal furniture job.
            job_go.transform.position = new Vector3(job.tile.X + ((job.furniturePrototype.Width - 1) / 2f), job.tile.Y + ((job.furniturePrototype.Height - 1) / 2f), job.tile.Z);
            sr.sprite = fsc.GetSpriteForFurniture(job.JobObjectType);
        }

        sr.color            = new Color(0.5f, 1f, 0.5f, 0.25f);
        sr.sortingLayerName = "Jobs";

        // FIXME: This hardcoding is not ideal!  <== Understatement
        if (job.JobObjectType == "Door")
        {
            // By default, the door graphic is meant for walls to the east & west
            // Check to see if we actually have a wall north/south, and if so
            // then rotate this GO by 90 degrees
            Tile northTile = world.GetTileAt(job.tile.X, job.tile.Y + 1, job.tile.Z);
            Tile southTile = world.GetTileAt(job.tile.X, job.tile.Y - 1, job.tile.Z);

            if (northTile != null && southTile != null && northTile.Furniture != null && southTile.Furniture != null &&
                northTile.Furniture.ObjectType.Contains("Wall") && southTile.Furniture.ObjectType.Contains("Wall"))
            {
                job_go.transform.rotation = Quaternion.Euler(0, 0, 90);
            }
        }

        job.OnJobCompleted += OnRemoved;
        job.OnJobStopped   += OnRemoved;
    }
Exemple #16
0
    void OnJobCreated(Job job)
    {
        if (job.jobObjectType == null && job.jobTileType == TileType.Empty)
        {
            //This job doesn't have an associated sprite so no need to render
            return;
        }

        // FIXME we can only do furniture building jobs

        // TODO: Sprite

        if (jobGameObjectMap.ContainsKey(job))
        {
            //Debug.LogError("OnJobCreated for a jobGO that already exists -- most likely job REQUEUE");
            return;
        }

        GameObject job_go = new GameObject();

        // Add the tile/GO pair to the dictionary
        jobGameObjectMap.Add(job, job_go);

        job_go.name = "JOB_" + job.jobObjectType + "_ " + job.tile.X + "_" + job.tile.Y;
        job_go.transform.SetParent(this.transform, true);

        SpriteRenderer sr = job_go.AddComponent <SpriteRenderer>();

        //This job is for building a tile
        if (job.jobTileType != TileType.Empty)
        {
            // TODO: other tile types
            job_go.transform.position = new Vector3(job.tile.X, job.tile.Y, 0);
            sr.sprite = SpriteManager.current.GetSprite("Tile", "Empty");
        }
        else
        {
            //This is a normal furniture job.
            job_go.transform.position = new Vector3(job.tile.X + ((job.furniturePrototype.Width - 1) / 2f), job.tile.Y + ((job.furniturePrototype.Height - 1) / 2f), 0);
            sr.sprite = fsc.GetSpriteForFurniture(job.jobObjectType);
        }
        sr.color            = new Color(0.5f, 1f, 0.5f, 0.25f);
        sr.sortingLayerName = "Jobs";

        // FIXME: This hardcoding is not good
        if (job.jobObjectType == "Door")
        {
            // By default, door graphic is meant for walls EW
            // Check to see if we actually have a wall NS and then rotate
            Tile northTile = World.Current.GetTileAt(job.tile.X, job.tile.Y + 1);
            Tile southTile = World.Current.GetTileAt(job.tile.X, job.tile.Y - 1);

            if (northTile != null && southTile != null && northTile.furniture != null &&
                southTile.furniture != null && northTile.furniture.objectType.Contains("Wall") &&
                southTile.furniture.objectType.Contains("Wall"))
            {
                job_go.transform.rotation = Quaternion.Euler(0, 0, 90);
            }
        }

        job.cbJobCompleted += OnJobEnded;
        job.cbJobStopped   += OnJobEnded;
    }