|
|
|
@ -316,6 +316,59 @@ public class WeaponManager : Singleton<WeaponManager> |
|
|
|
return gem; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public GameObject getRandomAddScoreWeaponNodeForPlayerWithLevel(string level) |
|
|
|
{ |
|
|
|
GameObject gem = Instantiate(Resources.Load<GameObject>(Name.WeaponNode.PrefabPath + Name.WeaponNode.PrefabName)); |
|
|
|
string condition = ""; |
|
|
|
switch (level) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeLevel.Basic: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerBasicConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Elementary: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerElementaryConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Intermediate: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerIntermediateConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Advanced: |
|
|
|
condition = MathTool.GetRandomElements(Name.WeaponNodeCondition.PlayerAdvancedConditionSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
string conditionValue = ""; |
|
|
|
List<string> nodesMark = new List<string>(); |
|
|
|
List<string> nodesColor = new List<string>(); |
|
|
|
string result = ""; |
|
|
|
switch (level) |
|
|
|
{ |
|
|
|
case Name.WeaponNodeLevel.Basic: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerBasicAddScoreResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Elementary: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerElementaryResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Intermediate: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerIntermediateResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
case Name.WeaponNodeLevel.Advanced: |
|
|
|
result = MathTool.GetRandomElements(Name.WeaponNodeFunction.PlayerAdvancedResultSet, 1).ElementAt(0); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
string resultValue = ""; |
|
|
|
conditionValue = getConditionValueWithLevel(level, ref condition, ref nodesMark, ref nodesColor); |
|
|
|
resultValue = getResultValueWithLevel(level, ref result, condition, conditionValue); |
|
|
|
WeaponNode weaponNode = gem.GetComponent<WeaponNode>(); |
|
|
|
weaponNode.result = result; |
|
|
|
weaponNode.resultValue = resultValue; |
|
|
|
weaponNode.condition = condition; |
|
|
|
weaponNode.conditionValue = conditionValue; |
|
|
|
weaponNode.nodesMark = nodesMark.ToArray(); |
|
|
|
weaponNode.nodesColor = nodesColor.ToArray(); |
|
|
|
return gem; |
|
|
|
} |
|
|
|
public GameObject getRandomWeaponNodeForPlayerWithLevelDiff(int levelDiff) |
|
|
|
{ |
|
|
|
GameObject gem = Instantiate(Resources.Load<GameObject>(Name.WeaponNode.PrefabPath + Name.WeaponNode.PrefabName)); |
|
|
|
|