|
@@ -40,7 +40,7 @@ public class CloseUnit
|
|
|
|
|
|
public string Description
|
|
|
{
|
|
|
- get { return Language.GetStr("DressRoom", ArmatureName); }
|
|
|
+ get { return Language.GetStr("DressRoom", "Armature" + ID); }
|
|
|
}
|
|
|
|
|
|
public int ID;
|
|
@@ -50,11 +50,14 @@ public class CloseUnit
|
|
|
public bool Bought;
|
|
|
public string ArmatureName;
|
|
|
|
|
|
+ public float IconOffset;
|
|
|
public Text BuyBtnLab;
|
|
|
public Sprite[] Sprites;
|
|
|
- public Image Icon;
|
|
|
+ public Image Icon1;
|
|
|
+ public Image Icon2;
|
|
|
public Button BuyBtn;
|
|
|
public Button DressBtn;
|
|
|
+ public Vector2 Icon1Offset;
|
|
|
public BodyPart BodyPart;
|
|
|
public Transform Transform;
|
|
|
public CloseType Type;
|
|
@@ -80,8 +83,10 @@ public class CloseUnit
|
|
|
BuyAdvanceCurrent = Auxiliary.CurrentParse(attribute[8].Value);
|
|
|
BuyAdvanceAmt = Auxiliary.DoubleParse(attribute[9].Value, 0);
|
|
|
PixelSize = Auxiliary.IntParse(attribute[10].Value, 100);
|
|
|
- Sprites = SpriteParse(attribute[11].Value);
|
|
|
- ArmatureName = attribute[12].Value;
|
|
|
+ IconOffset = Auxiliary.FloatParse(attribute[11].Value, 0);
|
|
|
+ Icon1Offset = Auxiliary.VectorParse(',', attribute[12].Value, new Vector3());
|
|
|
+ Sprites = SpriteParse(attribute[13].Value);
|
|
|
+ ArmatureName = attribute[14].Value;
|
|
|
|
|
|
ManaPlayer.CloseIDDic.Add(ArmatureName, ID);
|
|
|
ManaPlayer.CloseUnitDic.Add(ID, this);
|
|
@@ -123,18 +128,30 @@ public class CloseUnit
|
|
|
|
|
|
Auxiliary.CompileDic(Transform, ChildDic);
|
|
|
|
|
|
- Icon = ChildDic["Icon"].GetComponent<Image>();
|
|
|
+ Icon1 = ChildDic["Icon1"].GetComponent<Image>();
|
|
|
+ Icon2 = ChildDic["Icon2"].GetComponent<Image>();
|
|
|
DressBtn = ChildDic["CloseItem"].GetComponent<Button>();
|
|
|
BuyBtn = ChildDic["BuyBtn"].GetComponent<Button>();
|
|
|
BuyBtnLab = ChildDic["BuyBtnLab"].GetComponent<Text>();
|
|
|
|
|
|
|
|
|
- Icon.sprite = Sprites[0];
|
|
|
+ Icon2.sprite = Sprites[0];
|
|
|
|
|
|
- Icon.SetNativeSize();
|
|
|
+ float newSize = PixelSize / Icon2.sprite.rect.width;
|
|
|
+ Icon2.Resize(true, new Vector2(newSize, newSize));
|
|
|
|
|
|
- float newSize = PixelSize / Icon.sprite.rect.width;
|
|
|
- Icon.Resize(true, new Vector2(newSize, newSize));
|
|
|
+ Icon2.transform.localPosition = new Vector2(0, IconOffset);
|
|
|
+
|
|
|
+ if (Sprites.Length > 1)
|
|
|
+ {
|
|
|
+ Icon1.SetActive(true);
|
|
|
+
|
|
|
+ Icon1.sprite = Sprites[1];
|
|
|
+
|
|
|
+ Icon1.Resize(true, new Vector2(newSize, newSize));
|
|
|
+
|
|
|
+ Icon1.transform.localPosition = Icon1Offset*newSize + new Vector2(0, IconOffset);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
BuyBtnLab.text = Language.GetStr("UI", "P_BtnLab1");
|
|
@@ -147,10 +164,25 @@ public class CloseUnit
|
|
|
|
|
|
ManaReso.Get("Pa_Info").TweenForCG();
|
|
|
|
|
|
- Image image = ManaReso.Get<Image>("Pa_Icon");
|
|
|
+ Image image = ManaReso.Get<Image>("Pa_Icon2");
|
|
|
image.sprite = Sprites[0];
|
|
|
image.Resize(true, new Vector2(newSize, newSize));
|
|
|
|
|
|
+ if (Sprites.Length > 1)
|
|
|
+ {
|
|
|
+ ManaReso.SetActive("Pa_Icon1", true);
|
|
|
+
|
|
|
+ Image image1 = ManaReso.Get<Image>("Pa_Icon1");
|
|
|
+ image1.sprite = Sprites[1];
|
|
|
+ image1.Resize(true, new Vector2(newSize, newSize));
|
|
|
+
|
|
|
+ image1.transform.position = image.transform.position + (Vector3) Icon1Offset*newSize;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ManaReso.SetActive("Pa_Icon1", false);
|
|
|
+ }
|
|
|
+
|
|
|
ManaReso.SetText("Pa_Lab", Description);
|
|
|
ManaReso.SetText("Pa_BtnLab", Language.GetStr("UI", "Pa_BtnLab") + Auxiliary.ImageParse(BuyCurrent) + BuyAmt.ToString("0"));
|
|
|
|
|
@@ -354,11 +386,6 @@ public class Player : Regist , IPointerClickHandler
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void Update()
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
public void FixedUpdate()
|
|
|
{
|
|
|
if (InDressRoom)
|
|
@@ -573,7 +600,7 @@ public class Player : Regist , IPointerClickHandler
|
|
|
|
|
|
InDressRoom = true;
|
|
|
|
|
|
- JumpTime = Mathf.Lerp(0, JumpFrequency, Random.Range(0.5f, 1f));
|
|
|
+ JumpTime = Mathf.Lerp(0, 10, Random.Range(0.5f, 1f));
|
|
|
|
|
|
ManaCenter.SceneSwitchLock = true;
|
|
|
|
|
@@ -615,9 +642,26 @@ public class Player : Regist , IPointerClickHandler
|
|
|
EventType.ForwardFinish,
|
|
|
() =>
|
|
|
{
|
|
|
- ManaPlayer.InitializeDressRoom();
|
|
|
+ if (!ManaPlayer.DressRoomInitialized)
|
|
|
+ {
|
|
|
+ ManaReso.SetText("I_Lab", Language.GetStr("UI", "I_Lab"));
|
|
|
+ ManaReso.SetActive("I_Lab", true);
|
|
|
|
|
|
- ManaReso.Get("I_BlackMask").TweenForCG();
|
|
|
+ Auxiliary.Instance.DelayCall
|
|
|
+ (
|
|
|
+ () =>
|
|
|
+ {
|
|
|
+ ManaPlayer.InitializeDressRoom();
|
|
|
+
|
|
|
+ ManaReso.Get("I_BlackMask").TweenForCG();
|
|
|
+ },
|
|
|
+ 1
|
|
|
+ );
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ManaReso.Get("I_BlackMask").TweenForCG();
|
|
|
+ }
|
|
|
}
|
|
|
);
|
|
|
}
|
|
@@ -722,19 +766,23 @@ public class Player : Regist , IPointerClickHandler
|
|
|
|
|
|
transform.FindChild("Armature/" + Eye).SetLZ(-0.001f);
|
|
|
transform.FindChild("Armature/" + Top).SetLZ(-0.003f);
|
|
|
- transform.FindChild("Armature/" + Head).SetLZ(0);
|
|
|
transform.FindChild("Armature/" + Dress).SetLZ(-0.002f);
|
|
|
transform.FindChild("Armature/" + Mouse).SetLZ(-0.001f);
|
|
|
transform.FindChild("Armature/" + HeadWear).SetLZ(-0.001f);
|
|
|
|
|
|
- Transform shoeTra = transform.FindChild("Armature/" + Shoe);
|
|
|
- shoeTra.SetLZ(-0.001f);
|
|
|
+ Transform tempTra = transform.FindChild("Armature/" + Head);
|
|
|
+
|
|
|
+ tempTra.SetLZ(0);
|
|
|
+ tempTra.GetChild(0).SetLZ(0.002f);
|
|
|
+
|
|
|
+ tempTra = transform.FindChild("Armature/" + Shoe);
|
|
|
+ tempTra.SetLZ(-0.001f);
|
|
|
|
|
|
- transform.FindChild("Armature").GetChild(shoeTra.GetSiblingIndex() + 1).SetLZ(-0.001f);
|
|
|
+ transform.FindChild("Armature").GetChild(tempTra.GetSiblingIndex() + 1).SetLZ(-0.001f);
|
|
|
|
|
|
transform.FindChild("Armature/左腿").SetLZ(0);
|
|
|
transform.FindChild("Armature/右腿").SetLZ(0);
|
|
|
- transform.FindChild("Armature/脖子").SetLZ(0);
|
|
|
+ transform.FindChild("Armature/脖子").SetLZ(0.001f);
|
|
|
transform.FindChild("Armature/左手").SetLZ(-0.001f);
|
|
|
transform.FindChild("Armature/右手").SetLZ(-0.001f);
|
|
|
}
|