public static HeroCostume LocalDataToHeroCostume(string slot) { slot = slot.ToUpper(); if (!PlayerPrefs.HasKey(slot + PhotonPlayerProperty.sex)) { return(HeroCostume.costume[0]); } HeroCostume costume = new HeroCostume(); costume = new HeroCostume { sex = IntToSex(PlayerPrefs.GetInt(slot + PhotonPlayerProperty.sex)), id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.heroCostumeId), costumeId = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.costumeId), cape = (PlayerPrefs.GetInt(slot + PhotonPlayerProperty.cape) != 1) ? false : true, hairInfo = (costume.sex != SEX.MALE) ? CostumeHair.hairsF[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)] : CostumeHair.hairsM[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)], eye_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.eye_texture_id), beard_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.beard_texture_id), glass_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.glass_texture_id), skin_color = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.skin_color), hair_color = new Color(PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color1), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color2), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color3)), division = IntToDivision(PlayerPrefs.GetInt(slot + PhotonPlayerProperty.division)), stat = new HeroStat() }; costume.stat.SPD = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statSPD); costume.stat.GAS = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statGAS); costume.stat.BLA = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statBLA); costume.stat.ACL = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statACL); costume.stat.skillId = PlayerPrefs.GetString(slot + PhotonPlayerProperty.statSKILL); costume.setBodyByCostumeId(-1); costume.setMesh2(); costume.setTexture(); return(costume); }
public static HeroCostume PhotonDataToHeroCostume(Player player) { var costume = new HeroCostume { sex = player.Properties.Sex, costumeId = player.Properties.CostumeID, id = player.Properties.HeroCostumeID, cape = player.Properties.HasCape, hairInfo = player.Properties.Sex != Sex.Male ? CostumeHair.FemaleHairs[player.Properties.HairInfo] : CostumeHair.MaleHairs[player.Properties.HairInfo], eye_texture_id = player.Properties.EyeTextureID, beard_texture_id = player.Properties.BeardTextureID, glass_texture_id = player.Properties.GlassTextureID, skin_color = player.Properties.SkinColor, hair_color = player.Properties.HairColor, division = player.Properties.Division, stat = player.Properties.HeroStat }; if (costume.costumeId == 25 && costume.sex == Sex.Female) { costume.costumeId = 26; } costume.setBodyByCostumeId(-1); costume.setMesh2(); costume.setTexture(); return(costume); }
public static void HeroCostumeToPhotonData2(HeroCostume costume, PhotonPlayer player) { Hashtable propertiesToSet = new Hashtable(); propertiesToSet.Add(PhotonPlayerProperty.sex, SexToInt(costume.sex)); int costumeId = costume.costumeId; if (costumeId == 0x1a) { costumeId = 0x19; } propertiesToSet.Add(PhotonPlayerProperty.costumeId, costumeId); propertiesToSet.Add(PhotonPlayerProperty.heroCostumeId, costume.id); propertiesToSet.Add(PhotonPlayerProperty.cape, costume.cape); propertiesToSet.Add(PhotonPlayerProperty.hairInfo, costume.hairInfo.id); propertiesToSet.Add(PhotonPlayerProperty.eye_texture_id, costume.eye_texture_id); propertiesToSet.Add(PhotonPlayerProperty.beard_texture_id, costume.beard_texture_id); propertiesToSet.Add(PhotonPlayerProperty.glass_texture_id, costume.glass_texture_id); propertiesToSet.Add(PhotonPlayerProperty.skin_color, costume.skin_color); propertiesToSet.Add(PhotonPlayerProperty.hair_color1, costume.hair_color.r); propertiesToSet.Add(PhotonPlayerProperty.hair_color2, costume.hair_color.g); propertiesToSet.Add(PhotonPlayerProperty.hair_color3, costume.hair_color.b); propertiesToSet.Add(PhotonPlayerProperty.division, DivisionToInt(costume.division)); propertiesToSet.Add(PhotonPlayerProperty.statSPD, costume.stat.SPD); propertiesToSet.Add(PhotonPlayerProperty.statGAS, costume.stat.GAS); propertiesToSet.Add(PhotonPlayerProperty.statBLA, costume.stat.BLA); propertiesToSet.Add(PhotonPlayerProperty.statACL, costume.stat.ACL); propertiesToSet.Add(PhotonPlayerProperty.statSKILL, costume.stat.skillId); player.SetCustomProperties(propertiesToSet); }
public static HeroCostume LocalDataToHeroCostume(string slot) { slot = slot.ToUpper(); if (!PlayerPrefs.HasKey(slot + PlayerProperty.Sex)) { return(HeroCostume.costume[0]); } HeroCostume costume = new HeroCostume(); costume = new HeroCostume { sex = (Sex)PlayerPrefs.GetInt(slot + PlayerProperty.Sex), id = PlayerPrefs.GetInt(slot + PlayerProperty.HeroCostumeID), costumeId = PlayerPrefs.GetInt(slot + PlayerProperty.CostumeID), cape = PlayerPrefs.GetInt(slot + PlayerProperty.HasCape) == 1, hairInfo = costume.sex != Sex.Male ? CostumeHair.FemaleHairs[PlayerPrefs.GetInt(slot + PlayerProperty.HairInfo)] : CostumeHair.MaleHairs[PlayerPrefs.GetInt(slot + PlayerProperty.HairInfo)], eye_texture_id = PlayerPrefs.GetInt(slot + PlayerProperty.EyeTextureID), beard_texture_id = PlayerPrefs.GetInt(slot + PlayerProperty.BeardTextureId), glass_texture_id = PlayerPrefs.GetInt(slot + PlayerProperty.GlassTextureID), skin_color = PlayerPrefs.GetInt(slot + PlayerProperty.SkinColor), hair_color = new Color(PlayerPrefs.GetFloat(slot + PlayerProperty.HairColorR), PlayerPrefs.GetFloat(slot + PlayerProperty.HairColorG), PlayerPrefs.GetFloat(slot + PlayerProperty.HairColorB)), division = (Division)PlayerPrefs.GetInt(slot + PlayerProperty.Division), stat = new HeroStat() }; costume.stat.Speed = PlayerPrefs.GetInt(slot + PlayerProperty.Speed); costume.stat.Gas = PlayerPrefs.GetInt(slot + PlayerProperty.Gas); costume.stat.Blade = PlayerPrefs.GetInt(slot + PlayerProperty.Blade); costume.stat.Acceleration = PlayerPrefs.GetInt(slot + PlayerProperty.Acceleration); costume.stat.SkillName = PlayerPrefs.GetString(slot + PlayerProperty.Skill); costume.setBodyByCostumeId(); costume.setMesh2(); costume.setTexture(); return(costume); }
private void Start() { HERO_SETUP component = base.gameObject.GetComponent <HERO_SETUP>(); HeroCostume.Init(); component.Init(); component.myCostume = HeroCostume.Costumes[costumeId]; component.CreateCharacterComponent(); head = base.transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head"); cameraPref = base.transform.Find("Amarture/Controller_Body/hip/spine/chest/shoulder_R/upper_arm_R"); if (costumeId == 9) { cameraOffset = GameObject.Find("MainCamera_Mono").transform.position - cameraPref.position; } if (component.myCostume.sex == Sex.FEMALE) { base.animation.Play("stand"); base.animation["stand"].normalizedTime = Random.Range(0f, 1f); } else { base.animation.Play("stand_levi"); base.animation["stand_levi"].normalizedTime = Random.Range(0f, 1f); } AnimationState animationState = base.animation["stand_levi"]; float speed = 0.5f; base.animation["stand"].speed = speed; animationState.speed = speed; }
public static void HeroCostumeToPhotonData(HeroCostume costume, Player player) { int costumeId = costume.costumeId; if (costumeId == 26) { costumeId = 25; } player.SetCustomProperties(new Hashtable { { PlayerProperty.Sex, (int)costume.sex }, { PlayerProperty.HeroCostumeID, costume.id }, { PlayerProperty.HasCape, costume.cape }, { PlayerProperty.HairInfo, costume.hairInfo.ID }, { PlayerProperty.EyeTextureID, costume.eye_texture_id }, { PlayerProperty.BeardTextureId, costume.beard_texture_id }, { PlayerProperty.GlassTextureID, costume.glass_texture_id }, { PlayerProperty.SkinColor, costume.skin_color }, { PlayerProperty.HairColorR, costume.hair_color.r }, { PlayerProperty.HairColorG, costume.hair_color.g }, { PlayerProperty.HairColorB, costume.hair_color.b }, { PlayerProperty.Division, (int)costume.division }, { PlayerProperty.Speed, costume.stat.Speed }, { PlayerProperty.Gas, costume.stat.Gas }, { PlayerProperty.Blade, costume.stat.Blade }, { PlayerProperty.Acceleration, costume.stat.Acceleration }, { PlayerProperty.Skill, costume.stat.SkillName }, { PlayerProperty.CostumeID, costumeId } }); }
public static HeroCostume PhotonDataToHeroCostume(PhotonPlayer player) { HeroCostume heroCostume = new HeroCostume(); Hashtable props = player.Properties; heroCostume.sex = IntToSex(props.Get <int>(PhotonPlayerProperty.sex)); heroCostume.costumeId = props.Get <int>(PhotonPlayerProperty.costumeId); heroCostume.id = props.Get <int>(PhotonPlayerProperty.heroCostumeId); heroCostume.cape = props.Get <bool>(PhotonPlayerProperty.cape); CostumeHair[] hairs = IntToSex(props.Get <int>(PhotonPlayerProperty.sex)) == Sex.Male ? CostumeHair.hairsM : CostumeHair.hairsF; int hairId = props.Get <int>(PhotonPlayerProperty.hairInfo); heroCostume.hairInfo = hairs[hairId < hairs.Length ? hairId : 0]; heroCostume.eye_texture_id = props.Get <int>(PhotonPlayerProperty.eye_texture_id); heroCostume.beard_texture_id = props.Get <int>(PhotonPlayerProperty.beard_texture_id); heroCostume.glass_texture_id = props.Get <int>(PhotonPlayerProperty.glass_texture_id); heroCostume.skin_color = props.Get <int>(PhotonPlayerProperty.skin_color); heroCostume.hair_color = new Color(props.Get <float>(PhotonPlayerProperty.hair_color1), props.Get <float>(PhotonPlayerProperty.hair_color2), props.Get <float>(PhotonPlayerProperty.hair_color3)); heroCostume.division = IntToDivision(props.Get <int>(PhotonPlayerProperty.division)); HeroStat stat = new HeroStat(); stat.Spd = props.Get <int>(PhotonPlayerProperty.statSPD); stat.Gas = props.Get <int>(PhotonPlayerProperty.statGAS); stat.Bla = props.Get <int>(PhotonPlayerProperty.statBLA); stat.Acl = props.Get <int>(PhotonPlayerProperty.statACL); string skill = props.Get <string>(PhotonPlayerProperty.statSKILL); stat.skillID = skill ?? "levi"; heroCostume.stat = stat; heroCostume.setBodyByCostumeId(-1); heroCostume.setMesh(); heroCostume.setTexture(); return(heroCostume); }
public static HeroCostume LocalDataToHeroCostume(string slot) { slot = slot.ToUpper(); if (!PlayerPrefs.HasKey(slot + PhotonPlayerProperty.sex)) { return(HeroCostume.costume[0]); } HeroCostume heroCostume = new HeroCostume(); heroCostume.sex = IntToSex(PlayerPrefs.GetInt(slot + PhotonPlayerProperty.sex)); heroCostume.id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.heroCostumeId); heroCostume.costumeId = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.costumeId); heroCostume.cape = (PlayerPrefs.GetInt(slot + PhotonPlayerProperty.cape) == 1); heroCostume.hairInfo = ((heroCostume.sex != Sex.Male) ? CostumeHair.hairsF[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)] : CostumeHair.hairsM[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)]); heroCostume.eye_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.eye_texture_id); heroCostume.beard_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.beard_texture_id); heroCostume.glass_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.glass_texture_id); heroCostume.skin_color = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.skin_color); heroCostume.hair_color = new Color(PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color1), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color2), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color3)); heroCostume.division = CostumeConeveter.IntToDivision(PlayerPrefs.GetInt(slot + PhotonPlayerProperty.division)); heroCostume.stat = new HeroStat(); heroCostume.stat.Spd = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statSPD); heroCostume.stat.Gas = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statGAS); heroCostume.stat.Bla = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statBLA); heroCostume.stat.Acl = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statACL); heroCostume.stat.skillID = PlayerPrefs.GetString(slot + PhotonPlayerProperty.statSKILL); heroCostume.setBodyByCostumeId(-1); heroCostume.setMesh(); heroCostume.setTexture(); return(heroCostume); }
private void onCharacterChange() { HeroStat stat; string selection = base.GetComponent <UIPopupList>().selection; switch (selection) { case "Set 1": case "Set 2": case "Set 3": { HeroCostume costume = CostumeConeveter.LocalDataToHeroCostume(selection.ToUpper()); if (costume == null) { stat = new HeroStat(); } else { stat = costume.stat; } break; } default: stat = HeroStat.getInfo(base.GetComponent <UIPopupList>().selection); break; } this.SPD.transform.localScale = new Vector3((float)stat.SPD, 20f, 0f); this.GAS.transform.localScale = new Vector3((float)stat.GAS, 20f, 0f); this.BLA.transform.localScale = new Vector3((float)stat.BLA, 20f, 0f); this.ACL.transform.localScale = new Vector3((float)stat.ACL, 20f, 0f); }
public static HeroCostume PhotonDataToHeroCostume2(PhotonPlayer player) { HeroCostume costume = new HeroCostume(); SEX sex = IntToSex((int)player.CustomProperties[PhotonPlayerProperty.sex]); costume = new HeroCostume { sex = sex, costumeId = (int)player.CustomProperties[PhotonPlayerProperty.costumeId], id = (int)player.CustomProperties[PhotonPlayerProperty.heroCostumeId], cape = (bool)player.CustomProperties[PhotonPlayerProperty.cape], hairInfo = (sex != SEX.MALE) ? CostumeHair.hairsF[(int)player.CustomProperties[PhotonPlayerProperty.hairInfo]] : CostumeHair.hairsM[(int)player.CustomProperties[PhotonPlayerProperty.hairInfo]], eye_texture_id = (int)player.CustomProperties[PhotonPlayerProperty.eye_texture_id], beard_texture_id = (int)player.CustomProperties[PhotonPlayerProperty.beard_texture_id], glass_texture_id = (int)player.CustomProperties[PhotonPlayerProperty.glass_texture_id], skin_color = (int)player.CustomProperties[PhotonPlayerProperty.skin_color], hair_color = new Color((float)player.CustomProperties[PhotonPlayerProperty.hair_color1], (float)player.CustomProperties[PhotonPlayerProperty.hair_color2], (float)player.CustomProperties[PhotonPlayerProperty.hair_color3]), division = IntToDivision((int)player.CustomProperties[PhotonPlayerProperty.division]), stat = new HeroStat() }; costume.stat.SPD = (int)player.CustomProperties[PhotonPlayerProperty.statSPD]; costume.stat.GAS = (int)player.CustomProperties[PhotonPlayerProperty.statGAS]; costume.stat.BLA = (int)player.CustomProperties[PhotonPlayerProperty.statBLA]; costume.stat.ACL = (int)player.CustomProperties[PhotonPlayerProperty.statACL]; costume.stat.skillId = (string)player.CustomProperties[PhotonPlayerProperty.statSKILL]; if ((costume.costumeId == 0x19) && (costume.sex == SEX.FEMALE)) { costume.costumeId = 0x1a; } costume.setBodyByCostumeId(-1); costume.setMesh2(); costume.setTexture(); return(costume); }
private void onCharacterChange() { string selection = GetComponent <UIPopupList>().selection; HeroStat heroStat; switch (selection) { case "Set 1": case "Set 2": case "Set 3": { HeroCostume heroCostume = CostumeConverter.FromLocalData(selection.ToUpper()); heroStat = ((heroCostume != null) ? heroCostume.stat : new HeroStat()); break; } default: heroStat = HeroStat.GetInfo(GetComponent <UIPopupList>().selection); break; } SPD.transform.localScale = new Vector3(heroStat.Speed, 20f, 0f); GAS.transform.localScale = new Vector3(heroStat.Gas, 20f, 0f); BLA.transform.localScale = new Vector3(heroStat.Blade, 20f, 0f); ACL.transform.localScale = new Vector3(heroStat.Accel, 20f, 0f); }
private void Start() { HERO_SETUP component = base.gameObject.GetComponent <HERO_SETUP>(); HeroCostume.init2(); component.init(); component.myCostume = HeroCostume.costume[this.costumeId]; component.setCharacterComponent(); // this.mainCameraT = CacheGameObject.Find("MainCamera_Mono").transform; this.head = base.transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head"); this.cameraPref = base.transform.Find("Amarture/Controller_Body/hip/spine/chest/shoulder_R/upper_arm_R"); if (this.costumeId == 9) { this.cameraOffset = GameObject.Find("MainCamera_Mono").transform.position - this.cameraPref.position; ////GameObject gameObject = base.gameObject; ////GameObject gameObject2 = CacheGameObject.Find("MenuBackGround"); ////string[] array = new string[] ////{ //// "head", //// "hand_L", //// "hand_R", //// "chest", //// "spine", //// "MenuBackGround" ////}; ////foreach (Renderer renderer in gameObject2.GetComponentsInChildren<Renderer>()) ////{ //// GameObject gameObject3; //// if (renderer != null && renderer.enabled && !(gameObject3 = renderer.transform.parent.gameObject).name.EqualTo(false, array) && gameObject3 != gameObject) //// { //// UnityEngine.Object.DestroyImmediate(gameObject3, false); //// } ////} //this.mainCameraT.position = new Vector3(10.9f, 5841.2f, 3338.3f); //this.mainCameraT.rotation = new Quaternion(-0.4f, 0.3f, 0.1f, 0.9f); //ThunderPos = this.mainCameraT.position; //TitanDiePos = this.mainCameraT.position + Vector3.down * 15f + this.mainCameraT.right * 3.5f; ////Camera.main.GetComponent<Skybox>().material = new Material(FengGameManagerMKII.skinCache[4]["NIGHT"]); //return; } if (component.myCostume.sex == SEX.FEMALE) { base.animation.Play("stand"); base.animation["stand"].normalizedTime = UnityEngine.Random.Range((float)0f, (float)1f); } else { base.animation.Play("stand_levi"); base.animation["stand_levi"].normalizedTime = UnityEngine.Random.Range((float)0f, (float)1f); } float num = 0.5f; base.animation["stand"].speed = num; base.animation["stand_levi"].speed = num; // UnityEngine.Object.Destroy(base.gameObject); }
private void CopyCostume(HeroCostume from, HeroCostume to, bool init = false) { CopyBodyCostume(from, to); to.sex = from.sex; to.hair_mesh = from.hair_mesh; to.hair_1_mesh = from.hair_1_mesh; to.hair_color = new Color(from.hair_color.r, from.hair_color.g, from.hair_color.b); to.hairInfo = from.hairInfo; to.cape = from.cape; to.cape_mesh = from.cape_mesh; to.cape_texture = from.cape_texture; to.brand1_mesh = from.brand1_mesh; to.brand2_mesh = from.brand2_mesh; to.brand3_mesh = from.brand3_mesh; to.brand4_mesh = from.brand4_mesh; to.brand_texture = from.brand_texture; to._3dmg_texture = from._3dmg_texture; to.face_texture = from.face_texture; to.eye_mesh = from.eye_mesh; to.glass_mesh = from.glass_mesh; to.beard_mesh = from.beard_mesh; to.eye_texture_id = from.eye_texture_id; to.beard_texture_id = from.beard_texture_id; to.glass_texture_id = from.glass_texture_id; to.skin_color = from.skin_color; to.skin_texture = from.skin_texture; to.beard_texture_id = from.beard_texture_id; to.hand_l_mesh = from.hand_l_mesh; to.hand_r_mesh = from.hand_r_mesh; to.mesh_3dmg = from.mesh_3dmg; to.mesh_3dmg_gas_l = from.mesh_3dmg_gas_l; to.mesh_3dmg_gas_r = from.mesh_3dmg_gas_r; to.mesh_3dmg_belt = from.mesh_3dmg_belt; to.weapon_l_mesh = from.weapon_l_mesh; to.weapon_r_mesh = from.weapon_r_mesh; if (init) { to.stat = new HeroStat(); to.stat.Accel = 100; to.stat.Speed = 100; to.stat.Gas = 100; to.stat.Blade = 100; to.stat.SkillId = "mikasa"; } else { to.stat = new HeroStat(); to.stat.Accel = from.stat.Accel; to.stat.Speed = from.stat.Speed; to.stat.Gas = from.stat.Gas; to.stat.Blade = from.stat.Blade; to.stat.SkillId = from.stat.SkillId; } }
public void OnHairRChange(float value) { if (setup.myCostume != null && setup.part_hair != null) { HeroCostume myCostume = setup.myCostume; Color color = setup.part_hair.renderer.material.color; float g = color.g; Color color2 = setup.part_hair.renderer.material.color; myCostume.hair_color = new Color(value, g, color2.b); SetHairColor(); } }
public void OnHairBChange(float value) { if (setup != null && setup.myCostume != null && setup.part_hair != null) { HeroCostume myCostume = setup.myCostume; Color color = setup.part_hair.renderer.material.color; float r = color.r; Color color2 = setup.part_hair.renderer.material.color; myCostume.hair_color = new Color(r, color2.g, value); setHairColor(); } }
public static HeroCostume HeroToAHSS(string slot) { slot = slot.ToUpper(); HeroCostume costume = null; string str = slot.Substring(5).ToUpper(); int index = 0; while (index < HeroCostume.costume.Length) { if (HeroCostume.costume[index].name.ToUpper() != str) { index++; } else { int id = HeroCostume.costume[index].id; if (slot != "AHSS") { id += CheckBoxCostume.costumeSet - 1; } if (HeroCostume.costume[id].name != HeroCostume.costume[index].name) { id = HeroCostume.costume[index].id + 1; } costume = HeroCostume.costume[id]; break; } } if (costume == null) { return(HeroCostume.costume[0]); } HeroCostume costume3 = new HeroCostume { sex = costume.sex, id = HeroCostume.costume[0x25].costumeId, costumeId = HeroCostume.costume[0x25].costumeId, cape = costume.cape, hairInfo = costume.hairInfo, eye_texture_id = costume.eye_texture_id, beard_texture_id = costume.beard_texture_id, glass_texture_id = costume.glass_texture_id, skin_color = costume.skin_color, hair_color = costume.hair_color, division = costume.division, stat = costume.stat }; costume3.setBodyByCostumeId(-1); costume3.setMesh(); costume3.setTexture(); return(costume3); }
private void Awake() { CostumeHair.init(); CharacterMaterials.init(); HeroCostume.init(); this.hair_go_ref = new GameObject(); this.eye.transform.parent = base.transform.Find("Amarture/Core/Controller_Body/hip/spine/chest/neck/head").transform; this.hair_go_ref.transform.position = (Vector3)((this.eye.transform.position + (Vector3.up * 3.5f)) + (base.transform.forward * 5.2f)); this.hair_go_ref.transform.rotation = this.eye.transform.rotation; this.hair_go_ref.transform.RotateAround(this.eye.transform.position, base.transform.right, -20f); this.hair_go_ref.transform.localScale = new Vector3(210f, 210f, 210f); this.hair_go_ref.transform.parent = base.transform.Find("Amarture/Core/Controller_Body/hip/spine/chest/neck/head").transform; }
public void LoadData() { HeroCostume from = CostumeConeveter.LocalDataToHeroCostume(this.currentSlot); if (from != null) { this.copyCostume(from, this.setup.myCostume, false); this.setup.deleteCharacterComponent2(); this.setup.setCharacterComponent(); } this.CostumeDataToMyID(); this.freshLabel(); }
private void Awake() { CostumeHair.Init(); CharacterMaterials.InitData(); HeroCostume.Init(); hair_go_ref = new GameObject(); eye.transform.parent = base.transform.Find("Amarture/Core/Controller_Body/hip/spine/chest/neck/head").transform; hair_go_ref.transform.position = eye.transform.position + Vector3.up * 3.5f + base.transform.forward * 5.2f; hair_go_ref.transform.rotation = eye.transform.rotation; hair_go_ref.transform.RotateAround(eye.transform.position, base.transform.right, -20f); hair_go_ref.transform.localScale = new Vector3(210f, 210f, 210f); hair_go_ref.transform.parent = base.transform.Find("Amarture/Core/Controller_Body/hip/spine/chest/neck/head").transform; }
private void Start() { ChangeQuality.setCurrentQuality(); name = "MultiplayerManager"; DontDestroyOnLoad(this); HeroCostume.Init(); CharacterMaterials.Init(); RCManager.ClearAll(); heroes = new List <HERO>(); titans = new List <TITAN>(); hooks = new List <Bullet>(); AnarchyManager.DestroyMainScene(); }
public void LoadData() { HeroCostume heroCostume = CostumeConverter.FromLocalData(currentSlot); if (heroCostume != null) { copyCostume(heroCostume, setup.myCostume); setup.DeleteCharacterComponent(); setup.CreateCharacterComponent(); } CostumeDataToMyID(); freshLabel(); }
private void copyBodyCostume(HeroCostume from, HeroCostume to) { to.arm_l_mesh = from.arm_l_mesh; to.arm_r_mesh = from.arm_r_mesh; to.body_mesh = from.body_mesh; to.body_texture = from.body_texture; to.uniform_type = from.uniform_type; to.part_chest_1_object_mesh = from.part_chest_1_object_mesh; to.part_chest_1_object_texture = from.part_chest_1_object_texture; to.part_chest_object_mesh = from.part_chest_object_mesh; to.part_chest_object_texture = from.part_chest_object_texture; to.part_chest_skinned_cloth_mesh = from.part_chest_skinned_cloth_mesh; to.part_chest_skinned_cloth_texture = from.part_chest_skinned_cloth_texture; to.division = from.division; to.id = from.id; to.costumeId = from.costumeId; }
public static void HeroCostumeToLocalData(HeroCostume costume, string slot) { slot = slot.ToUpper(); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.sex, CostumeConeveter.SexToInt(costume.sex)); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.costumeId, costume.costumeId); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.heroCostumeId, costume.id); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.cape, (!costume.cape) ? 0 : 1); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.hairInfo, costume.hairInfo.id); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.eye_texture_id, costume.eye_texture_id); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.beard_texture_id, costume.beard_texture_id); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.glass_texture_id, costume.glass_texture_id); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.skin_color, costume.skin_color); PlayerPrefs.SetFloat(slot + PhotonPlayerProperty.hair_color1, costume.hair_color.r); PlayerPrefs.SetFloat(slot + PhotonPlayerProperty.hair_color2, costume.hair_color.g); PlayerPrefs.SetFloat(slot + PhotonPlayerProperty.hair_color3, costume.hair_color.b); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.division, CostumeConeveter.DivisionToInt(costume.division)); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.statSPD, costume.stat.Spd); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.statGAS, costume.stat.Gas); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.statBLA, costume.stat.Bla); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.statACL, costume.stat.Acl); PlayerPrefs.SetString(slot + PhotonPlayerProperty.statSKILL, costume.stat.skillID); }
public static void ToLocalData(HeroCostume costume, string slot) { slot = slot.ToUpper(); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.Sex, (int)costume.sex); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.CostumeId, costume.costumeId); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.HeroCostumeId, costume.id); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.Cape, costume.cape ? 1 : 0); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.HairInfo, costume.hairInfo.id); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.EyeTextureId, costume.eye_texture_id); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.BeardTextureId, costume.beard_texture_id); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.GlassTextureId, costume.glass_texture_id); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.SkinColor, costume.skin_color); PlayerPrefs.SetFloat(slot + PhotonPlayerProperty.HairColor1, costume.hair_color.r); PlayerPrefs.SetFloat(slot + PhotonPlayerProperty.HairColor2, costume.hair_color.g); PlayerPrefs.SetFloat(slot + PhotonPlayerProperty.HairColor3, costume.hair_color.b); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.Division, (int)costume.division); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.StatSpd, costume.stat.SPD); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.StatGas, costume.stat.GAS); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.StatBla, costume.stat.BLA); PlayerPrefs.SetInt(slot + PhotonPlayerProperty.StatAcl, costume.stat.ACL); PlayerPrefs.SetString(slot + PhotonPlayerProperty.StatSkill, costume.stat.skillId); }
public static void HeroCostumeToLocalData(HeroCostume costume, string slot) { slot = slot.ToUpper(); PlayerPrefs.SetInt(slot + PlayerProperty.Sex, (int)costume.sex); PlayerPrefs.SetInt(slot + PlayerProperty.CostumeID, costume.costumeId); PlayerPrefs.SetInt(slot + PlayerProperty.HeroCostumeID, costume.id); PlayerPrefs.SetInt(slot + PlayerProperty.HasCape, !costume.cape ? 0 : 1); PlayerPrefs.SetInt(slot + PlayerProperty.HairInfo, costume.hairInfo.ID); PlayerPrefs.SetInt(slot + PlayerProperty.EyeTextureID, costume.eye_texture_id); PlayerPrefs.SetInt(slot + PlayerProperty.BeardTextureId, costume.beard_texture_id); PlayerPrefs.SetInt(slot + PlayerProperty.GlassTextureID, costume.glass_texture_id); PlayerPrefs.SetInt(slot + PlayerProperty.SkinColor, costume.skin_color); PlayerPrefs.SetFloat(slot + PlayerProperty.HairColorR, costume.hair_color.r); PlayerPrefs.SetFloat(slot + PlayerProperty.HairColorG, costume.hair_color.g); PlayerPrefs.SetFloat(slot + PlayerProperty.HairColorB, costume.hair_color.b); PlayerPrefs.SetInt(slot + PlayerProperty.Division, (int)costume.division); PlayerPrefs.SetInt(slot + PlayerProperty.Speed, costume.stat.Speed); PlayerPrefs.SetInt(slot + PlayerProperty.Gas, costume.stat.Gas); PlayerPrefs.SetInt(slot + PlayerProperty.Blade, costume.stat.Blade); PlayerPrefs.SetInt(slot + PlayerProperty.Acceleration, costume.stat.Acceleration); PlayerPrefs.SetString(slot + PlayerProperty.Skill, costume.stat.SkillName); }
private void updateCostume(int id) { IN_GAME_MAIN_CAMERA component = GameObject.Find("MainCamera").GetComponent <IN_GAME_MAIN_CAMERA>(); HeroCostume costume2 = CostumeConeveter.LocalDataToHeroCostume("SET " + id); component.main_object.GetComponent <HERO>().GetComponent <HERO_SETUP>().init(); if (costume2 != null) { component.main_object.GetComponent <HERO>().GetComponent <HERO_SETUP>().myCostume = costume2; component.main_object.GetComponent <HERO>().GetComponent <HERO_SETUP>().myCostume.stat = costume2.stat; } else { costume2 = HeroCostume.costumeOption[3]; component.main_object.GetComponent <HERO>().GetComponent <HERO_SETUP>().myCostume = costume2; component.main_object.GetComponent <HERO>().GetComponent <HERO_SETUP>().myCostume.stat = HeroStat.getInfo(costume2.name.ToUpper()); } component.main_object.GetComponent <HERO>().GetComponent <HERO_SETUP>().setCharacterComponent(); component.main_object.GetComponent <HERO>().setStat(); component.main_object.GetComponent <HERO>().setSkillHUDPosition(); }
public static void ToPhotonData(HeroCostume costume, PhotonPlayer player) { Hashtable properties = new Hashtable(); properties.Add(PhotonPlayerProperty.Sex, (int)costume.sex); properties.Add(PhotonPlayerProperty.CostumeId, costume.costumeId); properties.Add(PhotonPlayerProperty.HeroCostumeId, costume.id); properties.Add(PhotonPlayerProperty.Cape, costume.cape); properties.Add(PhotonPlayerProperty.HairInfo, costume.hairInfo.id); properties.Add(PhotonPlayerProperty.EyeTextureId, costume.eye_texture_id); properties.Add(PhotonPlayerProperty.BeardTextureId, costume.beard_texture_id); properties.Add(PhotonPlayerProperty.GlassTextureId, costume.glass_texture_id); properties.Add(PhotonPlayerProperty.SkinColor, costume.skin_color); properties.Add(PhotonPlayerProperty.HairColor1, costume.hair_color.r); properties.Add(PhotonPlayerProperty.HairColor2, costume.hair_color.g); properties.Add(PhotonPlayerProperty.HairColor3, costume.hair_color.b); properties.Add(PhotonPlayerProperty.Division, (int)costume.division); properties.Add(PhotonPlayerProperty.StatSpd, costume.stat.SPD); properties.Add(PhotonPlayerProperty.StatGas, costume.stat.GAS); properties.Add(PhotonPlayerProperty.StatBla, costume.stat.BLA); properties.Add(PhotonPlayerProperty.StatAcl, costume.stat.ACL); properties.Add(PhotonPlayerProperty.StatSkill, costume.stat.skillId); player.SetCustomProperties(properties); }
public static HeroCostume FromLocalData(string slot) { slot = slot.ToUpper(); if (!PlayerPrefs.HasKey(slot + PhotonPlayerProperty.Sex)) { return(HeroCostume.Costumes[0]); } // Costume Info HeroCostume costume = new HeroCostume(); costume.sex = (Sex)PlayerPrefs.GetInt(slot + PhotonPlayerProperty.Sex); costume.id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.HeroCostumeId); costume.costumeId = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.CostumeId); costume.cape = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.Cape) == 1; costume.hairInfo = ((costume.sex != Sex.Male) ? CostumeHair.FemaleHairs[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.HairInfo)] : CostumeHair.MaleHairs[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.HairInfo)]); costume.eye_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.EyeTextureId); costume.beard_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.BeardTextureId); costume.glass_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.GlassTextureId); costume.skin_color = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.SkinColor); costume.hair_color = new Color(PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.HairColor1), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.HairColor2), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.HairColor3)); costume.division = (Division)PlayerPrefs.GetInt(slot + PhotonPlayerProperty.Division); // Stats costume.stat = new HeroStat(); costume.stat.Speed = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.StatSpeed); costume.stat.Gas = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.StatGas); costume.stat.Blade = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.StatBlade); costume.stat.Accel = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.StatAccel); costume.stat.SkillId = PlayerPrefs.GetString(slot + PhotonPlayerProperty.StatSkill); costume.setBodyByCostumeId(); costume.SetMesh(); costume.setTexture(); return(costume); }
public static void HeroCostumeToPhotonData(HeroCostume costume, PhotonPlayer player) { player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.sex, CostumeConeveter.SexToInt(costume.sex) } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.costumeId, costume.costumeId } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.heroCostumeId, costume.id } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.cape, costume.cape } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.hairInfo, costume.hairInfo.id } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.eye_texture_id, costume.eye_texture_id } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.beard_texture_id, costume.beard_texture_id } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.glass_texture_id, costume.glass_texture_id } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.skin_color, costume.skin_color } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.hair_color1, costume.hair_color.r } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.hair_color2, costume.hair_color.g } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.hair_color3, costume.hair_color.b } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.division, CostumeConeveter.DivisionToInt(costume.division) } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.statSPD, costume.stat.Spd } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.statGAS, costume.stat.Gas } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.statBLA, costume.stat.Bla } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.statACL, costume.stat.Acl } }); player.SetCustomProperties(new Hashtable { { PhotonPlayerProperty.statSKILL, costume.stat.skillID } }); }
void OnGUI() { GUI.backgroundColor = INC.gui_color; GUILayout.BeginArea(new Rect(0, 0, 300, Screen.height)); GUILayout.BeginVertical(GUI.skin.box); int ist = isTitan; isTitan = GUILayout.SelectionGrid(isTitan, new string[] { "HUMAN", id }, 2); if (ist != isTitan) { if (!LevelInfo.getInfo(FengGameManagerMKII.level).teamTitan) { isTitan = 0; } } if (isTitan == 0) { GUIStyle style = new GUIStyle(GUI.skin.button); foreach (var stats in HeroStat.stats) { if (stats.Key != "CUSTOM_DEFAULT") { if (stat != null) { if (stat.name == stats.Key) { style.normal = GUI.skin.button.active; } else { style.normal = GUI.skin.button.normal; } } if (GUILayout.Button(stats.Key, style)) { IN_GAME_MAIN_CAMERA.singleCharacter = stats.Key; if (((stats.Key != "Set 1") && (stats.Key != "Set 2")) && (stats.Key != "Set 3")) { stat = HeroStat.getInfo(stats.Key); } else { HeroCostume costume = CostumeConeveter.LocalDataToHeroCostume(stats.Key); if (costume == null) { stat = new HeroStat(); } else { stat = costume.stat; } } if (PanelEnterGame.instance != null) { PanelEnterGame.instance.to_InfoHero(stat); } stat.name = stats.Key; } } } if (stat != null) { GUILayout.Label(stat.name); GUILayout.BeginHorizontal(); GUILayout.Label("SPD:" + stat.SPD); GUILayout.Label("ACL:" + stat.ACL); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("BLA:" + stat.BLA); GUILayout.Label("GAS:" + stat.GAS); GUILayout.EndHorizontal(); } string[] cos = new string[] { "Cos 1", "Cos 2", "Cos 3" }; GUILayout.BeginHorizontal(); GUIStyle style3 = new GUIStyle(GUI.skin.button); for (int s = 0; s < cos.Length; s++) { string de = cos[s]; if (CheckBoxCostume.costumeSet - 1 == s) { style3.normal = GUI.skin.button.active; } else { style3.normal = GUI.skin.button.normal; } if (GUILayout.Button(de, style3)) { CheckBoxCostume.costumeSet = s + 1; } } GUILayout.EndHorizontal(); } GUILayout.Label(CyanMod.INC.la("camera_type")); IN_GAME_MAIN_CAMERA.cameraMode = (CAMERA_TYPE)GUILayout.SelectionGrid((int)IN_GAME_MAIN_CAMERA.cameraMode, CameraType, 4); if (GUILayout.Button(INC.la("lets_go"))) { if (isTitan == 0) { string selection = stat.name; NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[0], true); FengGameManagerMKII.instance.needChooseSide = false; if (IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.PVP_CAPTURE) { FengGameManagerMKII.instance.checkpoint = CyanMod.CachingsGM.Find("PVPchkPtH"); } if (!PhotonNetwork.isMasterClient && (FengGameManagerMKII.instance.roundTime > 60f)) { if (FengGameManagerMKII.instance.heroes.Count != 0) { FengGameManagerMKII.instance.NOTSpawnPlayer(selection); } else { FengGameManagerMKII.instance.NOTSpawnPlayer(selection); FengGameManagerMKII.instance.photonView.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]); } } else if (((IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.BOSS_FIGHT_CT) || (IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.TROST)) || (IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.PVP_CAPTURE)) { if (FengGameManagerMKII.instance.heroes.Count != 0) { FengGameManagerMKII.instance.NOTSpawnPlayer(selection); FengGameManagerMKII.instance.photonView.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]); } else { FengGameManagerMKII.instance.SpawnPlayer(selection, "playerRespawn"); } } else { FengGameManagerMKII.instance.SpawnPlayer(selection, "playerRespawn"); } NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[1], false); NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[2], false); instance.enabled = false; IN_GAME_MAIN_CAMERA.usingTitan = false; IN_GAME_MAIN_CAMERA.instance.setHUDposition(); PhotonNetwork.player.character = selection; } else { if (IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.PVP_AHSS) { id = "AHSS"; NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[0], true); FengGameManagerMKII.instance.needChooseSide = false; if (!PhotonNetwork.isMasterClient && (FengGameManagerMKII.instance.roundTime > 60f)) { FengGameManagerMKII.instance.NOTSpawnPlayer(id); FengGameManagerMKII.instance.photonView.RPC("restartGameByClient", PhotonTargets.MasterClient, new object[0]); } else { FengGameManagerMKII.instance.SpawnPlayer(id, "playerRespawn2"); } NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[1], false); NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[2], false); instance.enabled = false; IN_GAME_MAIN_CAMERA.usingTitan = false; IN_GAME_MAIN_CAMERA.instance.setHUDposition(); PhotonNetwork.player.character = id; } else { if (IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.PVP_CAPTURE) { FengGameManagerMKII.instance.checkpoint = CyanMod.CachingsGM.Find("PVPchkPtT"); } string selection = "RANDOM"; NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[0], true); if ((!PhotonNetwork.isMasterClient && (FengGameManagerMKII.instance.roundTime > 60f)) || FengGameManagerMKII.instance.justSuicide) { FengGameManagerMKII.instance.justSuicide = false; FengGameManagerMKII.instance.NOTSpawnNonAITitan(selection); } else { FengGameManagerMKII.instance.SpawnNonAITitan2(selection, "titanRespawn"); } FengGameManagerMKII.instance.needChooseSide = false; NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[1], false); NGUITools.SetActive(FengGameManagerMKII.instance.uiT.panels[2], false); instance.enabled = false; IN_GAME_MAIN_CAMERA.usingTitan = true; IN_GAME_MAIN_CAMERA.instance.setHUDposition(); } } FengGameManagerMKII.instance.saves(); } GUILayout.EndVertical(); GUILayout.EndArea(); }