private void Update()
 {
     if (curMapName != CheckCurrentMetadata.getCurMap())
     {
         curMapName = CheckCurrentMetadata.getCurMap();
         updateShading();
     }
 }
    private void Awake()
    {
        // If supported in the shader set our opacity
        // (Keep opacity at 1.0 to avoid copying the material)
        SpriteRenderer meshRendrer = this.gameObject.GetComponent <SpriteRenderer>();

        curMapName = CheckCurrentMetadata.getCurMap();
        Color dayNightColor = DayNightShading.getCurrentShading();

        meshRendrer.material.SetColor("_Color", dayNightColor);
        InvokeRepeating("updateShading", 0.0f, 60.0f);
    }