public int AddNewRandomNode(int Source, Vector2 position, List <int> IDList, bool Ascend = false) { int ID = IDList.Count; ItemNode Node = (ItemNode)ItemNodeAtlas.GetCorrectNode(IDList[Mathf.RandomInt(0, ID)]); if (!Ascend) { float power = Mathf.Clamp((position.Y / 250) + (Math.Abs(position.X) / 300) + Mathf.Random(-0.35f, 0.35f), 0, 45); int level = 3 + (int)power; int requirement = Mathf.FloorInt(1 + power * 0.75f); Node.Init(this, m_nodeList.Count, level, requirement, position); Node.SetPower(1 + power); if (Source != -1) { Node.AddNeightboor(Source); } m_nodeList.Add(Node); } return(m_nodeList.Count - 1); }
public void AddNode(ItemNode node) { m_nodeList.Add(node); }