private void SpawnPlayersOld() { playerNetwork = new List <WorldEntityNetwork>(); var pl1 = WorldEntityFabric.Character("zimmabue", "char01"); var pl2 = WorldEntityFabric.Character("uriel", "char02"); WorldEntityNetwork we1 = Instantiate(entityNetworkPrefab); we1.worldEntity = pl1; we1.transform.position = new Vector3(pl1.position.x + 0.5f, pl1.position.y + 0.5f, -0.1f); playerNetwork.Add(we1); NetworkServer.Spawn(we1.gameObject); WorldEntityNetwork we2 = Instantiate(entityNetworkPrefab); we2.worldEntity = pl2; we2.transform.position = new Vector3(pl2.position.x + 0.5f, pl2.position.y + 0.5f, -0.1f); playerNetwork.Add(we2); NetworkServer.Spawn(we2.gameObject); }
public void Save() { Storage.StorageManager.GetDataAccess().Save(Application.persistentDataPath + "/local.pl", characterName.text); WorldEntity pl = WorldEntityFabric.Character(characterName.text, sprites[spriteCounter].name); Character c = new Character(true); c.classesLevel = classesLevel.text; c.races = races.text; c.alignment = alignment.text; c.divinity = divinity.text; c.age = age.text; c.gender = gender.text; c.height = float.Parse(height.text); c.weight = float.Parse(weight.text); c.eyes = eyes.text; c.hair = hair.text; c.skin = skin.text; c.strenght = int.Parse(strenght.text); c.strenghtModifier = int.Parse(strenghtModifier.text); c.dexterity = int.Parse(dexterity.text); c.dexterityModifier = int.Parse(dexterityModifier.text); c.consitution = int.Parse(consitution.text); c.consitutionModifier = int.Parse(consitutionModifier.text); c.intelligence = int.Parse(intelligence.text); c.intelligenceModifier = int.Parse(intelligenceModifier.text); c.wisdom = int.Parse(wisdom.text); c.wisdomModifier = int.Parse(wisdomModifier.text); c.charisma = int.Parse(charisma.text); c.charismaModifier = int.Parse(charismaModifier.text); c.st_strenght = int.Parse(st_strenght.text); c.st_dexterity = int.Parse(st_dexterity.text); c.st_constitutio = int.Parse(st_constitutio.text); c.st_intelligence = int.Parse(st_intelligence.text); c.st_wisdom = int.Parse(st_wisdom.text); c.st_charisma = int.Parse(st_charisma.text); c.armorClass = int.Parse(armorClass.text); c.currentHitPoint = int.Parse(currentHitPoint.text); c.speed = int.Parse(speed.text); pl.character = c; player.CreateNewPlayer(pl); if (onSave != null) { onSave(characterName.text); } }