// Use this for initialization
    void Start()
    {
        estateJobGameObjectMap = new Dictionary <EstateJob, GameObject> ();

        fsc = GameObject.FindObjectOfType <FixtureSpriteController> ();

        world.estateJobManager.RegisterJobCreatedCallback(OnJobCreated);
        //We do this for any fixtures that may already exist in the world(via loading or otherwise) so that we render those
        foreach (EstateJob job in world.estateJobManager.GetAllJobs())
        {
            OnJobCreated(job);
        }
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        LoadSprites();

        // Instantiate our dictionary that tracks which GameObject is rendering which Fixture data.
        fixtureGameObjectMap = new Dictionary <Fixture, GameObject>();
        gameObjectFixtureMap = new Dictionary <GameObject, Fixture>();
        //containerGameObjectMap = new Dictionary<Container, GameObject>();

        // Register our callback so that our GameObject gets updated whenever
        // the door changes
        area.RegisterDoorCreated(OnDoorCreated);
        area.RegisterContainerCreated(OnContainerCreated);

        foreach (Fixture fixture in area.fixtures)
        {
            if (fixture.GetType() == typeof(Door))
            {
                OnDoorCreated(fixture as Door);
                OnDoorChanged(fixture as Door);
            }
            if (fixture.GetType() == typeof(Container))
            {
                OnContainerCreated(fixture as Container);
                OnContainerChanged(fixture as Container);
            }
        }

        //foreach (Container c in area.containers)
        //{
        //    OnContainerCreated(c);
        //    OnContainerChanged(c);
        //}
    }