public TONE(uint version) { this.version = version; this.skinSets = new SkinSetDesc[] { new TONE.SkinSetDesc(), new TONE.SkinSetDesc(), new TONE.SkinSetDesc() }; this.overlayList = new OverlayDesc[0]; this.saturation = 0; this.hue = 0; this.opacity = 0; this.categoryTags = new CASP.PartTag[0]; this.colorList = new Color[1]; this.colorList[0] = new Color(); this.sortOrder = 100f; this.tuningInstance = 0x00000000000260A5U; //human skintone tuning this.skinPanel = SkinPanel.Miscellaneous; this.sliderLow = -.05f; this.sliderHigh = .05f; this.sliderIncrement = .005f; }
public bool IsWear(long heroid, int skinid) { return(SkinPanel.IsWearSkin(heroid, skinid)); }
public bool IsPossess(int skinId) { return(skinId == 0 || SkinPanel.IsPossessSkinId(skinId)); }
public void setHeroName(string heroId, long heroid, int skinId = 0, bool isSame = false) { if (Singleton <PvpSelectHeroView> .Instance.gameObject != null && Singleton <PvpSelectHeroView> .Instance.gameObject.activeInHierarchy) { Singleton <PropertyView> .Instance.HeroNpc = heroId; } this.list_goodsdata.Clear(); this.list_goodsdata.AddRange(ModelManager.Instance.Get_ShopGoodsList()); if (this.list_goodsdata == null) { return; } string price = null; List <GoodsData> list = new List <GoodsData>(); list = this.list_goodsdata.FindAll((GoodsData obj) => obj.Type == 2); List <GoodsData> list2 = new List <GoodsData>(); if (list == null) { return; } list2 = list.FindAll((GoodsData obj) => obj.ElementId == skinId.ToString()); if (list2 == null) { return; } if (list2.Count == 0) { price = null; } else { price = this.StringPrice(list2); } this.SetWearBtnState(heroid, skinId); this.SetBuyBtnState(skinId); this._heroName = heroId; if (this._skins == null) { this._skins = new List <Skin>(); } else { foreach (Skin current in this._skins) { UnityEngine.Object.Destroy(current.gameObject); } if (this._copy != null) { UnityEngine.Object.Destroy(this._copy.gameObject); } this._skins.Clear(); } List <SkinInfo> list3 = new List <SkinInfo>(); List <SkinInfo> list4 = new List <SkinInfo>(); SysHeroMainVo sysHeroMainVo = BaseDataMgr.instance.GetDicByType <SysHeroMainVo>()[heroId] as SysHeroMainVo; SysGameResVo sysGameResVo = BaseDataMgr.instance.GetDicByType <SysGameResVo>()[sysHeroMainVo.Loading_icon] as SysGameResVo; Texture tex = CachedRes.getTex(sysGameResVo.path); list4.Add(new SkinInfo(tex, this.GetSkinPrice(0))); if (sysHeroMainVo.skin_id != "[]") { int[] stringToInt = StringUtils.GetStringToInt(sysHeroMainVo.skin_id, ','); if (skinId == 0) { list3.Add(new SkinInfo(tex, this.GetSkinPrice(0))); int[] array = stringToInt; int id; for (int i = 0; i < array.Length; i++) { id = array[i]; if (list != null) { list2 = list.FindAll((GoodsData obj) => obj.ElementId == id.ToString()); if (list2 == null || list2.Count == 0) { price = null; } else { price = this.StringPrice(list2); } } list3.Add(new SkinInfo(id, this.ParsePrice(price), SkinPanel.IsPossessSkinId(id) || SkinPanel.IsWearSkin(heroid, id))); } } else { list3.Add(new SkinInfo(skinId, this.ParsePrice(price), SkinPanel.IsPossessSkinId(skinId) || SkinPanel.IsWearSkin(heroid, skinId))); int[] array2 = stringToInt; int it2; for (int j = 0; j < array2.Length; j++) { it2 = array2[j]; if (list != null) { list2 = list.FindAll((GoodsData obj) => obj.ElementId == it2.ToString()); if (list2 == null || list2.Count == 0) { price = null; } else { price = this.StringPrice(list2); } } if (it2 > skinId) { list3.Add(new SkinInfo(it2, this.ParsePrice(price), SkinPanel.IsPossessSkinId(it2) || SkinPanel.IsWearSkin(heroid, it2))); } } if (!list3.Contains(list3.Find((SkinInfo obj) => obj.skinId == 0))) { list3.Add(new SkinInfo(tex, this.GetSkinPrice(0))); } int[] array3 = stringToInt; int it; for (int k = 0; k < array3.Length; k++) { it = array3[k]; if (list != null) { list2 = list.FindAll((GoodsData obj) => obj.ElementId == it.ToString()); if (list2 == null || list2.Count == 0) { price = null; } else { price = this.StringPrice(list2); } } if (it < skinId) { list3.Add(new SkinInfo(it, this.ParsePrice(price), SkinPanel.IsPossessSkinId(it) || SkinPanel.IsWearSkin(heroid, it))); } } } } if (!list3.Contains(list3.Find((SkinInfo obj) => obj.skinId == 0))) { list3.Add(new SkinInfo(tex, this.GetSkinPrice(0))); } this._copy = NGUITools.AddChild(base.gameObject, Skin.prefab).GetComponent <Skin>(); List <Skin> list5 = new List <Skin>(); for (int l = 0; l < list3.Count; l++) { if (!(ToolsFacade.ServerCurrentTime < new DateTime(2016, 12, 19, 0, 0, 0)) || list3[l].skinId != 102802) { Skin component = NGUITools.AddChild(base.gameObject, Skin.prefab).GetComponent <Skin>(); SkinInfo skinInfo = list3[l]; component.name = "texture:" + l; component.setSkinInfo(skinInfo, this.IsPossess(skinInfo.skinId), this.IsWear(heroid, skinInfo.skinId)); component.toAlpha = 1f; list5.Add(component); } } if (!isSame) { base.gameObject.transform.localPosition = Vector3.zero; if (list5.Count >= 2) { if (list5.Count >= 3) { base.gameObject.transform.localPosition = base.gameObject.transform.localPosition + new Vector3(-81f, -81f, 0f); } else { base.gameObject.transform.localPosition = base.gameObject.transform.localPosition + new Vector3(-45f, -81f, 0f); } } else { base.gameObject.transform.localPosition = base.gameObject.transform.localPosition + new Vector3(0f, -81f, 0f); } } for (int m = 0; m < list5.Count; m++) { this._skins.Add(list5[m]); } this._oldPoses = this._poses; Vector3 vector = new Vector3(-300f, 0f, 0f); Vector3 a = new Vector3(0f, 0f, 0f); Vector3 a2 = new Vector3(142f, 12f, 0f); float num = 0.8f; this._skins[0].toPos = vector; this._poses = new List <Vector3>(); this._alphas = new List <float>(); this._poses.Add(vector); for (int n = 0; n <= this._skins.Count; n++) { Vector3 b = a2 * (float)n; this._poses.Add(a + b); } this._scales = new List <float>(); this._scales.Add(1f); for (int num2 = 0; num2 <= this._skins.Count; num2++) { if (num2 == 0) { this._scales.Add(1f); } else { float item = (num2 < 2) ? num : (Mathf.Pow(num, (float)num2) - 0.064f); this._scales.Add(item); } } this._alphas.Add(0f); for (int num3 = 0; num3 < this._skins.Count; num3++) { if (num3 > 2) { this._alphas.Add(0f); } else { this._alphas.Add(1f / (float)(num3 + 1)); } } this._alphas.Add(0f); if (isSame && this._oldPoses != null) { this._poses = this._oldPoses; } foreach (Skin current2 in this._skins) { int index = this._skins.IndexOf(current2) + 1; current2.trans.localPosition = this._poses[index]; current2.trans.localScale = new Vector3(this._scales[index], this._scales[index], 1f); current2.SetAlpha(this._alphas[index]); } this.resetDepth(); }
private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DlgBase)); this.skinPanel1 = new CCWin.SkinControl.SkinPanel(); this.flowLayoutBottom = new CCWin.SkinControl.SkinFlowLayoutPanel(); this.MainPanel = new CCWin.SkinControl.SkinPanel(); this.skinPanel1.SuspendLayout(); this.SuspendLayout(); // // skinPanel1 // this.skinPanel1.BackColor = System.Drawing.Color.Transparent; this.skinPanel1.Controls.Add(this.flowLayoutBottom); this.skinPanel1.ControlState = CCWin.SkinClass.ControlState.Normal; resources.ApplyResources(this.skinPanel1, "skinPanel1"); this.skinPanel1.DownBack = null; this.skinPanel1.MouseBack = null; this.skinPanel1.Name = "skinPanel1"; this.skinPanel1.NormlBack = null; // // flowLayoutBottom // this.flowLayoutBottom.BackColor = System.Drawing.Color.Transparent; this.flowLayoutBottom.ControlState = CCWin.SkinClass.ControlState.Normal; resources.ApplyResources(this.flowLayoutBottom, "flowLayoutBottom"); this.flowLayoutBottom.DownBack = null; this.flowLayoutBottom.MouseBack = null; this.flowLayoutBottom.Name = "flowLayoutBottom"; this.flowLayoutBottom.NormlBack = null; this.flowLayoutBottom.Radius = 4; // // MainPanel // this.MainPanel.BackColor = System.Drawing.Color.Transparent; this.MainPanel.ControlState = CCWin.SkinClass.ControlState.Normal; resources.ApplyResources(this.MainPanel, "MainPanel"); this.MainPanel.DownBack = null; this.MainPanel.MouseBack = null; this.MainPanel.Name = "MainPanel"; this.MainPanel.NormlBack = null; this.MainPanel.Radius = 4; // // DlgBase // resources.ApplyResources(this, "$this"); this.BackColor = System.Drawing.Color.White; this.BackRectangle = new System.Drawing.Rectangle(2, 2, 2, 2); this.BorderColor = System.Drawing.Color.Gainsboro; this.BorderRectangle = new System.Drawing.Rectangle(1, 1, 1, 1); this.CaptionBackColorBottom = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); this.CaptionBackColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); this.CaptionFont = new System.Drawing.Font("微软雅黑", 9.2F); this.CaptionHeight = 28; this.CloseBoxSize = new System.Drawing.Size(45, 25); this.CloseNormlBack = ((System.Drawing.Image)(resources.GetObject("$this.CloseNormlBack"))); this.ControlBoxOffset = new System.Drawing.Point(2, 2); this.Controls.Add(this.MainPanel); this.Controls.Add(this.skinPanel1); this.EffectBack = System.Drawing.Color.WhiteSmoke; this.EffectWidth = 0; this.ICoOffset = new System.Drawing.Point(2, 0); this.IsShadowStraight = true; this.MdiBackColor = System.Drawing.Color.White; this.MdiBorderStyle = System.Windows.Forms.BorderStyle.None; this.MdiImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.Name = "DlgBase"; this.Radius = 0; this.Shadow = true; this.ShadowColor = System.Drawing.Color.Gainsboro; this.ShowIcon = false; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.skinPanel1.ResumeLayout(false); this.ResumeLayout(false); }
public TONE(BinaryReader br) { br.BaseStream.Position = 0; this.version = br.ReadUInt32(); ulong tmpInstance = 0ul; float tmpOpacity = .5f, tmpOpacity2 = .5f; if (this.version >= 10) { byte count = br.ReadByte(); List <SkinSetDesc> skinStateList = new List <SkinSetDesc>(); for (int i = 0; i < count; i++) { skinStateList.Add(new SkinSetDesc(br)); } while (count < 3) { skinStateList.Add(new SkinSetDesc()); count++; } this.skinSets = skinStateList.ToArray(); } else { this.skinSets = new SkinSetDesc[3]; tmpInstance = br.ReadUInt64(); } int overlayCount = br.ReadInt32(); this.overlayList = new OverlayDesc[overlayCount]; for (int i = 0; i < overlayCount; i++) { this.overlayList[i] = new OverlayDesc(br); } this.saturation = br.ReadUInt16(); this.hue = br.ReadUInt16(); this.opacity = br.ReadUInt32(); int tagCount = br.ReadInt32(); this.categoryTags = new CASP.PartTag[tagCount]; for (int i = 0; i < tagCount; i++) { categoryTags[i] = new CASP.PartTag(br, version >= 7 ? 4 : 2); } if (this.version < 10) { tmpOpacity = br.ReadSingle(); } byte colorCount = br.ReadByte(); this.colorList = new Color[colorCount]; for (int i = 0; i < colorCount; i++) { this.colorList[i] = Color.FromArgb(br.ReadInt32()); } this.sortOrder = br.ReadSingle(); if (this.version < 10) { tmpOpacity2 = br.ReadSingle(); } if (this.version >= 8) { this.tuningInstance = br.ReadUInt64(); } if (this.version < 10) { this.skinSets[0] = new SkinSetDesc(tmpInstance, 0ul, 1f, tmpOpacity, tmpOpacity2); this.skinSets[1] = new SkinSetDesc(0ul, 0ul, 1f, tmpOpacity, tmpOpacity2); this.skinSets[2] = new SkinSetDesc(0ul, 0ul, 1f, tmpOpacity, tmpOpacity2); } if (this.version > 10) { this.skinPanel = (SkinPanel)br.ReadUInt16(); this.sliderLow = br.ReadSingle(); this.sliderHigh = br.ReadSingle(); this.sliderIncrement = br.ReadSingle(); } }
void Start() { SkinPanel.UpdateSkinMat(); manager = FindObjectOfType <GameManager2>(); }