float GetNumValue(BulletValue v, BulletMLTask task) { if (v.ValueType == BLValueType.Number) { return(v.Value); } else if (v.ValueType == BLValueType.Rand) { return((float)BulletMLManager.GetRandom()); } else if (v.ValueType == BLValueType.Rank) { return(BulletMLManager.GetRank()); } else if (v.ValueType == BLValueType.Param) { BulletMLTask ownerTask = task; while (ownerTask.ParamList.Count == 0) { ownerTask = ownerTask.Owner; } float val = ownerTask.ParamList[(int)v.Value - 1]; //BulletMLTask ownerTask = task; //while (ownerTask.paramNode == null) // ownerTask = ownerTask.owner; //float val = ownerTask.paramNode.children[(int)v.value - 1].GetValue(ownerTask.owner); //Debug.WriteLine(String.Format( "{2} param{0} = {1}", (int)v.value - 1, val, ownerTask)); return(val); } else { //Debug.WriteLine("不正な値がパラメータになっています"); return(0); } }
float GetNumValue(BulletValue v, BulletMLTask task) { if (v.ValueType == BLValueType.Number) { return v.Value; } else if (v.ValueType == BLValueType.Rand) { return (float)BulletMLManager.GetRandom(); } else if (v.ValueType == BLValueType.Rank) { return BulletMLManager.GetRank(); } else if (v.ValueType == BLValueType.Param) { BulletMLTask ownerTask = task; while (ownerTask.ParamList.Count == 0) ownerTask = ownerTask.Owner; float val = ownerTask.ParamList[(int)v.Value - 1]; //BulletMLTask ownerTask = task; //while (ownerTask.paramNode == null) // ownerTask = ownerTask.owner; //float val = ownerTask.paramNode.children[(int)v.value - 1].GetValue(ownerTask.owner); //Debug.WriteLine(String.Format( "{2} param{0} = {1}", (int)v.value - 1, val, ownerTask)); return val; } else { //Debug.WriteLine("不正な値がパラメータになっています"); return 0; } }