It’s hard to explain in just the title what my issue is so hear me out
I have used the default CustomTiledImporter code and tried to make an “Object” into a simple door. Using the following code it pulls in the door, changes it’s name to “Door (Location property)” which is what I’d expect. But when trying to add a component or do anything else with the gameObject it just does nothing. This is my code:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[Tiled2Unity.CustomTiledImporter]
public class CustomImporter_Entities : Tiled2Unity.ICustomTiledImporter
{
public void HandleCustomProperties(GameObject gameObject, IDictionary<string, string> Properties)
{
if(gameObject.name == "Door")
{
if(Properties.ContainsKey("Location"))
{
gameObject.name = "Door ("+Properties["Location"]+")";
gameObject.GetComponent<BoxCollider2D>().isTrigger = true;
gameObject.AddComponent<DoorEntity>();
}
}
}
public void CustomizePrefab(GameObject prefab)
{
// Do nothing
}
}
After looking at the tutorials on the seanba website I thought I had followed them correctly… but I can’t find the problem
Any help would be greatly appreciated thanks