So in my game I want to make a skill tree, and I want to try to keep my skills organized in an array which divides them into the sections for the different characters. Then I want to reuse the same gameObjects, but change their data (Image, position, cost) to match the skill I assign. What I am having trouble on is producing an array that works like this. I’ve looked up answers for this and tried creating a class that works like this, but I can’t even get a list going –https://answers.unity.com/questions/698312/store-multiple-types-of-data-in-an-array.html--. Am I going at this the right way, or should I organize things differently?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SkillTreeListClass
{
public string myMainClass;
public string mySubClass;
public string mySkillName;
public GameObject mySkill;
public Image myImage;
public Transform myTransform;
public GameObject myRequirement;
public int myCharacterPointsCost;
public int mySkillPointsCost;
}
//What I want --> type[,,] SkillTreeSkills = new type[2, -, -, -, -, -] { };//Main Character class (string), Sub Character Class (string), skill name (string), GameObject(of the actual skill), Image(of the skill), transform(transform or x & y (float)), gameobject evolved from(or skill needeed to unlock this skill), skill point cost (int)
//What I tried so far...
private List<SkillTreeListClass> list = new List<SkillTreeListClass>() { "MainClass1" };
Thanks