Hello everyones !
I am currently trying to custom a script’s inpector.
I have two scripts, A and B. in A I have a class and a list, in B i custom the editor for A.
I would like to know if i can to create a button for each link of my list and if it is possible to rename thoses links in the editor without store my list in a dictionnary.
In case it help someone I have find a way to rename all the links of my list. I created a
new public string name;
in the class A and i just have to rename by myself in the editor.
For starters, I don’t recommend overriding MonoBehaviour’s own name field; make your own. public string myName or whatever. I could see some strange behavior happening if you override that field. (It might break serialization, for example.)
Beyond that, I don’t entirely follow what you’re trying to accomplish here. A little more context might help?
Okay, thanks for your response.
[System.Serializable]
public class Groups
{
[Header("Amount | Range | GroupSize")]
public Vector3 GroupsData;
public GameObject[] GroupsModel;
}
[System.Serializable]
public class Rocks
{
[Header("Amount | Range | RockSize")]
public Vector3 RocksData;
[Header("BiggestSize | SmallestSize | Step")]
public Vector3 AllRocksData;
public GameObject[] SmallRocks;
public GameObject[] MediumRocks;
public GameObject[] BigRocks;
}
[System.Serializable]
public class Trees
{
[Header("Amount | Space | Max Size")]
public Vector3 TreesData;
public GameObject[] TreesModel;
[Header("Please don't fill anything")]
public GameObject[] TreeCollector;
}
[System.Serializable]
public class Biome
{
public string name;
public Rocks RocksObject;
public Trees TreeObject;
public Groups GroupsObject;
public Biome()
{
RocksObject = new Rocks();
TreeObject = new Trees();
GroupsObject = new Groups();
}
}
public List<Biome> BiomeList = new List<Biome>();
I have the class Biome and I would like to display a button for each link of the list BiomeList in the editor.