private void New(VCESceneSetting setting) { m_Setting = setting; m_IsoData = new VCIsoData(); m_IsoData.Init(VCIsoData.ISO_VERSION, setting, new VCIsoOption(true)); m_IsoData.m_HeadInfo.Category = setting.m_Category; m_Stencil = new VCIsoData(); m_Stencil.Init(VCIsoData.ISO_VERSION, setting, new VCIsoOption(true)); m_TempIsoMat.Init(); m_DocumentPath = VCConfig.s_Categories[setting.m_Category].m_DefaultPath + "/Untitled" + VCConfig.s_IsoFileExt; int i = 2; while (File.Exists(VCConfig.s_IsoPath + m_DocumentPath)) { m_DocumentPath = VCConfig.s_Categories[setting.m_Category].m_DefaultPath + "/Untitled (" + i.ToString() + ")" + VCConfig.s_IsoFileExt; ++i; } VCEditor.Instance.m_MeshMgr.m_ColorMap = m_IsoData.m_Colors; m_MeshComputer = new VCMCComputer(); m_MeshComputer.Init(m_Setting.m_EditorSize, VCEditor.Instance.m_MeshMgr); m_CreationAttr = new CreationAttr(); #if false this.GenSomeVoxelForTest(); #endif }
public void RefreshCostList() { ClearItems(); CreationAttr attr = null; attr = m_IsEditor ? VCEditor.s_Scene.m_CreationAttr : m_NonEditorAttr; if (attr != null) { foreach (KeyValuePair <int, int> kvp in attr.m_Cost) { if (kvp.Value == 0) { continue; } GameObject item_go = GameObject.Instantiate(m_ItemRes) as GameObject; Vector3 scale = item_go.transform.localScale; item_go.name = kvp.Key.ToString(); item_go.transform.parent = m_ItemGroup.transform; item_go.transform.localPosition = Vector3.zero; item_go.transform.localScale = scale; VCEUICostItem item = item_go.GetComponent <VCEUICostItem>(); item.m_GameItemId = kvp.Key; item.m_GameItemCost = kvp.Value; m_AssetItems.Add(item_go); } } RepositionGrid(); }
public VCEScene(string iso_path) { m_IsoData = new VCIsoData(); if (!LoadIso(iso_path)) { Destroy(); throw new Exception("Load ISO error"); } VCESceneSetting isosetting = m_IsoData.m_HeadInfo.FindSceneSetting(); if (isosetting != null) { m_Setting = isosetting; m_Stencil = new VCIsoData(); m_Stencil.Init(VCIsoData.ISO_VERSION, m_Setting, new VCIsoOption(true)); m_TempIsoMat.Init(); m_DocumentPath = iso_path; VCEditor.Instance.m_MeshMgr.m_ColorMap = m_IsoData.m_Colors; m_MeshComputer = new VCMCComputer(); m_MeshComputer.Init(m_Setting.m_EditorSize, VCEditor.Instance.m_MeshMgr); m_CreationAttr = new CreationAttr(); } else { Destroy(); throw new Exception("Scene setting error"); } }
private static ItemProto GenItemData(VCIsoHeadData headData, int objId) { CreationAttr attribute = GetCreationAttr(headData.Remarks); // 0.9 id修改 转换检测 attribute.CheckCostId(); ItemProto item = CreationData.StaticGenItemData(objId, headData, attribute); return(item); }
// Destruction public void Destroy() { m_ObjectID = 0; m_Resource = null; m_RandomSeed = 0; m_HashCode = (ulong)(0); if (m_IsoData != null) { m_IsoData.Destroy(); m_IsoData = null; } m_Attribute = null; DestroyPrefab(); }
void UpdateItemsTrackState(CreationAttr attr) { if (ckItemTrack) { _curAttr = attr; string isoName = VCEditor.s_Scene.m_IsoData.m_HeadInfo.Name; bool show = !string.IsNullOrEmpty(isoName) && _curAttr != null && GameUI.Instance && GameUI.Instance.mItemsTrackWnd; ckItemTrack.gameObject.SetActive(show); if (show) { ckItemTrack.isChecked = GameUI.Instance.mItemsTrackWnd.ContainsIso(isoName); } } }
public override void Awake() { base.Awake(); var cc = GetComponent <CreationController>(); if (cc != null) { m_CreationData = cc.creationData; if (m_CreationData != null) { m_IsoData = m_CreationData.m_IsoData; m_SceneSetting = m_IsoData.m_HeadInfo.FindSceneSetting(); m_Attribute = m_CreationData.m_Attribute; m_MassCenter = m_Attribute.m_CenterOfMass; } } }
public VCEScene(VCESceneSetting setting, int template) { TextAsset asset = Resources.Load <TextAsset>("Isos/" + setting.m_Id.ToString() + "/" + template.ToString()); if (asset == null) { New(setting); return; } m_IsoData = new VCIsoData(); if (!m_IsoData.Import(asset.bytes, new VCIsoOption(true))) { Destroy(); throw new Exception("Load Template ISO error"); } VCESceneSetting isosetting = m_IsoData.m_HeadInfo.FindSceneSetting(); if (isosetting != null) { m_Setting = isosetting; m_Stencil = new VCIsoData(); m_Stencil.Init(VCIsoData.ISO_VERSION, m_Setting, new VCIsoOption(true)); m_TempIsoMat.Init(); m_DocumentPath = VCConfig.s_Categories[setting.m_Category].m_DefaultPath + "/Untitled" + VCConfig.s_IsoFileExt; int i = 2; while (File.Exists(VCConfig.s_IsoPath + m_DocumentPath)) { m_DocumentPath = VCConfig.s_Categories[setting.m_Category].m_DefaultPath + "/Untitled (" + i.ToString() + ")" + VCConfig.s_IsoFileExt; ++i; } VCEditor.Instance.m_MeshMgr.m_ColorMap = m_IsoData.m_Colors; m_MeshComputer = new VCMCComputer(); m_MeshComputer.Init(m_Setting.m_EditorSize, VCEditor.Instance.m_MeshMgr); m_CreationAttr = new CreationAttr(); } else { Destroy(); throw new Exception("Scene setting error"); } }
public static CreationAttr GetCreationAttr(string xml) { CreationAttr attribute = new CreationAttr(); try { XmlDocument xmldoc = new XmlDocument(); xmldoc.LoadXml(xml); XmlNode attr_node = xmldoc.DocumentElement["ATTR"]; XmlNode common_node = attr_node["COMMON"]; XmlNode prop_node = attr_node["PROP"]; attribute.m_Type = (ECreation)(XmlConvert.ToInt32(common_node.Attributes["type"].Value)); attribute.m_Volume = XmlConvert.ToSingle(common_node.Attributes["vol"].Value); attribute.m_Weight = XmlConvert.ToSingle(common_node.Attributes["weight"].Value); attribute.m_Durability = XmlConvert.ToSingle(common_node.Attributes["dur"].Value); attribute.m_SellPrice = XmlConvert.ToSingle(common_node.Attributes["sp"].Value); attribute.m_Attack = XmlConvert.ToSingle(prop_node.Attributes["atk"].Value); attribute.m_Defense = XmlConvert.ToSingle(prop_node.Attributes["def"].Value); attribute.m_MuzzleAtkInc = XmlConvert.ToSingle(prop_node.Attributes["inc"].Value); attribute.m_FireSpeed = XmlConvert.ToSingle(prop_node.Attributes["fs"].Value); attribute.m_Accuracy = XmlConvert.ToSingle(prop_node.Attributes["acc"].Value); attribute.m_DragCoef = XmlConvert.ToSingle(prop_node.Attributes["dc"].Value); attribute.m_MaxFuel = XmlConvert.ToSingle(prop_node.Attributes["fuel"].Value); foreach (XmlNode node in common_node.ChildNodes) { int id = XmlConvert.ToInt32(node.Attributes["id"].Value); int cnt = XmlConvert.ToInt32(node.Attributes["cnt"].Value); attribute.m_Cost.Add(id, cnt); } return(attribute); } catch (Exception e) { LogManager.Warning(e); attribute.m_Errors.Add("error"); return(attribute); } }
public static ItemProto StaticGenItemData(int obj_id, VCIsoHeadData headinfo, CreationAttr attr) { if (attr.m_Type == ECreation.Null) { return(null); } ItemProto item = new ItemProto(); item.name = headinfo.Name; // item.nameStringId = 0; item.englishDescription = headinfo.Desc; item.itemLabel = 100; item.setUp = 0; item.resourcePath = AssetsLoader.InvalidAssetPath; item.resourcePath1 = AssetsLoader.InvalidAssetPath; item.equipReplacePos = 0; item.currencyValue = Mathf.CeilToInt(attr.m_SellPrice); item.currencyValue2 = Mathf.CeilToInt(attr.m_SellPrice); item.durabilityMax = Mathf.CeilToInt(attr.m_Durability); item.repairLevel = 1; item.maxStackNum = 1; item.equipSex = Pathea.PeSex.Undefined; item.id = obj_id; item.level = 1; item.repairMaterialList = new List <MaterialItem>(attr.m_Cost.Count); item.strengthenMaterialList = new List <MaterialItem>(attr.m_Cost.Count); Dictionary <int, int> repairItemDic = new Dictionary <int, int>(); foreach (KeyValuePair <int, int> kvp in attr.m_Cost) { if (kvp.Value != 0) { Replicator.Formula formula = Replicator.Formula.Mgr.Instance.FindByProductId(kvp.Key); int itemID = kvp.Key; int itemCount = kvp.Value; if (null == formula) { if (repairItemDic.ContainsKey(itemID)) { repairItemDic[itemID] += itemCount; } else { repairItemDic[itemID] = itemCount; } } else { for (int i = 0; i < formula.materials.Count; ++i) { itemID = formula.materials[i].itemId; itemCount = formula.materials[i].itemCount * Mathf.CeilToInt((float)kvp.Value / formula.m_productItemCount); if (repairItemDic.ContainsKey(itemID)) { repairItemDic[itemID] += itemCount; } else { repairItemDic[itemID] = itemCount; } } } } } foreach (KeyValuePair <int, int> kvp in repairItemDic) { int finalCount = kvp.Value / 2; if (finalCount > 0) { item.repairMaterialList.Add(new MaterialItem() { protoId = kvp.Key, count = finalCount }); item.strengthenMaterialList.Add(new MaterialItem() { protoId = kvp.Key, count = finalCount }); } } // [VCCase] - Generate item data, different types of creations switch (attr.m_Type) { // 剑 ------------------------ case ECreation.Sword: item.equipType = EquipType.Sword; item.icon = new string[3] { "0", "0", "0" }; item.equipPos = 16; item.itemClassId = (int)CreationItemClass.Sword; item.tabIndex = 1; item.sortLabel = 9910; //item.level = Mathf.Clamp((int)((attr.m_Attack - 8f) / 2.5f), 1, 100); item.durabilityFactor = 1f; item.editorTypeId = 4; if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.Atk, attr.m_Attack); item.buffId = 30200087; break; //双手与双持 case ECreation.SwordLarge: case ECreation.SwordDouble: item.icon = new string[3] { "0", "0", "0" }; item.equipPos = 528; item.itemClassId = (int)CreationItemClass.Sword; item.tabIndex = 1; item.sortLabel = 9910; //item.level = Mathf.Clamp((int)((attr.m_Attack - 8f) / 2.5f), 1, 100); item.durabilityFactor = 1f; item.editorTypeId = 4; if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.Atk, attr.m_Attack); item.buffId = 30200087; break; // 弓 ------------------------ case ECreation.Bow: item.equipType = EquipType.Bow; item.icon = new string[3] { "0", "0", "0" }; item.equipPos = 528; item.itemClassId = (int)CreationItemClass.Bow; item.tabIndex = 1; item.sortLabel = 9914; //item.level = Mathf.Clamp((int)((attr.m_Attack - 8f) / 2.5f), 1, 100); item.durabilityFactor = 1f; item.editorTypeId = 10; if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.Atk, attr.m_Attack); item.buffId = 30200087; break; // 斧 ------------------------ case ECreation.Axe: item.equipType = EquipType.Axe; item.icon = new string[3] { "0", "0", "0" }; item.equipPos = 16; item.itemClassId = (int)CreationItemClass.Axe; item.tabIndex = 1; item.sortLabel = 9912; //item.level = Mathf.Clamp((int)((attr.m_Attack - 8f) / 2.5f), 1, 100); item.durabilityFactor = 1f; item.editorTypeId = 7; if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.Atk, attr.m_Attack * WhiteCat.PEVCConfig.instance.axeAttackScale); item.propertyList.AddProperty(Pathea.AttribType.CutDamage, attr.m_Attack * WhiteCat.PEVCConfig.instance.axeCutDamageScale); item.propertyList.AddProperty(Pathea.AttribType.CutBouns, 0.03f); item.buffId = 30200092; break; // 盾 ------------------------ case ECreation.Shield: item.equipType = EquipType.Shield_Hand; item.icon = new string[3] { "0", "0", "0" }; item.equipPos = 512; item.itemClassId = (int)CreationItemClass.Shield; item.tabIndex = 1; item.sortLabel = 9920; //item.level = Mathf.Clamp((int)((attr.m_Defense + 2f) / 2f), 1, 100); item.durabilityFactor = 0.01f; item.editorTypeId = 9; if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.Def, attr.m_Defense); item.propertyList.AddProperty(Pathea.AttribType.ShieldMeleeProtect, Mathf.Clamp(attr.m_Defense / 330 + 0.2f, 0.2f, 0.87f)); item.buffId = 30200093; break; // 手枪/单手枪 ------------------------ case ECreation.HandGun: item.equipType = EquipType.HandGun; item.icon = new string[3] { "0", "0", "0" }; item.equipPos = 528; item.itemClassId = (int)CreationItemClass.HandGun; item.tabIndex = 1; item.sortLabel = 9930; //item.level = Mathf.Clamp((int)((attr.m_Attack - 4f) / 2f), 1, 70); item.durabilityFactor = 1f; if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.Atk, attr.m_Attack); item.buffId = 30200095; item.editorTypeId = 11; break; // 步枪/双手枪 ------------------------ case ECreation.Rifle: item.equipType = EquipType.Rifle; item.icon = new string[3] { "0", "0", "0" }; item.equipPos = 528; item.itemClassId = (int)CreationItemClass.Rifle; item.tabIndex = 1; item.sortLabel = 9940; //item.level = Mathf.Clamp((int)((attr.m_Attack - 4f) / 2f), 1, 70); item.durabilityFactor = 1f; if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.Atk, attr.m_Attack); item.buffId = 30200095; item.editorTypeId = 11; break; // 车 ------------------------ case ECreation.Vehicle: item.equipType = EquipType.Null; item.icon = new string[3] { "0", "leftup_putdown", "0" }; item.equipPos = 0; item.itemClassId = (int)CreationItemClass.Vehicle; item.tabIndex = 0; item.sortLabel = 9950; //item.level = CalcCarrierLevel(attr.m_Durability); if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.HpMax, attr.m_Durability); item.propertyList.AddProperty(Pathea.AttribType.Hp, attr.m_Durability); item.engergyMax = (int)attr.m_MaxFuel; break; // 飞机 ------------------------ case ECreation.Aircraft: item.equipType = EquipType.Null; item.icon = new string[3] { "0", "leftup_putdown", "0" }; item.equipPos = 0; item.itemClassId = (int)CreationItemClass.Aircraft; item.tabIndex = 0; item.sortLabel = 9960; //item.level = CalcCarrierLevel(attr.m_Durability); if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.HpMax, attr.m_Durability); item.propertyList.AddProperty(Pathea.AttribType.Hp, attr.m_Durability); item.engergyMax = (int)attr.m_MaxFuel; break; // 船 ------------------------ case ECreation.Boat: item.equipType = EquipType.Null; item.icon = new string[3] { "0", "leftup_putdown", "0" }; item.equipPos = 0; item.itemClassId = (int)CreationItemClass.Boat; item.tabIndex = 0; item.sortLabel = 9970; //item.level = CalcCarrierLevel(attr.m_Durability); if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.HpMax, attr.m_Durability); item.propertyList.AddProperty(Pathea.AttribType.Hp, attr.m_Durability); item.engergyMax = (int)attr.m_MaxFuel; break; // 简单物体 ------------------------ case ECreation.SimpleObject: item.equipType = EquipType.Null; item.icon = new string[3] { "0", "leftup_putdown", "0" }; item.equipPos = 0; item.itemClassId = (int)CreationItemClass.SimpleObject; item.sortLabel = 9980; item.tabIndex = 0; if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.HpMax, attr.m_Durability); item.propertyList.AddProperty(Pathea.AttribType.Hp, attr.m_Durability); break; // 装甲 ------------------------ case ECreation.ArmorHead: case ECreation.ArmorBody: case ECreation.ArmorArmAndLeg: case ECreation.ArmorHandAndFoot: case ECreation.ArmorDecoration: item.equipType = EquipType.Null; item.icon = new string[3] { "0", "0", "0" }; item.equipPos = 0; item.itemClassId = (int)CreationItemClass.Armor; item.sortLabel = 9990 + (int)attr.m_Type; item.tabIndex = 3; item.durabilityFactor = 0.01f; break; // 机器人 ------------------------ case ECreation.Robot: item.equipType = EquipType.Null; item.icon = new string[3] { "0", "leftup_putdown", "0" }; item.equipPos = 0; item.itemClassId = (int)CreationItemClass.Robot; item.tabIndex = 0; item.sortLabel = 9945; if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.HpMax, attr.m_Durability); item.propertyList.AddProperty(Pathea.AttribType.Hp, attr.m_Durability); item.engergyMax = (int)attr.m_MaxFuel; break; // 炮台 ------------------------ case ECreation.AITurret: item.equipType = EquipType.Null; item.icon = new string[3] { "0", "leftup_putdown", "0" }; item.equipPos = 0; item.itemClassId = (int)CreationItemClass.AITurret; item.tabIndex = 0; item.sortLabel = 9946; if (item.propertyList == null) { item.propertyList = new ItemProto.PropertyList(); } item.propertyList.AddProperty(Pathea.AttribType.HpMax, attr.m_Durability); item.propertyList.AddProperty(Pathea.AttribType.Hp, attr.m_Durability); item.engergyMax = (int)attr.m_MaxFuel; item.unchargeable = attr.m_Defense < 0.5f; break; default: item.equipType = EquipType.Null; item.icon = new string[3] { "0", "0", "0" }; item.equipPos = 0; item.sortLabel = 10000; item.tabIndex = 0; break; } return(item); }
public VCIsoRemark() { m_Attribute = new CreationAttr(); m_Error = ""; }
public void OnCreationInfoRefresh() { CreationAttr attr = null; if (m_IsEditor) { CreationData.CalcCreationAttr(VCEditor.s_Scene.m_IsoData, 0, ref VCEditor.s_Scene.m_CreationAttr); attr = VCEditor.s_Scene.m_CreationAttr; } else { VCIsoRemark remark = new VCIsoRemark(); remark.xml = m_NonEditorRemark; attr = remark.m_Attribute; // 0.9 ID改变处理 if (attr != null) { attr.CheckCostId(); } m_CostList.m_NonEditorAttr = attr; if (remark.m_Error != null && remark.m_Error.Length > 1) { m_NonEditorError = "ISO version is obsolete".ToLocalizationString(); } else { m_NonEditorError = ""; } } UpdateItemsTrackState(attr); if (attr != null) { // 上面是否调用了 CalcCreationAttr ? 为什么属性会不同??? // [VCCase] - Creation attribute info. UI if (attr.m_Type == ECreation.Sword || attr.m_Type == ECreation.SwordLarge || attr.m_Type == ECreation.SwordDouble || attr.m_Type == ECreation.Axe) { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + //"Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n\r\n" + "Attack".ToLocalizationString() + ":\r\n" + "Durability".ToLocalizationString() + ":\r\n\r\n"; m_AttrValues.text = (attr.m_Type == ECreation.Sword || attr.m_Type == ECreation.SwordLarge || attr.m_Type == ECreation.SwordDouble? "Sword".ToLocalizationString() + "\r\n" : "Axe".ToLocalizationString() + "\r\n") + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + //VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + " " + "Meat".ToLocalizationString() + "\r\n\r\n" + (attr.m_Attack).ToString("0.0") + "\r\n" + (Mathf.CeilToInt(attr.m_Durability * WhiteCat.PEVCConfig.equipDurabilityShowScale)).ToString("0.0") + "\r\n"; } else if (attr.m_Type == ECreation.Bow) { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + "Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n\r\n" + "Attack".ToLocalizationString() + ":\r\n" + "Durability".ToLocalizationString() + ":\r\n\r\n"; m_AttrValues.text = "Bow".ToLocalizationString() + "\r\n" + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + #if PLANET_EXPLORERS " " + "Meat".ToLocalizationString() + #endif "\r\n\r\n" + (attr.m_Attack).ToString("0.0") + "\r\n" + (Mathf.CeilToInt(attr.m_Durability * WhiteCat.PEVCConfig.equipDurabilityShowScale)).ToString("0.0") + "\r\n"; } else if (attr.m_Type == ECreation.Shield) { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + "Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n\r\n" + "Defense".ToLocalizationString() + ":\r\n" + "Durability".ToLocalizationString() + ":\r\n\r\n"; m_AttrValues.text = "Shield".ToLocalizationString() + "\r\n" + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + #if PLANET_EXPLORERS " " + "Meat".ToLocalizationString() + #endif "\r\n\r\n" + (attr.m_Defense).ToString("0.0") + "\r\n" + (Mathf.CeilToInt(attr.m_Durability * WhiteCat.PEVCConfig.equipDurabilityShowScale)).ToString("0.0") + "\r\n"; } else if (attr.m_Type == ECreation.HandGun || attr.m_Type == ECreation.Rifle) { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + "Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n\r\n" + "Increase".ToLocalizationString() + ":\r\n" + "Final Attack".ToLocalizationString() + ":\r\n" + "Firing Rate".ToLocalizationString() + ":\r\n" + "Accuracy".ToLocalizationString() + ":\r\n" + "Durability".ToLocalizationString() + ":\r\n\r\n"; m_AttrValues.text = ((attr.m_Type == ECreation.HandGun) ? ("Hand Gun".ToLocalizationString() + "\r\n") : ("Rifle".ToLocalizationString() + "\r\n")) + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + #if PLANET_EXPLORERS " " + "Meat".ToLocalizationString() + #endif "\r\n\r\n" + ((attr.m_MuzzleAtkInc == 0) ? ("-") : (attr.m_MuzzleAtkInc * 100.0f - 100.0f).ToString("0.0")) + " %\r\n" + (attr.m_Attack).ToString("0.0") + "\r\n" + (attr.m_FireSpeed).ToString("0.0") + "\r\n" + (1.0f / attr.m_Accuracy * 100).ToString("0.0") + " %\r\n" + (Mathf.CeilToInt(attr.m_Durability * WhiteCat.PEVCConfig.equipDurabilityShowScale)).ToString("0.0") + "\r\n"; } else if (attr.m_Type == ECreation.Vehicle) { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + "Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n\r\n" + "Attack".ToLocalizationString() + ":\r\n" + "Durability".ToLocalizationString() + ":\r\n" + "Fuel".ToLocalizationString() + ":\r\n\r\n"; m_AttrValues.text = "Vehicle".ToLocalizationString() + "\r\n" + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + #if PLANET_EXPLORERS " " + "Meat".ToLocalizationString() + #endif "\r\n\r\n" + (attr.m_Attack).ToString("#,##0") + " /s\r\n" + (attr.m_Durability).ToString("#,##0") + "\r\n" + (attr.m_MaxFuel).ToString("#,##0") + "\r\n"; } else if (attr.m_Type == ECreation.Aircraft) { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + "Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n\r\n" + "Attack".ToLocalizationString() + ":\r\n" + "Durability".ToLocalizationString() + ":\r\n" + "Fuel".ToLocalizationString() + ":\r\n\r\n"; m_AttrValues.text = "Aircraft".ToLocalizationString() + "\r\n" + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + #if PLANET_EXPLORERS " " + "Meat".ToLocalizationString() + #endif "\r\n\r\n" + (attr.m_Attack).ToString("#,##0") + " /s\r\n" + (attr.m_Durability).ToString("#,##0") + "\r\n" + (attr.m_MaxFuel).ToString("#,##0") + "\r\n"; } else if (attr.m_Type == ECreation.Boat) { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + "Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n\r\n" + "Attack".ToLocalizationString() + ":\r\n" + "Durability".ToLocalizationString() + ":\r\n" + "Fuel".ToLocalizationString() + ":\r\n\r\n"; m_AttrValues.text = "Boat".ToLocalizationString() + "\r\n" + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + #if PLANET_EXPLORERS " " + "Meat".ToLocalizationString() + #endif "\r\n\r\n" + (attr.m_Attack).ToString("#,##0") + " /s\r\n" + (attr.m_Durability).ToString("#,##0") + "\r\n" + (attr.m_MaxFuel).ToString("#,##0") + "\r\n"; } else if (attr.m_Type == ECreation.SimpleObject) { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + "Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n\r\n" + "Durability".ToLocalizationString() + ":\r\n\r\n"; m_AttrValues.text = "Object".ToLocalizationString() + "\r\n" + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + #if PLANET_EXPLORERS " " + "Meat".ToLocalizationString() + #endif "\r\n\r\n" + (attr.m_Durability).ToString("#,##0") + "\r\n"; } else if (attr.m_Type == ECreation.Robot) { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + "Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n\r\n" + "Attack".ToLocalizationString() + ":\r\n" + "Durability".ToLocalizationString() + ":\r\n\r\n"; m_AttrValues.text = "Object".ToLocalizationString() + "\r\n" + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + #if PLANET_EXPLORERS " " + "Meat".ToLocalizationString() + #endif "\r\n\r\n" + (attr.m_Attack).ToString("#,##0") + " /s\r\n" + (attr.m_Durability).ToString("#,##0") + "\r\n"; } else if (attr.m_Type == ECreation.AITurret) { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + "Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n\r\n" + "Attack".ToLocalizationString() + ":\r\n" + "Durability".ToLocalizationString() + ":\r\n\r\n"; m_AttrValues.text = "Object".ToLocalizationString() + "\r\n" + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + #if PLANET_EXPLORERS " " + "Meat".ToLocalizationString() + #endif "\r\n\r\n" + (attr.m_Attack).ToString("#,##0") + " /s\r\n" + (attr.m_Durability).ToString("#,##0") + "\r\n"; } else if (attr.m_Type == ECreation.ArmorHead || attr.m_Type == ECreation.ArmorBody || attr.m_Type == ECreation.ArmorArmAndLeg || attr.m_Type == ECreation.ArmorHandAndFoot || attr.m_Type == ECreation.ArmorDecoration) { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + "Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n\r\n" + "Defense".ToLocalizationString() + ":\r\n" + "Durability".ToLocalizationString() + ":\r\n\r\n"; m_AttrValues.text = "Object".ToLocalizationString() + "\r\n" + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + #if PLANET_EXPLORERS " " + "Meat".ToLocalizationString() + #endif "\r\n\r\n" + (attr.m_Defense).ToString("#,##0") + "\r\n" + (attr.m_Durability).ToString("#,##0") + "\r\n"; } else { m_AttrNames.text = "Creation".ToLocalizationString() + ":\r\n" + "Weight".ToLocalizationString() + ":\r\n" + "Volume".ToLocalizationString() + ":\r\n" + "Sell Price".ToLocalizationString() + ":\r\n"; m_AttrValues.text = "[FF0000]???[-]\r\n" + VCUtils.WeightToString(attr.m_Weight) + "\r\n" + VCUtils.VolumeToString(attr.m_Volume) + "\r\n" + (attr.m_SellPrice).ToString("#,##0") + #if PLANET_EXPLORERS " " + "Meat".ToLocalizationString() + #endif "\r\n"; } if (attr.m_Errors.Count > 0) { m_AttrNames.text += "\r\n[FF0000]" + "Errors".ToLocalizationString() + ":\r\n"; foreach (string e in attr.m_Errors) { m_AttrNames.text += ("> " + e.ToLocalizationString() + "\r\n"); } m_AttrNames.text += "[-]"; } if (attr.m_Warnings.Count > 0) { m_AttrNames.text += "\r\n[FFFF00]" + "Warnings".ToLocalizationString() + ":\r\n"; foreach (string w in attr.m_Warnings) { m_AttrNames.text += ("> " + w.ToLocalizationString() + "\r\n"); } m_AttrNames.text += "[-]"; } m_CostList.RefreshCostList(); m_UITable.Reposition(); } else // attr == null { m_AttrNames.text = "[FF0000]" + m_NonEditorError + "[-]"; m_AttrValues.text = ""; m_CostList.RefreshCostList(); m_UITable.Reposition(); } // Status if (m_IsEditor) { if (VCEditor.s_Scene.m_CreationAttr.m_Errors.Count > 0) { VCEStatusBar.ShowText("Your creation has some errors".ToLocalizationString(), Color.red, 10); } else if (VCEditor.s_Scene.m_CreationAttr.m_Warnings.Count > 0) { VCEStatusBar.ShowText("Your creation has some warnings".ToLocalizationString(), Color.yellow, 10); } if (attr.m_Weight > 0.0001f) { VCEditor.Instance.m_MassCenterTrans.localPosition = attr.m_CenterOfMass; VCEditor.Instance.m_MassCenterTrans.gameObject.SetActive(true); } else { VCEditor.Instance.m_MassCenterTrans.gameObject.SetActive(false); } VCIsoRemark remark = new VCIsoRemark(); remark.m_Attribute = attr; VCEditor.s_Scene.m_IsoData.m_HeadInfo.Remarks = remark.xml; } }