// Use this for initialization void Start() { mMetalResource = new Metal(); mMetalResource.SetIcon(GetComponent <SpriteRenderer>().sprite); }