Example #1
0
    public static void Init()
    {
        //Load from file
        elements = new ExtraGraphicalElement[numElements];

        elements [0] = new ExtraGraphicalElement("Lock Symbol", Resources.Load <Sprite> ("Sprites/UI/lock"));
        elements [1] = new ExtraGraphicalElement("Deletion Marker", Resources.Load <Sprite> ("Sprites/UI/deletion"));
    }
 static void AddGraphic(Tile t, Villager v, ExtraGraphicalElement e)
 {
     Debug.Log("Adding graphic @ " + t.X + " " + t.Y);
     if (MapController.Instance.ExtraGraphicalElements.ContainsKey(t) == false)
     {
         MapController.Instance.AddExtraGraphicalElement(t, e);
     }
 }
Example #3
0
    public void AddExtraGraphicalElement(Tile t, ExtraGraphicalElement e)
    {
        GameObject e_go = new GameObject();

        e_go.name = e.Name;
        e_go.transform.position = t.GetPosition();
        SpriteRenderer e_go_sr = e_go.AddComponent <SpriteRenderer> ();

        e_go_sr.sprite           = e.Sprite;
        e_go_sr.sortingLayerName = "UI";
        //Do I want these to be affected by light? Idk bro

        extraGraphicalElements.Add(t, e_go);
    }