How do I implement lists for this? Or should I?
I have a question about whether or not I should be using a list for this function or something else.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
public class Skills : MonoBehaviour
{
public class Info
{
public string name { get; set;}
public string description { get; set;}
public int normalamount { get; set;}
public int adjustedamount { get; set;}
public List<GameObject> adjustments;
public Info (string Sname, string Sdescription, int Snormalamount, int Sadjustedamount)
{
name = Sname;
description = Sdescription;
normalamount = Snormalamount;
adjustedamount = Sadjustedamount;
}
public void AddAdjustment (GameObject adjustmenttobeadded)
{
adjustments.Add (adjustmenttobeadded);
}
public void Amountadjustment ()
{
adjustedamount = normalamount;
items.foreach (GameObject adjustables in adjustments)
{
adjustedamount = adjustables.Info.effectmod + adjustedamount;
}
}
}
}
I want to figure out all the adjustments to a skill modifier based on the equipment, or the environment, of some other status effect. A character uses that skill, in my game to do all the things they do. The issue is that the 'equipment' class is separate from the 'environment' class and so on. I'm trying to create a list, add references to the equipment, and then effect the skill based on those, but have multiple classes for the list. Is it right to say they're all gameobjects? and if so, if each individual class has a sub 'Info' class that has all the variables I need, how do I access them?
Your answer
Follow this Question
Related Questions
Collection was modified; enumeration operation may not compute 0 Answers
NullReferenceException: Object reference not set to an instance of an object 0 Answers
Action queue/list for NPCs in point and click adventure. 0 Answers
Class value as list of the same class 0 Answers
How to structure achievements? 1 Answer