I have two lists A and B, list A has one entry at index 0 which is a scriptableObject and then want to instantiate that scriptableObject in list B at index 2 which has no entries.
So I need to be able to control what index in list A is instantiated in list B and at what index this happens. I don’t see a way with the overloads lists.
I hope you can help me. <3 <3 <3 <3 and <3
Edit below:
Since there are no responses I decided to try and I’m going to show my use case.
EquipableSkill.cs
[CreateAssetMenu]
public class EquipableSkill : ScriptableObject
{
[Header("Main")]
public string SkillName;
}
Yes, very exciting I know.
AllEquipableSkills.cs
public class AllEquipableSkills : MonoBehaviour
{
[SerializeField] List<EquipableSkill> equipableSkill = new List<EquipableSkill>();
}
which is on an arbitrary gameobject. and I made one scriptableobject and put into the list.
CharacterCore.cs
public class CharacterCore : MonoBehaviour
{
[SerializeField] AllEquipableSkills allEquipableSkills;
[SerializeField] List<EquipableSkill> KnownSkills;
[SerializeField] List<EquipableSkill> ActiveSkills;
}
This is on a another gameobject called, yes you guessed it, character. and I put the reference from gameobject holding the AllEquipableSkills list in the field.
Now I want to be able to add any entry from allEquipableSkills to KnownSkills and then add and remove from ActiveSkills as needed. I have looked at a lot of different sites and examples but none of them seem to do the trick.
I hope this explanation will help solving this problem for me