void OnPress() { if (blDrag) { if (dragType == 0 || dragType == 2) { int iIndex; switch (CommonFunc.s_iScrollIndex) { case (int)CommonFunc._FaceParts.FACE: iIndex = GetChangeColorIndex((int)CommonFunc._FaceParts.FACE, 4); CommonFunc.ChangeColor_Face(iIndex); break; case (int)CommonFunc._FaceParts.HAIR: iIndex = GetChangeColorIndex((int)CommonFunc._FaceParts.HAIR, 4); CommonFunc.ChangeColor_Hair(iIndex); break; case (int)CommonFunc._FaceParts.EAR: iIndex = GetChangeColorIndex((int)CommonFunc._FaceParts.EAR, 3); CommonFunc.ChangeColor_Ear(iIndex); break; case (int)CommonFunc._FaceParts.EYEBLOW: iIndex = GetChangeColorIndex((int)CommonFunc._FaceParts.EYEBLOW, 3); CommonFunc.ChangeColor_Eyeblow(iIndex); break; case (int)CommonFunc._FaceParts.EYE: iIndex = GetChangeColorIndex((int)CommonFunc._FaceParts.EYE, 3); CommonFunc.ChangeColor_Eye(iIndex); break; case 5: case 6: break; case (int)CommonFunc._FaceParts.FACE_ACC: iIndex = GetChangeColorIndex((int)CommonFunc._FaceParts.FACE_ACC, 3); CommonFunc.ChangeColor_FaceAcc(iIndex); break; case (int)CommonFunc._FaceParts.NECK: iIndex = GetChangeColorIndex((int)CommonFunc._FaceParts.NECK, 3); CommonFunc.ChangeColor_Neck(iIndex); break; case 10: case 11: case 12: break; } UIPanel panel; panel = GameObject.Find("Panel_Game").GetComponent <UIPanel>(); panel.Refresh(); } else //if (dragType == 1) { int iIndex; switch (CommonFunc.s_iScrollIndex) { case (int)CommonFunc._FaceParts.FACE: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.FACE, 3); CommonFunc.ChangeFaceParts_Face(iIndex); break; case (int)CommonFunc._FaceParts.HAIR: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.HAIR, 3); CommonFunc.ChangeFaceParts_Hair(iIndex); break; case (int)CommonFunc._FaceParts.EAR: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.EAR, 3); CommonFunc.ChangeFaceParts_Ear(iIndex); break; case (int)CommonFunc._FaceParts.EYEBLOW: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.EYEBLOW, 3); CommonFunc.ChangeFaceParts_Eyeblow(iIndex); break; case (int)CommonFunc._FaceParts.EYE: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.EYE, 3); CommonFunc.ChangeFaceParts_Eye(iIndex); break; case (int)CommonFunc._FaceParts.NOSE: Debug.Log("nose"); iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.NOSE, 3); CommonFunc.ChangeFaceParts_Nose(iIndex); break; case (int)CommonFunc._FaceParts.MOUTH: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.MOUTH, 3); CommonFunc.ChangeFaceParts_Mouth(iIndex); break; case (int)CommonFunc._FaceParts.HAIR_ACC: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.HAIR_ACC, 3); CommonFunc.ChangeFaceParts_HairAcc(iIndex); break; case (int)CommonFunc._FaceParts.FACE_ACC: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.FACE_ACC, 3); CommonFunc.ChangeFaceParts_FaceAcc(iIndex); break; case (int)CommonFunc._FaceParts.NECK: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.NECK, 3); CommonFunc.ChangeFaceParts_Neck(iIndex); break; case (int)CommonFunc._FaceParts.EMOTION: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.EMOTION, 3); //CommonFunc.ChangeFaceParts_Eye(iIndex); break; case (int)CommonFunc._FaceParts.TALK: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.TALK, 3); //CommonFunc.ChangeFaceParts_Eye(iIndex); break; case (int)CommonFunc._FaceParts.BG: iIndex = GetChangePartsIndex((int)CommonFunc._FaceParts.BG, 3); //CommonFunc.ChangeFaceParts_Eye(iIndex); break; } } blDrag = false; } else { Debug.Log("터치 누름"); } }
public void OnClick() { Debug.Log("Clicked Random Color Button"); int iRandom = 0; iRandom = Random.Range(0, 4); CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.EAR] = iRandom; CommonFunc.ChangeColor_Ear(CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.EAR]); iRandom = Random.Range(0, 4); CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.EYE] = iRandom; CommonFunc.ChangeColor_Eye(CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.EYE]); iRandom = Random.Range(0, 4); CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.EYEBLOW] = iRandom; CommonFunc.ChangeColor_Eyeblow(CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.EYEBLOW]); iRandom = Random.Range(0, 4); CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.FACE] = iRandom; CommonFunc.ChangeColor_Face(CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.FACE]); iRandom = Random.Range(0, 4); CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.FACE_ACC] = iRandom; CommonFunc.ChangeColor_FaceAcc(CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.FACE_ACC]); iRandom = Random.Range(0, 4); CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.HAIR] = iRandom; CommonFunc.ChangeColor_Hair(CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.HAIR]); iRandom = Random.Range(0, 4); CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.HAIR_ACC] = iRandom; CommonFunc.ChangeColor_HairAcc(CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.HAIR_ACC]); iRandom = Random.Range(0, 4); CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.NECK] = iRandom; CommonFunc.ChangeColor_Neck(CommonFunc.s_iColorIndex[(int)CommonFunc._FaceParts.NECK]); //mouth /* * iRandomR = Random.Range(0, 256); * iRandomG = Random.Range(0, 256); * iRandomB = Random.Range(0, 256); * Material MaterialMouth = Resources.Load("Atlas/mouth/mouthAtlas", typeof(Material)) as Material; * MaterialMouth.SetColor("_Color", ConvertColor(iRandomR, iRandomG, iRandomB)); */ //neck //iRandomR = CommonFunc.colorArray_neck[Random.Range(0, 4), 0]; //iRandomG = CommonFunc.colorArray_neck[Random.Range(0, 4), 1]; //iRandomB = CommonFunc.colorArray_neck[Random.Range(0, 4), 2]; //Material MaterialNeck = Resources.Load("Atlas/neck/neckAtlas", typeof(Material)) as Material; //MaterialNeck.SetColor("_Color", CommonFunc.ConvertColor(iRandomR, iRandomG, iRandomB)); //iRandomR = Random.Range(0, 256); //iRandomG = Random.Range(0, 256); //iRandomB = Random.Range(0, 256); //Material MaterialNeckMask = Resources.Load("Atlas/neck/neckMaskAtlas", typeof(Material)) as Material; //MaterialNeckMask.SetColor("_Color", CommonFunc.ConvertColor(iRandomR, iRandomG, iRandomB)); //nose /* * iRandomR = Random.Range(0, 256); * iRandomG = Random.Range(0, 256); * iRandomB = Random.Range(0, 256); * Material MaterialNose = Resources.Load("Atlas/nose/noseAtlas", typeof(Material)) as Material; * MaterialNose.SetColor("_Color", ConvertColor(iRandomR, iRandomG, iRandomB)); */ UIPanel panel; panel = GameObject.Find("Panel_Game").GetComponent <UIPanel>(); panel.Refresh(); }