|
@@ -66,20 +66,20 @@ namespace MetaClient
|
|
|
[Header("颜色演示预制体")]
|
|
|
public GameObject colItem;
|
|
|
|
|
|
-
|
|
|
+ public bool hasColorChoose = false;
|
|
|
public float tween_leftMax = 0;
|
|
|
public float tween_leftMin = -250;
|
|
|
|
|
|
public float tween_rightMin = 0;
|
|
|
public float tween_rightMax = 223;
|
|
|
|
|
|
- private float tween_saveBtnMax = 119;
|
|
|
- private float tween_saveBtnMin = -108;
|
|
|
+ //private float tween_saveBtnMax = 119;
|
|
|
+ //private float tween_saveBtnMin = -108;
|
|
|
|
|
|
private float tweenTime = 0.5f;
|
|
|
//private float tweenTime = 10;
|
|
|
//private float tweenLeastTime = 0;
|
|
|
-
|
|
|
+ private GameObject nowChooseColorObj;
|
|
|
public bool isTween = false;
|
|
|
[Header("选择界面分支")]
|
|
|
[SerializeField]
|
|
@@ -96,25 +96,73 @@ namespace MetaClient
|
|
|
private GameObject nowPickOnImg=null;
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ private Vector3 colorV3 = new Vector3(0, 0, 0);
|
|
|
//[Header("接受到的数据")]
|
|
|
//[SerializeField]
|
|
|
private IDataTable<DRCustomBody> _bodydata;
|
|
|
+ private IDataTable<DRCustomFace> _facedata;
|
|
|
protected override void OnOpen(object userData)
|
|
|
{
|
|
|
|
|
|
base.OnOpen(userData);
|
|
|
IDataTable<DRCustomBody> _data = GameEntry.DataTable.GetDataTable<DRCustomBody>();
|
|
|
_bodydata = GameEntry.DataTable.GetDataTable<DRCustomBody>();
|
|
|
-
|
|
|
+ _facedata = GameEntry.DataTable.GetDataTable<DRCustomFace>();
|
|
|
+
|
|
|
+ }
|
|
|
+ public void ColorChange(Vector3 _v3) {
|
|
|
+ colorV3 = _v3;
|
|
|
+ }
|
|
|
+ public void SaveColorChange()
|
|
|
+ {
|
|
|
+ var a = new UIColorData(eCustomStyple,id,colorV3);
|
|
|
+ String str = JsonUtility.ToJson(a);
|
|
|
+ // var obj = JsonUtility.FromJson<PartData>(str);
|
|
|
+
|
|
|
+ SaveColorAdd(3);
|
|
|
+ SaveColorAdd(2);
|
|
|
+
|
|
|
+
|
|
|
+ GameEntry.Setting.SetString("savecolor"+eCustomStyple+"/"+id+"/"+1, str);
|
|
|
+ GameEntry.Setting.Save();
|
|
|
+ ChooseColorChange();
|
|
|
+ //GameEntry.Setting.HasSetting("savecolor");
|
|
|
+ //GameEntry.Setting.GetString("");
|
|
|
+ }
|
|
|
+ public void SaveColorAdd(int _Index)
|
|
|
+ {
|
|
|
+ if (GameEntry.Setting.HasSetting("savecolor" + eCustomStyple + "/" + id + "/"+_Index))
|
|
|
+ {
|
|
|
+ String _saveStr=GameEntry.Setting.GetString("savecolor" + eCustomStyple + "/" + id + "/" + (_Index-1));
|
|
|
+ GameEntry.Setting.SetString("savecolor" + eCustomStyple + "/" + id + "/" +_Index, _saveStr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public void ColorHuaDong(Vector3 _v3)
|
|
|
+ {
|
|
|
+ colorV3 = _v3;
|
|
|
+ }
|
|
|
+ public void ChooseColorChange()
|
|
|
+ {
|
|
|
+ Debug.Log(nowChooseColorObj.transform.parent.name);
|
|
|
+ if (nowChooseColorObj!=null)
|
|
|
+ {
|
|
|
+ Image _img=nowChooseColorObj.transform.GetComponent<Image>();
|
|
|
+ _img.color = new Color(colorV3.x,colorV3.y,colorV3.z);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
protected override void OnClose(bool isShutdown, object userData)
|
|
|
{
|
|
|
base.OnClose(isShutdown, userData);
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void ClickBotton(ECustomStyple eCustomStyple,int id,bool ziDingYi)
|
|
|
+ public void ClickBotton(ECustomStyple eCustomStyple,int id,bool ziDingYi,bool isColor)
|
|
|
{
|
|
|
if (isTween)
|
|
|
{
|
|
@@ -124,7 +172,7 @@ namespace MetaClient
|
|
|
leftView.transform.DOLocalMoveX(tween_leftMin, tweenTime).SetEase(Ease.InOutBack).OnComplete(()=> {
|
|
|
//whitebg.SetActive(bg);
|
|
|
|
|
|
- ClickBtnFun(eCustomStyple,id,ziDingYi);
|
|
|
+ ClickBtnFun(eCustomStyple,id,ziDingYi,isColor);
|
|
|
leftView.transform.DOLocalMoveX(0, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
|
|
|
isTween = false;
|
|
|
Debug.Log("222");
|
|
@@ -138,27 +186,69 @@ namespace MetaClient
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /// <summary>
|
|
|
+ /// 调色界面打开
|
|
|
+ /// </summary>
|
|
|
public void TiaoSeViewOpenFun() {
|
|
|
+ HistoryAdd("Color");
|
|
|
rightView.SetActive(false);
|
|
|
colorView.SetActive(true);
|
|
|
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 调色板的调色板打开或关闭
|
|
|
+ /// </summary>
|
|
|
public void TiaoSeBanOpenStyple(bool _bo)
|
|
|
{
|
|
|
- colorView.SetActive(_bo);
|
|
|
- tiaoSeBanView.SetActive(!_bo);
|
|
|
+ colorView.SetActive(!_bo);
|
|
|
+ tiaoSeBanView.SetActive(_bo);
|
|
|
|
|
|
}
|
|
|
|
|
|
- //private void
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ /// <summary>
|
|
|
+ /// 调色板确认按钮
|
|
|
+ /// </summary>
|
|
|
+ public void TiaoSeSure()
|
|
|
+ {
|
|
|
+ SaveColorChange();
|
|
|
+ TiaoSeBanOpenStyple(false);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 调色板取消按钮
|
|
|
+ /// </summary>
|
|
|
+ public void TiaoSeBanCloseFun() {
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 自定义调色板
|
|
|
+ /// </summary>
|
|
|
+ public void TiaoSeBanCustom() {
|
|
|
|
|
|
+ }
|
|
|
+ public void TiaoSeViewRefesh() {
|
|
|
+ GameObject _obj = tiaoSeBanView.transform.GetChild(0).GetChild(0).gameObject;
|
|
|
+ RemoveAllChildren(_obj, 1);
|
|
|
+ }
|
|
|
+ public void TiaoSeAddItem(GameObject _par) {
|
|
|
|
|
|
|
|
|
+ if (GameEntry.Setting.HasSetting("savecolor" + eCustomStyple + "/" + id + "/" + 3))
|
|
|
+ {
|
|
|
+ }
|
|
|
+ GameObject _clone = GameObject.Instantiate(colItem);
|
|
|
+ _clone.transform.SetParent(_par.transform);
|
|
|
+
|
|
|
+ }
|
|
|
+ public bool HasCustomColor(int _index)
|
|
|
+ {
|
|
|
+ bool _has = GameEntry.Setting.HasSetting("savecolor" + eCustomStyple + "/" + id + "/" + _index+"");
|
|
|
+ return _has;
|
|
|
+ }
|
|
|
+ //public UIColorData GetUIColorData(int _index) {
|
|
|
+ // String _str= GameEntry.Setting.GetString("savecolor" + eCustomStyple + "/" + id + "/" + _index+"");
|
|
|
+ // return
|
|
|
+ //}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 设置是否已在缓动
|
|
@@ -184,10 +274,22 @@ namespace MetaClient
|
|
|
public void ScrollValueChange()
|
|
|
{
|
|
|
//Debug.Log(scrollbar.value);
|
|
|
- GameEntry.Event.Fire(this, CustomRoleBodyEventArgs.Create(part, new Vector3(scrollbar.value, 0, 0)));
|
|
|
+ switch (eCustomStyple)
|
|
|
+ {
|
|
|
+ case ECustomStyple.None:
|
|
|
+ break;
|
|
|
+ case ECustomStyple.Body:
|
|
|
+ GameEntry.Event.Fire(this, CustomRoleBodyEventArgs.Create(part, new Vector3(scrollbar.value, 0, 0)));
|
|
|
+ break;
|
|
|
+ case ECustomStyple.NieLian:
|
|
|
+ break;
|
|
|
+ case ECustomStyple.Cloth:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ // GameEntry.Event.Fire(this, CustomRoleBodyEventArgs.Create(part, new Vector3(scrollbar.value, 0, 0)));
|
|
|
}
|
|
|
|
|
|
- public void BackBtnFun()
|
|
|
+ public void BackBtn_Fun()
|
|
|
{
|
|
|
if (histroyextra)
|
|
|
{
|
|
@@ -207,6 +309,7 @@ namespace MetaClient
|
|
|
break;
|
|
|
case 2:
|
|
|
Debug.Log("进入选择界面");
|
|
|
+ scrollbar.gameObject.SetActive(false);
|
|
|
histroy.RemoveAt(histroy.Count - 1);
|
|
|
Back_TwoFun(true);
|
|
|
break;
|
|
@@ -219,6 +322,42 @@ namespace MetaClient
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public void BackBtnFun()
|
|
|
+ {
|
|
|
+ if (isTween)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ isTween = true;
|
|
|
+ leftView.transform.DOLocalMoveX(tween_leftMin, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
|
|
|
+ //whitebg.SetActive(bg);
|
|
|
+
|
|
|
+ BackBtn_Fun();
|
|
|
+ leftView.transform.DOLocalMoveX(0, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
|
|
|
+ isTween = false;
|
|
|
+ Debug.Log("222");
|
|
|
+ });
|
|
|
+ });
|
|
|
+ Debug.Log("333");
|
|
|
+ rightView.transform.DOLocalMoveX(tween_rightMax, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
|
|
|
+ rightView.transform.DOLocalMoveX(0, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 返回的方法一
|
|
|
+ /// </summary>
|
|
|
void Back_OneFun() {
|
|
|
ViewSetFalse();
|
|
|
toolView.SetActive(true);
|
|
@@ -227,12 +366,17 @@ namespace MetaClient
|
|
|
//nieLianView.SetActive(false);
|
|
|
//clothView.SetActive(false);
|
|
|
}
|
|
|
-
|
|
|
+ /// <summary>
|
|
|
+ /// 返回的方法extra
|
|
|
+ /// </summary>
|
|
|
void BackExtraFun()
|
|
|
{
|
|
|
rightView.SetActive(true);
|
|
|
scrollbar.gameObject.SetActive(false);
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 面板全部隐藏
|
|
|
+ /// </summary>
|
|
|
void ViewSetFalse()
|
|
|
{
|
|
|
toolView.SetActive(false);
|
|
@@ -253,10 +397,14 @@ namespace MetaClient
|
|
|
_obj.transform.GetChild(0).gameObject.SetActive(_bo);
|
|
|
_obj.transform.GetChild(2).gameObject.SetActive(!_bo);
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 返回的方法二
|
|
|
+ /// </summary>
|
|
|
void Back_TwoFun(bool _bo)
|
|
|
{
|
|
|
- // int _choose = int.Parse(histroy[1]);
|
|
|
- // switch ((ECustomStyple)_choose)
|
|
|
+ // int _choose = int.Parse(histroy[1]);
|
|
|
+ // switch ((ECustomStyple)_choose)
|
|
|
+ whitebg.SetActive(false);
|
|
|
switch(eCustomStyple)
|
|
|
{
|
|
|
case ECustomStyple.Body:
|
|
@@ -276,6 +424,9 @@ namespace MetaClient
|
|
|
//nieLianView.SetActive(false);
|
|
|
//clothView.SetActive(false);
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 返回的方法三
|
|
|
+ /// </summary>
|
|
|
void Back_ThreeFun()
|
|
|
{
|
|
|
string[] _strArrary = histroy[histroy.Count - 1].Split(',');
|
|
@@ -286,8 +437,10 @@ namespace MetaClient
|
|
|
}
|
|
|
else if (_strArrary[0] == "ziDingyi")
|
|
|
{
|
|
|
- int _chooseId = int.Parse(_strArrary[1]);
|
|
|
- ClickBtnFun(eCustomStyple, _chooseId, false);
|
|
|
+ scrollbar.gameObject.SetActive(false);
|
|
|
+ int _chooseId = int.Parse(_strArrary[2]);
|
|
|
+ hasColorChoose = int.Parse(_strArrary[1]) == 1 ? true : false;
|
|
|
+ ClickBtnFun(eCustomStyple, _chooseId, true,hasColorChoose);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -311,13 +464,15 @@ namespace MetaClient
|
|
|
{
|
|
|
|
|
|
nowPickOnImg = _nowPickOnImg;
|
|
|
+ id = _id;
|
|
|
nowPickOnImg.SetActive(true);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- nowPickOnImg.SetActive(false);
|
|
|
+
|
|
|
if (_id != id)
|
|
|
{
|
|
|
+ nowPickOnImg.SetActive(false);
|
|
|
id = _id;
|
|
|
nowPickOnImg = _nowPickOnImg;
|
|
|
_nowPickOnImg.SetActive(true);
|
|
@@ -349,15 +504,25 @@ namespace MetaClient
|
|
|
{
|
|
|
return scrollbar.value;
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 修改颜色
|
|
|
+ /// </summary>
|
|
|
+ public void SetColor(int _part, ECustomStyple eCustomStyple)
|
|
|
+ {
|
|
|
|
|
|
+ //scrollbar.value = _value;
|
|
|
+ part = _part;
|
|
|
+
|
|
|
+ }
|
|
|
/// <summary>
|
|
|
/// 按钮点击事件
|
|
|
/// </summary>
|
|
|
- public void ClickBtnFun(ECustomStyple eCustomStyple,int id,bool zidingyi) {
|
|
|
+ public void ClickBtnFun(ECustomStyple eCustomStyple,int id,bool zidingyi,bool isColor) {
|
|
|
//if (isTween)
|
|
|
//{
|
|
|
// return;
|
|
|
//}
|
|
|
+ hasColorChoose = isColor;
|
|
|
whitebg.SetActive(true);
|
|
|
scrollbar.gameObject.SetActive(false);
|
|
|
this.eCustomStyple = eCustomStyple;
|
|
@@ -378,7 +543,7 @@ namespace MetaClient
|
|
|
// ZiDingYiNeiLian(eCustomStyple, id, _nieLianXX.transform.GetChild(0).gameObject);
|
|
|
// return;
|
|
|
//}
|
|
|
- CreateNieLianImg(id, zidingyi);
|
|
|
+ CreateNieLianImg(id, zidingyi,isColor);
|
|
|
break;
|
|
|
case ECustomStyple.Body:
|
|
|
GameObject _bodyList = bodyView.transform.GetChild(0).gameObject;
|
|
@@ -390,7 +555,7 @@ namespace MetaClient
|
|
|
// ZiDingYiBody(eCustomStyple, id, _bodyListXX.transform.GetChild(0).gameObject);
|
|
|
// return;
|
|
|
//}
|
|
|
- CreateBodyImg(id, zidingyi);
|
|
|
+ CreateBodyImg(id, zidingyi,isColor);
|
|
|
break;
|
|
|
case ECustomStyple.Cloth:
|
|
|
GameObject _clothList = clothView.transform.GetChild(0).gameObject;
|
|
@@ -402,7 +567,7 @@ namespace MetaClient
|
|
|
// ZiDingYiCloth(eCustomStyple, id, _clothListXX.transform.GetChild(0).gameObject);
|
|
|
// return;
|
|
|
//}
|
|
|
- CreateClothImg(id, zidingyi);
|
|
|
+ CreateClothImg(id, zidingyi,isColor);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -411,10 +576,10 @@ namespace MetaClient
|
|
|
// return null;
|
|
|
//}
|
|
|
|
|
|
- private void RemoveAllChildren(GameObject parent)
|
|
|
+ private void RemoveAllChildren(GameObject parent,int _index=0)
|
|
|
{
|
|
|
Transform transform;
|
|
|
- for (int i = 0; i < parent.transform.childCount; i++)
|
|
|
+ for (int i = _index; i < parent.transform.childCount; i++)
|
|
|
{
|
|
|
transform = parent.transform.GetChild(i);
|
|
|
GameObject.Destroy(transform.gameObject);
|
|
@@ -457,22 +622,22 @@ namespace MetaClient
|
|
|
//}
|
|
|
|
|
|
|
|
|
- public void CreateNieLianImg(int parentid, bool ziDingYi)
|
|
|
+ public void CreateNieLianImg(int parentid, bool ziDingYi, bool isColor)
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- GameObject _objPar = bodyView.transform.GetChild(2).GetChild(0).gameObject;
|
|
|
+ GameObject _objPar = nieLianView.transform.GetChild(2).GetChild(0).gameObject;
|
|
|
RemoveAllChildren(_objPar);
|
|
|
//等有捏脸表时改为捏脸
|
|
|
- IDataTable<DRCustomBody> _data = GameEntry.DataTable.GetDataTable<DRCustomBody>();
|
|
|
- _bodydata = GameEntry.DataTable.GetDataTable<DRCustomBody>();
|
|
|
- int cengji = ziDingYi ?1:0;
|
|
|
- if (!ziDingYi)
|
|
|
+ IDataTable<DRCustomFace> _data = GameEntry.DataTable.GetDataTable<DRCustomFace>();
|
|
|
+ _facedata = GameEntry.DataTable.GetDataTable<DRCustomFace>();
|
|
|
+ int cengji = ziDingYi ? 0 : 1;
|
|
|
+ if (ziDingYi)
|
|
|
{
|
|
|
|
|
|
- CreateZDYFun(parentid, _objPar);
|
|
|
+ CreateZDYFun(parentid, _objPar,ziDingYiBtn);
|
|
|
|
|
|
//GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
|
|
|
//_obj.transform.SetParent(_objPar.transform);
|
|
@@ -484,32 +649,35 @@ namespace MetaClient
|
|
|
//_uICustomBtn.eCustomStyple = eCustomStyple;
|
|
|
//_obj.SetActive(true);
|
|
|
}
|
|
|
-
|
|
|
- DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
|
|
|
+ if (isColor)
|
|
|
+ {
|
|
|
+ CreateColFun(parentid, _objPar,colItem);
|
|
|
+ }
|
|
|
+ DRCustomFace[] dRCustomBodies = _facedata.GetAllDataRows();
|
|
|
for (int i = 0; i < dRCustomBodies.Length; i++)
|
|
|
{
|
|
|
Debug.Log(dRCustomBodies[i].Id);
|
|
|
if (dRCustomBodies[i].ParentStyple == parentid&&dRCustomBodies[i].Cengji==cengji)
|
|
|
{
|
|
|
- CreateButtonFun(dRCustomBodies[i].Icon, dRCustomBodies[i].Part, dRCustomBodies[i].Name, _objPar, dRCustomBodies[i].Id, dRCustomBodies[i].ButtonStyple, ECustomStyple.Body);
|
|
|
+ CreateButtonFun(dRCustomBodies[i].Icon, dRCustomBodies[i].Name, _objPar, dRCustomBodies[i].Id, dRCustomBodies[i].ButtonStyple, ECustomStyple.Body, dRCustomBodies[i].IsActive);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
ChangeListBotton(_objPar);
|
|
|
}
|
|
|
- public void CreateClothImg(int parentid,bool ziDingYi)
|
|
|
+ public void CreateClothImg(int parentid,bool ziDingYi, bool isColor)
|
|
|
{
|
|
|
|
|
|
- GameObject _objPar = bodyView.transform.GetChild(2).GetChild(0).gameObject;
|
|
|
+ GameObject _objPar = clothView.transform.GetChild(2).GetChild(0).gameObject;
|
|
|
RemoveAllChildren(_objPar);
|
|
|
//等有服装时改为服装
|
|
|
IDataTable<DRCustomBody> _data = GameEntry.DataTable.GetDataTable<DRCustomBody>();
|
|
|
_bodydata = GameEntry.DataTable.GetDataTable<DRCustomBody>();
|
|
|
- int cengji = ziDingYi ?1:0;
|
|
|
- if (!ziDingYi)
|
|
|
+ int cengji = ziDingYi ? 0 : 1;
|
|
|
+ if (ziDingYi)
|
|
|
{
|
|
|
|
|
|
- CreateZDYFun(parentid, _objPar);
|
|
|
+ CreateZDYFun(parentid, _objPar,ziDingYiBtn);
|
|
|
|
|
|
//GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
|
|
|
//_obj.transform.SetParent(_objPar.transform);
|
|
@@ -522,26 +690,45 @@ namespace MetaClient
|
|
|
//_obj.SetActive(true);
|
|
|
|
|
|
}
|
|
|
+ if (isColor)
|
|
|
+ {
|
|
|
+ CreateColFun(parentid, _objPar, colItem);
|
|
|
+
|
|
|
+ }
|
|
|
DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
|
|
|
for (int i = 0; i < dRCustomBodies.Length; i++)
|
|
|
{
|
|
|
Debug.Log(dRCustomBodies[i].Id);
|
|
|
if (dRCustomBodies[i].ParentStyple == parentid && dRCustomBodies[i].Cengji == cengji)
|
|
|
{
|
|
|
- CreateButtonFun(dRCustomBodies[i].Icon, dRCustomBodies[i].Part, dRCustomBodies[i].Name, _objPar, dRCustomBodies[i].Id, dRCustomBodies[i].ButtonStyple, ECustomStyple.Body);
|
|
|
+ CreateButtonFun(dRCustomBodies[i].Icon, dRCustomBodies[i].Name, _objPar, dRCustomBodies[i].Id, dRCustomBodies[i].ButtonStyple, ECustomStyple.Body, dRCustomBodies[i].IsActive);
|
|
|
}
|
|
|
}
|
|
|
ChangeListBotton(_objPar);
|
|
|
}
|
|
|
|
|
|
- private void CreateZDYFun(int parentid,GameObject _objPar)
|
|
|
+ private void CreateZDYFun(int parentid,GameObject _objPar,GameObject _clone)
|
|
|
{
|
|
|
- GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
|
|
|
+ GameObject _obj = GameObject.Instantiate(_clone);
|
|
|
_obj.transform.SetParent(_objPar.transform);
|
|
|
UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
|
|
|
ChangeUICustom(_uICustomBtn, parentid, eCustomStyple);
|
|
|
}
|
|
|
-
|
|
|
+ private void CreateColFun(int parentid, GameObject _objPar, GameObject _clone)
|
|
|
+ {
|
|
|
+ GameObject _obj = GameObject.Instantiate(_clone);
|
|
|
+ _obj.transform.SetParent(_objPar.transform);
|
|
|
+ UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
|
|
|
+ ChangeUICustom(_uICustomBtn, parentid, eCustomStyple);
|
|
|
+ nowChooseColorObj = _obj;
|
|
|
+ }
|
|
|
+ //private void CreateColorFun(int parentid, GameObject _objPar, GameObject _clone)
|
|
|
+ //{
|
|
|
+ // GameObject _obj = GameObject.Instantiate(_clone);
|
|
|
+ // _obj.transform.SetParent(_objPar.transform);
|
|
|
+ // UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
|
|
|
+ // ChangeUICustom(_uICustomBtn, parentid, eCustomStyple);
|
|
|
+ //}
|
|
|
public void ChangeUICustom(UICustomBtn uICustomBtn,int id, ECustomStyple eCustomStyple)
|
|
|
{
|
|
|
uICustomBtn.id = id;
|
|
@@ -556,16 +743,16 @@ namespace MetaClient
|
|
|
|
|
|
|
|
|
|
|
|
- public void CreateBodyImg(int parentid,bool ziDingYi) {
|
|
|
+ public void CreateBodyImg(int parentid,bool ziDingYi, bool isColor) {
|
|
|
GameObject _objPar = bodyView.transform.GetChild(2).GetChild(0).gameObject;
|
|
|
RemoveAllChildren(_objPar);
|
|
|
IDataTable<DRCustomBody> _data = GameEntry.DataTable.GetDataTable<DRCustomBody>();
|
|
|
_bodydata = GameEntry.DataTable.GetDataTable<DRCustomBody>();
|
|
|
- int cengji = ziDingYi ?1:0;
|
|
|
- if (!ziDingYi)
|
|
|
+ int cengji = ziDingYi ?0:1;
|
|
|
+ if (ziDingYi)
|
|
|
{
|
|
|
|
|
|
- CreateZDYFun(parentid, _objPar);
|
|
|
+ CreateZDYFun(parentid, _objPar,ziDingYiBtn);
|
|
|
|
|
|
|
|
|
//GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
|
|
@@ -579,13 +766,17 @@ namespace MetaClient
|
|
|
//_obj.SetActive(true);
|
|
|
|
|
|
}
|
|
|
+ if (isColor)
|
|
|
+ {
|
|
|
+ CreateColFun(parentid, _objPar, colItem);
|
|
|
+ }
|
|
|
DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
|
|
|
for (int i = 0; i < dRCustomBodies.Length; i++)
|
|
|
{
|
|
|
Debug.Log(dRCustomBodies[i].Id);
|
|
|
if (dRCustomBodies[i].ParentStyple == parentid && dRCustomBodies[i].Cengji == cengji)
|
|
|
{
|
|
|
- CreateButtonFun(dRCustomBodies[i].Icon, dRCustomBodies[i].Part, dRCustomBodies[i].Name, _objPar, dRCustomBodies[i].Id, dRCustomBodies[i].ButtonStyple, ECustomStyple.Body);
|
|
|
+ CreateButtonFun(dRCustomBodies[i].Icon, dRCustomBodies[i].Name, _objPar, dRCustomBodies[i].Id, dRCustomBodies[i].ButtonStyple, ECustomStyple.Body, dRCustomBodies[i].IsActive);
|
|
|
}
|
|
|
}
|
|
|
ChangeListBotton(_objPar);
|
|
@@ -671,10 +862,11 @@ namespace MetaClient
|
|
|
|
|
|
|
|
|
|
|
|
- private void CreateButtonFun(string path,int _part,string _name, GameObject _parent,int _id,int buttonstyple,ECustomStyple eCustomStyple) {
|
|
|
+ private void CreateButtonFun(string path,string _name, GameObject _parent,int _id,int buttonstyple,ECustomStyple eCustomStyple,int _isactive) {
|
|
|
//Debug.Log(path);
|
|
|
// Debug.Log(_parent);
|
|
|
path = "CustomRole/" + path;
|
|
|
+ Debug.Log("图片名称" + _name);
|
|
|
GameEntry.Resource.LoadAsset(AssetUtility.GetUISpriteAsset(path), new LoadAssetCallbacks(
|
|
|
(assetName, asset, duration, userData) =>
|
|
|
{
|
|
@@ -687,14 +879,19 @@ namespace MetaClient
|
|
|
Image _objImg = _obj.transform.GetComponent<Image>();
|
|
|
_obj.SetActive(true);
|
|
|
_objImg.sprite = sprite;
|
|
|
- _obj.name = part+"";
|
|
|
+ _obj.name = _name+"";
|
|
|
_obj.transform.SetParent(_parent.transform);
|
|
|
+ if (_isactive != 1)
|
|
|
+ {
|
|
|
+ _obj.SetActive(false);
|
|
|
+ }
|
|
|
+
|
|
|
UICustomBtn uICustomBtn = _obj.GetComponent<UICustomBtn>();
|
|
|
uICustomBtn.id = _id;
|
|
|
uICustomBtn.eButtonStyple = (EButtonStyple)buttonstyple;
|
|
|
uICustomBtn.eCustomStyple = eCustomStyple;
|
|
|
uICustomBtn.isCreate = false;
|
|
|
- uICustomBtn.part = _part;
|
|
|
+ //uICustomBtn.part = _part;
|
|
|
|
|
|
//GameObject
|
|
|
//img.sprite = sprite;
|
|
@@ -762,7 +959,8 @@ namespace MetaClient
|
|
|
ViewOpen,
|
|
|
Close,
|
|
|
Sure,
|
|
|
- Open
|
|
|
+ Open,
|
|
|
+ Button
|
|
|
|
|
|
}
|
|
|
|