铁匠错误修复

This commit is contained in:
oldpeper 2024-10-31 17:37:01 +08:00
parent 9edf0c0202
commit af51781cac
8 changed files with 50 additions and 32 deletions

View File

@ -102,7 +102,7 @@ public class DragObject_Mon : MonoBehaviour, IDragHandler, IBeginDragHandler, IE
GameObject.FindGameObjectWithTag("铁匠玩家").GetComponent<BlacksmithPlayer_Mon>().dragmaterial(this.forgingMaterial_Mon.getId(), 1);
GameObject.FindGameObjectWithTag("铁匠玩家").GetComponent<BlacksmithPlayer_Mon>().SubmitWeapons(this.forgingMaterial_Mon.getId());
Destroy(this.gameObject);
Customer_Mon.ins.ButtonOn();
Customer_Mon.ins.ResetText();
Customer_Mon.ins.WaitTimeGetItem(this.forgingMaterial_Mon.getId()==id);
}
else

View File

@ -40,7 +40,6 @@ public class MaterialGroup_Mon : MonoBehaviour
GameObject go_= Instantiate(this.MaterialGameObject);
go_.transform.SetParent(this.transform);
go_.transform.localScale = new Vector3(1, 1, 1);
Debug.LogError(mun_);
go_.GetComponent<ForgingMaterial_Mon>().setArticle(article_, mun_);
}
private void Awake()

View File

@ -306,6 +306,8 @@ public class BlacksmithPlayer_Mon : MonoBehaviour
this.EquipmentSynthesisPath_Mon.CloseDrawing();
this.Checkout_Mon.StartCheckout();
this.customer_Mon.mode=false;
this.customer_Mon.CloseDoor();
this.customer_Mon.LoadGame();
}
@ -405,18 +407,22 @@ public class BlacksmithPlayer_Mon : MonoBehaviour
/// <param name="weapons_">武器</param>
public void SubmitWeapons(int weapons_)
{
if (this.blacksmith.clients.Count == 0)
if (this.blacksmith.clients.Count <= 0)
{
this.blacksmith.CloseDoor();
CloseShop();
LoadGame();
return;
}
int in_=this.blacksmith.SubmitOrder((Weapons)(this.FindArticleBoxs(weapons_)));
this.Checkout_Mon.AddIncome(in_);
this.Customer();
//刷新客人
this.customer_Mon.Renovate_Visitor();
this.LoadGameUI();
if (this.blacksmith.GetClient()!=null)
{
int in_ = this.blacksmith.SubmitOrder((Weapons)(this.FindArticleBoxs(weapons_)));
this.Checkout_Mon.AddIncome(in_);
this.Customer();
//ˢпÍÈË
this.customer_Mon.Renovate_Visitor();
this.LoadGameUI();
}
}
/// <summary>
/// 输入id返回材料或者武器的icon

View File

@ -178,6 +178,10 @@ public class Blacksmith
/// <returns>首位顾客的信息</returns>
public Client GetClient()
{
if (this.clients.Count==0)
{
return null;
}
return this.clients[0];
}
/// <summary>
@ -193,6 +197,7 @@ public class Blacksmith
/// </summary>
public void OpenShop()
{
Debug.LogError("WAIT");
this.blacksmithtype=BlacksmithType.WAIT;
}
/// <summary>
@ -200,12 +205,14 @@ public class Blacksmith
/// </summary>
public void Forging()
{
Debug.LogError("WORK");
this.blacksmithtype =BlacksmithType.WORK;
}
/// <summary>
/// 不结算,休息一下
/// </summary>
public void CloseDoor() {
Debug.LogError("CLOSEDOOR");
this.blacksmithtype=BlacksmithType.CLOSEDOOR;
}
/// <summary>
@ -213,6 +220,7 @@ public class Blacksmith
/// </summary>
public void CloseShop()
{
Debug.LogError("REST");
this.blacksmithtype = BlacksmithType.REST;
}
@ -225,7 +233,7 @@ public class Blacksmith
{
this.remove_clientfirst();
if (this.GetClient().getweaponid() == weapons_.getId())
if (this.GetClient()!=null && this.GetClient().getweaponid() == weapons_.getId())
{
Debug.Log("武器锻造正确,顾客很满意的离开了");
//this.add_money(weapons_.getweaponsmoney());

View File

@ -29,7 +29,7 @@ public class Door_Mon : MonoBehaviour, IPointerClickHandler
{
if (this.DoorState)
{
//this.CloseDoor();
this.CloseDoor();
}
else
{
@ -91,6 +91,7 @@ public class Door_Mon : MonoBehaviour, IPointerClickHandler
this.SetImageAlpha(200);
this.transform.Find("开始营业").GetComponent<SkeletonGraphic> ().AnimationState.SetAnimation(0, "rc_1", false);
this.transform.Find("bg").GetComponent<Image>().raycastTarget = false;
Customer_Mon.ins.CloseDoor();
//GameObject.FindGameObjectWithTag("铁匠玩家").GetComponent<BlacksmithPlayer_Mon>().Door();
}
private void SetImageAlpha(int alpha)

View File

@ -41,7 +41,7 @@ public class Customer_Mon : MonoBehaviour
{
ins = this;
}
private void LoadGame()
public void LoadGame()
{
this.CustomerGame = this.transform.Find("顾客").gameObject;
this.CloseButton= this.transform.Find("开门营业_闭门谢客").gameObject;
@ -111,6 +111,10 @@ public class Customer_Mon : MonoBehaviour
}
}
public void ResetText()
{
this.SurplusPopulation.text = "剩余人数:" + GameObject.Find("铁匠玩家").GetComponent<BlacksmithPlayer_Mon>().GetClientsLength();
}
public void WaitTimeGetItem(bool bo)
{
waitTime = true;

Binary file not shown.

View File

@ -121,7 +121,7 @@ MonoBehaviour:
m_MinSize: {x: 350, y: 421}
m_MaxSize: {x: 4000, y: 4021}
vertical: 0
controlID: 445
controlID: 38
draggingID: 0
--- !u!114 &6
MonoBehaviour:
@ -142,8 +142,8 @@ MonoBehaviour:
y: 0
width: 1331
height: 914
m_MinSize: {x: 100, y: 100}
m_MaxSize: {x: 4000, y: 4000}
m_MinSize: {x: 100, y: 121}
m_MaxSize: {x: 4000, y: 4021}
m_ActualView: {fileID: 20}
m_Panes:
- {fileID: 20}
@ -198,7 +198,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 100}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 116
controlID: 226
draggingID: 0
--- !u!114 &9
MonoBehaviour:
@ -219,8 +219,8 @@ MonoBehaviour:
y: 0
width: 472
height: 939
m_MinSize: {x: 275, y: 50}
m_MaxSize: {x: 4000, y: 4000}
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 22}
m_Panes:
- {fileID: 22}
@ -271,8 +271,8 @@ MonoBehaviour:
y: 439
width: 1448
height: 500
m_MinSize: {x: 100, y: 100}
m_MaxSize: {x: 4000, y: 4000}
m_MinSize: {x: 101, y: 121}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 25}
m_Panes:
- {fileID: 21}
@ -374,7 +374,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 69
controlID: 158
draggingID: 0
--- !u!114 &16
MonoBehaviour:
@ -400,7 +400,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 50}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 70
controlID: 159
draggingID: 0
--- !u!114 &17
MonoBehaviour:
@ -421,8 +421,8 @@ MonoBehaviour:
y: 0
width: 1096
height: 439
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 24}
m_Panes:
- {fileID: 24}
@ -684,7 +684,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 6c6f0000
m_LastClickedID: 28524
m_ExpandedIDs: 000000006a6f00006c6f00006e6f0000706f0000726f0000746f0000766f000000ca9a3bffffff7f
m_ExpandedIDs:
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -712,7 +712,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 000000006a6f00006c6f00006e6f0000706f0000726f0000746f0000766f0000
m_ExpandedIDs:
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -852,9 +852,9 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: a8650000
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 46e3ffff90e3ffff76e8ffff16fbffff
m_ExpandedIDs: 14fbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -1273,7 +1273,7 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 154.26889, y: 855.7815, z: -3.357976}
m_Target: {x: 763.59906, y: 1324.3041, z: -2.189849}
speed: 2
m_Value: {x: 154.26889, y: 855.7815, z: -3.357976}
m_RenderMode: 0
@ -1325,7 +1325,7 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 392.36636
m_Target: 551.5217
speed: 2
m_Value: 392.36636
m_Ortho: