public void OnStaticObjectCreated(StaticObject obj) { GameObject obj_go = new GameObject(); obj_go.name = "obj_" + obj.ObjectType; staticObjGameobjectMap.Add(obj, obj_go); obj_go.transform.position = new Vector3(obj.Tile.X, obj.Tile.Y, -2); obj_go.transform.SetParent(this.transform, true); //FIXME: assume the object must be a wall so we use harcoded wall sprite obj_go.AddComponent <SpriteRenderer> ().sprite = GetSpriteForStaticObject(obj); obj.RegisterOnChangedCallBack(OnStaticObjChanged); }