Combatant my_Hero;
if (Hero.Length > 0) {
// array of game object prefabs , i use only one hero in this case
group = ORK.Game.PlayerHandler.GetGroup(0);
foreach (GameObject aa in Hero) {
if(aa!=null)
{
my_Hero = ORK.Combatants.Create(1, group);
my_Hero.Init();
string Hero_Name=PlayerPrefs.GetString("Hero_Name");
my_Hero.SetName(Hero_Name);
for(int i=4;i<11;i++)
{
print (i+" = "+ PlayerPrefs.GetInt("Hero_Status_Extra"+i));
// the log show me extra point that i need to add
my_Hero.Status[i].AddValue(PlayerPrefs.GetInt("Hero_Status_Extra"+i),true,true,true,true,true,true);
}
my_Hero.Status[11].SetValue(main.Hero_Exp,true,true,true,true,true,true); // => OK
my_Hero.Inventory.SetMoney(0,main.Hero_Mony,false,false); // => OK
Vector3 point=GameObject.Find("Hero_spawn").transform.position;
my_Hero.Spawn(point, false, 0f, false, new Vector3 (1f,1f,1f)); // ok
group.Join(my_Hero);
if (my_Hero.GameObject.GetComponent<CombatantComponent>() != null) {
my_Hero.GameObject.GetComponent<CombatantComponent> ().combatant.Status[1].Changed += StatusValueChanged;
my_Hero.GameObject.GetComponent<CombatantComponent> ().combatant.Status[11].Changed += StatusValueChanged;
my_Hero.GameObject.GetComponent<CombatantComponent> ().combatant.LevelChanged += LevelChanged;
}
my_Hero.GameObject.tag="Hero";
.
.
.
.
It looks like you're new here. If you want to get involved, click one of these buttons!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
ty