|
@@ -66,7 +66,7 @@ namespace MetaClient
|
|
|
[Header("颜色演示预制体")]
|
|
|
public GameObject colItem;
|
|
|
|
|
|
-
|
|
|
+ private bool hasColorChoose = false;
|
|
|
public float tween_leftMax = 0;
|
|
|
public float tween_leftMin = -250;
|
|
|
|
|
@@ -79,7 +79,7 @@ namespace MetaClient
|
|
|
private float tweenTime = 0.5f;
|
|
|
//private float tweenTime = 10;
|
|
|
//private float tweenLeastTime = 0;
|
|
|
-
|
|
|
+ private GameObject nowChooseColorObj;
|
|
|
public bool isTween = false;
|
|
|
[Header("选择界面分支")]
|
|
|
[SerializeField]
|
|
@@ -95,7 +95,7 @@ namespace MetaClient
|
|
|
private int id = -1;
|
|
|
private GameObject nowPickOnImg=null;
|
|
|
|
|
|
-
|
|
|
+ private Vector3 colorV3 = new Vector3(0, 0, 0);
|
|
|
//[Header("接受到的数据")]
|
|
|
//[SerializeField]
|
|
|
private IDataTable<DRCustomBody> _bodydata;
|
|
@@ -107,6 +107,49 @@ namespace MetaClient
|
|
|
_bodydata = GameEntry.DataTable.GetDataTable<DRCustomBody>();
|
|
|
|
|
|
}
|
|
|
+ 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)
|
|
|
{
|
|
@@ -114,7 +157,7 @@ namespace MetaClient
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void ClickBotton(ECustomStyple eCustomStyple,int id,bool ziDingYi)
|
|
|
+ public void ClickBotton(ECustomStyple eCustomStyple,int id,bool ziDingYi,bool isColor)
|
|
|
{
|
|
|
if (isTween)
|
|
|
{
|
|
@@ -124,7 +167,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");
|
|
@@ -142,6 +185,7 @@ namespace MetaClient
|
|
|
/// 调色界面打开
|
|
|
/// </summary>
|
|
|
public void TiaoSeViewOpenFun() {
|
|
|
+ HistoryAdd("Color");
|
|
|
rightView.SetActive(false);
|
|
|
colorView.SetActive(true);
|
|
|
|
|
@@ -151,8 +195,8 @@ namespace MetaClient
|
|
|
/// </summary>
|
|
|
public void TiaoSeBanOpenStyple(bool _bo)
|
|
|
{
|
|
|
- colorView.SetActive(_bo);
|
|
|
- tiaoSeBanView.SetActive(!_bo);
|
|
|
+ colorView.SetActive(!_bo);
|
|
|
+ tiaoSeBanView.SetActive(_bo);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -161,6 +205,7 @@ namespace MetaClient
|
|
|
/// </summary>
|
|
|
public void TiaoSeSure()
|
|
|
{
|
|
|
+ SaveColorChange();
|
|
|
TiaoSeBanOpenStyple(false);
|
|
|
}
|
|
|
/// <summary>
|
|
@@ -350,7 +395,7 @@ namespace MetaClient
|
|
|
else if (_strArrary[0] == "ziDingyi")
|
|
|
{
|
|
|
int _chooseId = int.Parse(_strArrary[1]);
|
|
|
- ClickBtnFun(eCustomStyple, _chooseId, false);
|
|
|
+ ClickBtnFun(eCustomStyple, _chooseId, false,hasColorChoose);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -427,11 +472,12 @@ namespace MetaClient
|
|
|
/// <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;
|
|
@@ -452,7 +498,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;
|
|
@@ -464,7 +510,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;
|
|
@@ -476,7 +522,7 @@ namespace MetaClient
|
|
|
// ZiDingYiCloth(eCustomStyple, id, _clothListXX.transform.GetChild(0).gameObject);
|
|
|
// return;
|
|
|
//}
|
|
|
- CreateClothImg(id, zidingyi);
|
|
|
+ CreateClothImg(id, zidingyi,isColor);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -531,13 +577,13 @@ 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>();
|
|
@@ -546,7 +592,7 @@ namespace MetaClient
|
|
|
if (ziDingYi)
|
|
|
{
|
|
|
|
|
|
- CreateZDYFun(parentid, _objPar);
|
|
|
+ CreateZDYFun(parentid, _objPar,ziDingYiBtn);
|
|
|
|
|
|
//GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
|
|
|
//_obj.transform.SetParent(_objPar.transform);
|
|
@@ -558,7 +604,10 @@ namespace MetaClient
|
|
|
//_uICustomBtn.eCustomStyple = eCustomStyple;
|
|
|
//_obj.SetActive(true);
|
|
|
}
|
|
|
-
|
|
|
+ if (isColor)
|
|
|
+ {
|
|
|
+ CreateColFun(parentid, _objPar,colItem);
|
|
|
+ }
|
|
|
DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
|
|
|
for (int i = 0; i < dRCustomBodies.Length; i++)
|
|
|
{
|
|
@@ -571,10 +620,10 @@ namespace MetaClient
|
|
|
|
|
|
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>();
|
|
@@ -583,7 +632,7 @@ namespace MetaClient
|
|
|
if (ziDingYi)
|
|
|
{
|
|
|
|
|
|
- CreateZDYFun(parentid, _objPar);
|
|
|
+ CreateZDYFun(parentid, _objPar,ziDingYiBtn);
|
|
|
|
|
|
//GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
|
|
|
//_obj.transform.SetParent(_objPar.transform);
|
|
@@ -596,6 +645,11 @@ namespace MetaClient
|
|
|
//_obj.SetActive(true);
|
|
|
|
|
|
}
|
|
|
+ if (isColor)
|
|
|
+ {
|
|
|
+ CreateColFun(parentid, _objPar, colItem);
|
|
|
+
|
|
|
+ }
|
|
|
DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
|
|
|
for (int i = 0; i < dRCustomBodies.Length; i++)
|
|
|
{
|
|
@@ -608,14 +662,28 @@ namespace MetaClient
|
|
|
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;
|
|
@@ -630,7 +698,7 @@ 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>();
|
|
@@ -639,7 +707,7 @@ namespace MetaClient
|
|
|
if (ziDingYi)
|
|
|
{
|
|
|
|
|
|
- CreateZDYFun(parentid, _objPar);
|
|
|
+ CreateZDYFun(parentid, _objPar,ziDingYiBtn);
|
|
|
|
|
|
|
|
|
//GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
|
|
@@ -653,6 +721,10 @@ namespace MetaClient
|
|
|
//_obj.SetActive(true);
|
|
|
|
|
|
}
|
|
|
+ if (isColor)
|
|
|
+ {
|
|
|
+ CreateColFun(parentid, _objPar, colItem);
|
|
|
+ }
|
|
|
DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
|
|
|
for (int i = 0; i < dRCustomBodies.Length; i++)
|
|
|
{
|