I want to create array [,] with list class here (ListValue.cs):
class ListValue
{
public string val_DT { get; set; }
public string val_TR { get; set; }
public string val_PL { get; set; }
public string val_LP { get; set; }
public string Result { get; set; }
public ListValue(string n_dt, string n_tr, string n_pl, string n_lp, n_result)
{
this.val_DT = n_dt;
this.val_TR = n_tr;
this.val_PL = n_pl;
this.val_LP = n_lp;
}
}
I tried this but didn’t works (Script.cs) :
_Array = new double[2, ListValue.Count];
double[] _A, _B, _C, _D;
double a, b, c, d;
for (int i = 0; i < ListValue.Count; i++)
{
_Array[0, i] = (_A <em>* a) + (_B <em>* b) + (_C _* c +_</em></em>
(_D * d;
_Array[1, i] = i;
}
bool flag = true;
double tmp;
for (int i = 1; (i < ListValue.Count - 1) && flag; i++)
{
flag = false;
for (int j = 0; j < ListValue.Count - 1; j++)
{
if (_Array[0, j + 1] > _Array[0, j])
{
tmp = _Array[0, j];
_Array[0, j] = _Array[0, j + 1];
_Array[0, j + 1] = tmp;
tmp = _Array[1, j];
_Array[1, j] = _Array[1, j + 1];
_Array[1, j + 1] = tmp;
flag = true;
Debug.Log(_Array[1, i]);
}
}
}
The debug.log no show result.