2301 lines
76 KiB
C#
2301 lines
76 KiB
C#
|
|
using System.Collections;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using UnityEngine;
|
|||
|
|
using UnityEngine.EventSystems;
|
|||
|
|
using UnityEngine.UI;
|
|||
|
|
using System.Linq;
|
|||
|
|
using DG.Tweening;
|
|||
|
|
|
|||
|
|
public class ZX4Controller : MonoBehaviour
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ʳԤ<CAB3><D4A4><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public GameObject preFood;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public GameObject preOp;
|
|||
|
|
/// <summary>
|
|||
|
|
/// ѡ<><D1A1>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public GameObject preSelected;
|
|||
|
|
/// <summary>
|
|||
|
|
/// ʳ<><CAB3>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public GameObject preFoodMat;
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>
|
|||
|
|
public Transform tranStepCenter;
|
|||
|
|
|
|||
|
|
public UICircle imgSemi;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ʳ<EFBFBD><CAB3><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public Transform foodsContainer;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// ʳ<><CAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public Transform matContainer;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>⿷<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public Transform opContainer;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>رհ<D8B1>ť
|
|||
|
|
/// </summary>
|
|||
|
|
public Button closeButton;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD>ذ<EFBFBD>ť
|
|||
|
|
/// </summary>
|
|||
|
|
public Button backButton;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť
|
|||
|
|
/// </summary>
|
|||
|
|
public Button startButton;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť
|
|||
|
|
/// </summary>
|
|||
|
|
public Button quitGameButton;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť
|
|||
|
|
/// </summary>
|
|||
|
|
public Button okButton;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ϸ_ͼƬ
|
|||
|
|
/// </summary>
|
|||
|
|
public Image foodImage;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ϸ_<CFB8><5F>ʳ<EFBFBD><CAB3><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public Text foodNameText;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ϸ_<CFB8><5F><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public Text descriptionText;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>м<EFBFBD>Բ<EFBFBD><D4B2><EFBFBD>İ뾶
|
|||
|
|
/// </summary>
|
|||
|
|
public float radius = 50f;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// ʳ<>ı<EFBFBD><C4B1><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public Sprite bgMat;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public Sprite bgOp;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>м<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public Sprite bgCenter;
|
|||
|
|
|
|||
|
|
|
|||
|
|
private bool IsShowTip;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20>ļ<EFBFBD>·<EFBFBD><C2B7>
|
|||
|
|
/// </summary>
|
|||
|
|
private string basePath;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// ѡ<>е<EFBFBD>ʳ<EFBFBD><CAB3>Food<6F><64><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
private Food selectedFood;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ʳ<EFBFBD><CAB3><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
private List<FoodData> foodDataList;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
private Animator animator;
|
|||
|
|
|
|||
|
|
//<2F><>ʾ<EFBFBD><CABE>ť
|
|||
|
|
public Button btnTip;
|
|||
|
|
//<2F>ر<EFBFBD><D8B1><EFBFBD>ʾ<EFBFBD><CABE>
|
|||
|
|
public Button btnCloseTip;
|
|||
|
|
//<2F><>ʾ<EFBFBD><CABE>
|
|||
|
|
public GameObject pnlTip;
|
|||
|
|
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>
|
|||
|
|
public Text txtTip;
|
|||
|
|
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
public Text txtFoodNameTip;
|
|||
|
|
|
|||
|
|
//<2F>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
|||
|
|
public GameObject mainfoodlist;
|
|||
|
|
public GameObject foodlistmat;
|
|||
|
|
public GameObject foodlistop;
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
public GameObject StepCenter;
|
|||
|
|
public GameObject promptMat;
|
|||
|
|
public GameObject promptOp;
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
public GameObject cookingAnimation;
|
|||
|
|
public int animationmark;
|
|||
|
|
|
|||
|
|
//±<>ⷹ<EFBFBD><E2B7B9><EFBFBD><EFBFBD>
|
|||
|
|
public GameObject Chaoluroufan;
|
|||
|
|
public GameObject Luluroufan;
|
|||
|
|
public GameObject Zhuanpanluroufan;
|
|||
|
|
//<2F><><EFBFBD>м嶯<D0BC><E5B6AF>
|
|||
|
|
public GameObject Jiaobankezaijian;
|
|||
|
|
public GameObject Jiaobankezaijian2;
|
|||
|
|
public GameObject Jiankezaijian;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>涯<EFBFBD><E6B6AF>
|
|||
|
|
public GameObject Jiaobandanzaimian;
|
|||
|
|
public GameObject Zhudanzaimian;
|
|||
|
|
public GameObject Jiaobandanzaimian2;
|
|||
|
|
//<2F><><EFBFBD>ն<EFBFBD><D5B6><EFBFBD>
|
|||
|
|
public GameObject Jinpaorouzong;
|
|||
|
|
public GameObject Zhurouzong;
|
|||
|
|
public GameObject Baorouzong;
|
|||
|
|
public GameObject Zhurouzong2;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>涯<EFBFBD><E6B6AF>
|
|||
|
|
public GameObject Lukezaimian;
|
|||
|
|
public GameObject Zhukezaimian;
|
|||
|
|
public GameObject Zhukezaimian2;
|
|||
|
|
//̨<>峴<EFBFBD>۶<D7B7><DBB6><EFBFBD>
|
|||
|
|
public GameObject Chaochaomifen;
|
|||
|
|
public GameObject Jianchaomifen;
|
|||
|
|
public GameObject Chaochaomifen2;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ﱶ<EFBFBD><EFB1B6><EFBFBD>
|
|||
|
|
public GameObject Jiaobandingbiancuo;
|
|||
|
|
public GameObject Zhudingbiancuo;
|
|||
|
|
public GameObject Zhuangpandingbiancuo;
|
|||
|
|
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
public GameObject Jiandoufu;
|
|||
|
|
public GameObject Chaodoufu;
|
|||
|
|
public GameObject Zhudoufu;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㶯<EFBFBD><E3B6AF>
|
|||
|
|
public GameObject Zhuzhuti;
|
|||
|
|
public GameObject Chaozhuti;
|
|||
|
|
public GameObject Zhuzhuti2;
|
|||
|
|
//<2F><><EFBFBD>ɲݶ<C9B2><DDB6><EFBFBD>
|
|||
|
|
public GameObject Zhengshaoxiancao;
|
|||
|
|
public GameObject Zhushaoxiancao;
|
|||
|
|
public GameObject Zhuangpanshaoxiancao;
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
//±<>ⷹ<EFBFBD><E2B7B9><EFBFBD><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
public GameObject luroufanTransform;
|
|||
|
|
public GameObject onions;
|
|||
|
|
public GameObject mushroom;
|
|||
|
|
public GameObject pork;
|
|||
|
|
public GameObject rice;
|
|||
|
|
//<2F><><EFBFBD>м嶯<D0BC><E5B6AF><EFBFBD>ز<EFBFBD>
|
|||
|
|
public GameObject kezaijianTransform;
|
|||
|
|
public GameObject egg;
|
|||
|
|
public GameObject oysters;
|
|||
|
|
public GameObject eggliquid;
|
|||
|
|
public GameObject oyster2;
|
|||
|
|
public GameObject onionskezaijian;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>涯<EFBFBD><E6B6AF><EFBFBD>ز<EFBFBD>
|
|||
|
|
public GameObject danzaimianTransform;
|
|||
|
|
public GameObject porkdanzaimian;
|
|||
|
|
public GameObject noodles;
|
|||
|
|
public GameObject noodles2;
|
|||
|
|
public GameObject shrimpdanzaimian;
|
|||
|
|
public GameObject coriander;
|
|||
|
|
//<2F><><EFBFBD>ն<EFBFBD><D5B6><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
public GameObject zongziTransform;
|
|||
|
|
public GameObject ricezongzi;
|
|||
|
|
public GameObject onionszongzi;
|
|||
|
|
public GameObject mushroomzongzi;
|
|||
|
|
public GameObject porkzongzi;
|
|||
|
|
public GameObject ricezongzi2;
|
|||
|
|
public GameObject leaves;
|
|||
|
|
public GameObject zongzi;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>涯<EFBFBD><E6B6AF><EFBFBD>ز<EFBFBD>
|
|||
|
|
public GameObject kezaimianTransform;
|
|||
|
|
public GameObject intestine;
|
|||
|
|
public GameObject oysterskezaimian;
|
|||
|
|
public GameObject nooldeskezaimian;
|
|||
|
|
//̨<>峴<EFBFBD>۶<D7B7><DBB6><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
public GameObject chaomifenTransform;
|
|||
|
|
public GameObject onionschaomifen;
|
|||
|
|
public GameObject mushroomchaomifen;
|
|||
|
|
public GameObject porkchaomifen;
|
|||
|
|
public GameObject eggchaomifen;
|
|||
|
|
public GameObject flour;
|
|||
|
|
public GameObject onionschaomifen2;
|
|||
|
|
public GameObject mushroomchaomifen2;
|
|||
|
|
public GameObject porkchaomifen2;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ﱶ<EFBFBD><EFB1B6><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
public GameObject dingbiancuoTransform;
|
|||
|
|
public GameObject powderdingbiancuo;
|
|||
|
|
public GameObject mushroomdingbiancuo;
|
|||
|
|
public GameObject shrimpdingbiancuo;
|
|||
|
|
public GameObject oysterdingbiancuo;
|
|||
|
|
public GameObject chive;
|
|||
|
|
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
public GameObject doufuTransform;
|
|||
|
|
public GameObject doufu;
|
|||
|
|
public GameObject garlic;
|
|||
|
|
public GameObject doufu2;
|
|||
|
|
public GameObject garlic2;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㶯<EFBFBD><E3B6AF><EFBFBD>ز<EFBFBD>
|
|||
|
|
public GameObject zhutiTransform;
|
|||
|
|
public GameObject trotters;
|
|||
|
|
public GameObject candy;
|
|||
|
|
public GameObject trotters2;
|
|||
|
|
public GameObject trotters3;
|
|||
|
|
//<2F><><EFBFBD>ɲݶ<C9B2><DDB6><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
public GameObject shaoxiancaoTransform;
|
|||
|
|
public GameObject potato;
|
|||
|
|
public GameObject ball;
|
|||
|
|
public GameObject pearl;
|
|||
|
|
public GameObject grass;
|
|||
|
|
public GameObject milk;
|
|||
|
|
public GameObject ball2;
|
|||
|
|
public GameObject pearl2;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
public int animationloadmark;
|
|||
|
|
|
|||
|
|
//ѡ<><D1A1>ʳ<EFBFBD>ױ<EFBFBD><D7B1><EFBFBD>
|
|||
|
|
public int currentSelected;
|
|||
|
|
//ʳ<><CAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
public int step;
|
|||
|
|
//<2F><>̨<EFBFBD><CCA8><EFBFBD><EFBFBD>ͼ
|
|||
|
|
public GameObject wok;
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>Ʒͼ
|
|||
|
|
//±<>ⷹ<EFBFBD><E2B7B9><EFBFBD><EFBFBD>Ʒ
|
|||
|
|
public GameObject semiluroufan1;
|
|||
|
|
public GameObject semiluroufan2;
|
|||
|
|
//<2F><><EFBFBD>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD>Ʒ
|
|||
|
|
public GameObject semikezaijian1;
|
|||
|
|
public GameObject semikezaijian2;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ
|
|||
|
|
public GameObject semidaizaimian1;
|
|||
|
|
public GameObject semidanzaimian2;
|
|||
|
|
//<2F><><EFBFBD>հ<EFBFBD><D5B0><EFBFBD>Ʒ
|
|||
|
|
public GameObject semirouzong1;
|
|||
|
|
public GameObject semirouzong2;
|
|||
|
|
public GameObject semirouzong3;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ
|
|||
|
|
public GameObject semikezaimian1;
|
|||
|
|
public GameObject semikezaimian2;
|
|||
|
|
//̨<>峴<EFBFBD>۰<D7B7><DBB0><EFBFBD>Ʒ
|
|||
|
|
public GameObject semichaomifen1;
|
|||
|
|
public GameObject semichaomifen2;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ﱰ<EFBFBD><EFB1B0><EFBFBD>Ʒ
|
|||
|
|
public GameObject semidingbiancuo1;
|
|||
|
|
public GameObject semidingbiancuo2;
|
|||
|
|
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ
|
|||
|
|
public GameObject semidoufu1;
|
|||
|
|
public GameObject semidoufu2;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ
|
|||
|
|
public GameObject semizhuti1;
|
|||
|
|
public GameObject semizhuti2;
|
|||
|
|
//<2F><><EFBFBD>ɲݰ<C9B2><DDB0><EFBFBD>Ʒ
|
|||
|
|
public GameObject semishaoxiancao1;
|
|||
|
|
public GameObject semishaoxaincao2;
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//<2F><>ȷʳ<C8B7><CAB3>
|
|||
|
|
public string[] Matlist;
|
|||
|
|
public int Matitem;
|
|||
|
|
public int MatTrue;
|
|||
|
|
public int MatTest;
|
|||
|
|
//<2F><>ȷ<EFBFBD><C8B7>⿷<EFBFBD><E2BFB7><EFBFBD>
|
|||
|
|
public string[] Oplist;
|
|||
|
|
public int Opitem;
|
|||
|
|
public int OpTrue;
|
|||
|
|
public int OpTest;
|
|||
|
|
|
|||
|
|
void Start()
|
|||
|
|
{
|
|||
|
|
foodDataList = new List<FoodData>();
|
|||
|
|
animator = this.GetComponent<Animator>();
|
|||
|
|
|
|||
|
|
//<2F>ļ<EFBFBD>·<EFBFBD><C2B7>
|
|||
|
|
basePath = CommonData.DataServer + "/ZX4/Data/";
|
|||
|
|
|
|||
|
|
//<2F><>ť<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
closeButton.onClick.AddListener(onCloseButtonClick);
|
|||
|
|
backButton.onClick.AddListener(onBackButtonClick);
|
|||
|
|
startButton.onClick.AddListener(onStartButtonClick);
|
|||
|
|
quitGameButton.onClick.AddListener(onQuitGameButtonClick);
|
|||
|
|
okButton.onClick.AddListener(onQuitGameButtonClick);
|
|||
|
|
btnTip.onClick.AddListener(onBtnTipClick);
|
|||
|
|
btnCloseTip.onClick.AddListener(onBtnCloseTipClick);
|
|||
|
|
|
|||
|
|
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|||
|
|
StartCoroutine(JsonLoader.LoadJSON(basePath + "Foods.json", onFoodDataReceived));
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ʼλ<CABC>ø<EFBFBD><C3B8><EFBFBD>
|
|||
|
|
wok.transform.SetParent(txtFoodName.gameObject.transform);
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼλ<CABC>ø<EFBFBD><C3B8><EFBFBD>
|
|||
|
|
cookingAnimation.transform.SetParent(txtFoodName.gameObject.transform);
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void Update()
|
|||
|
|
{
|
|||
|
|
//<2F><>ҳ<EFBFBD><D2B3>ʳ<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
|||
|
|
if (mainfoodlist.transform.localPosition.x>0)
|
|||
|
|
{
|
|||
|
|
mainfoodlist.transform.localPosition = new Vector2(0, 0);
|
|||
|
|
}
|
|||
|
|
else if (mainfoodlist.transform.localPosition.x<(- (mainfoodlist.transform.childCount/3)*254))
|
|||
|
|
{
|
|||
|
|
mainfoodlist.transform.localPosition = new Vector2( - (mainfoodlist.transform.childCount/3) * 254,0);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//ʳ<><CAB3><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
|||
|
|
if (foodlistmat.transform.localPosition.y < 0)
|
|||
|
|
{
|
|||
|
|
foodlistmat.transform.localPosition = new Vector2(0, 0);
|
|||
|
|
}
|
|||
|
|
else if (foodlistmat.transform.localPosition.y > foodlistmat.transform.childCount*80)
|
|||
|
|
{
|
|||
|
|
foodlistmat.transform.localPosition = new Vector2(0, foodlistmat.transform.childCount * 80);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><>⿷<EFBFBD>ʽ<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
|||
|
|
|
|||
|
|
if (foodlistop.transform.localPosition.y < 0)
|
|||
|
|
{
|
|||
|
|
foodlistop.transform.localPosition = new Vector2(0, 0);
|
|||
|
|
}
|
|||
|
|
else if (foodlistop.transform.localPosition.y > foodlistop.transform.childCount*80)
|
|||
|
|
{
|
|||
|
|
foodlistop.transform.localPosition = new Vector2(0,foodlistop.transform.childCount * 80);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ҳ<EFBFBD><D2B3>ʳ<EFBFBD><CAB3><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="data"><3E><>ʳ<EFBFBD><CAB3><EFBFBD><EFBFBD></param>
|
|||
|
|
private void onFoodDataReceived(string data)
|
|||
|
|
{
|
|||
|
|
foodDataList = JsonTools.ListFromJson<FoodData>(data);
|
|||
|
|
foodsContainer.DetachChildren();
|
|||
|
|
|
|||
|
|
//<2F><>ҳ<EFBFBD><D2B3>ʳ<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
foreach (var fData in foodDataList)
|
|||
|
|
{
|
|||
|
|
GameObject foodItem = Instantiate(preFood, foodsContainer);
|
|||
|
|
Food food = foodItem.GetComponent<Food>();
|
|||
|
|
food.Data = fData;
|
|||
|
|
food.button.onClick.AddListener(onFoodSelected);
|
|||
|
|
}
|
|||
|
|
//ShowFoods();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
int index;
|
|||
|
|
|
|||
|
|
public void ShowFoods()
|
|||
|
|
{
|
|||
|
|
if (foodDataList != null && foodDataList.Count > 0)
|
|||
|
|
{
|
|||
|
|
GameObject foodItem = Instantiate(preFood, foodsContainer);
|
|||
|
|
Food food = foodItem.GetComponent<Food>();
|
|||
|
|
food.Data = foodDataList[index];
|
|||
|
|
food.button.onClick.AddListener(onFoodSelected);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|||
|
|
Tween myTween = foodItem.GetComponent<Image>().DOColor(new Color(255, 255, 255, 255), 0.5f);
|
|||
|
|
myTween.SetEase(Ease.OutQuint);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>ŵ<EFBFBD>1<EFBFBD><31>
|
|||
|
|
Tween myTween2 = foodItem.transform.DOScale(Vector3.one, 0.5f);
|
|||
|
|
myTween2.SetEase(Ease.OutQuint);
|
|||
|
|
|
|||
|
|
index++;
|
|||
|
|
if (index < foodDataList.Count)
|
|||
|
|
{
|
|||
|
|
Invoke("ShowFoods", 1f);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// ѡ<><D1A1><EFBFBD><EFBFBD>ʳ<EFBFBD><CAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public void onFoodSelected()
|
|||
|
|
{
|
|||
|
|
GameObject gameObject = EventSystem.current.currentSelectedGameObject;
|
|||
|
|
currentSelected = int.Parse(gameObject.GetComponent<Food>().Data.id);
|
|||
|
|
Food food = gameObject.GetComponent<Food>();
|
|||
|
|
if (selectedFood != null)
|
|||
|
|
{
|
|||
|
|
selectedFood.objBgImage.SetActive(false);
|
|||
|
|
}
|
|||
|
|
food.objBgImage.SetActive(true);
|
|||
|
|
|
|||
|
|
foodImage.sprite = food.foodImage.sprite;
|
|||
|
|
foodNameText.text = food.nameText.text;
|
|||
|
|
txtFoodName.text = food.nameText.text;
|
|||
|
|
txtFoodName2.text = food.nameText.text;
|
|||
|
|
descriptionText.text = food.Data.description;
|
|||
|
|
descriptionText.rectTransform.anchoredPosition = new Vector2(0f, -699f);
|
|||
|
|
matContainer.GetComponent<RectTransform>().anchoredPosition = Vector2.zero;
|
|||
|
|
opContainer.GetComponent<RectTransform>().anchoredPosition = Vector2.zero;
|
|||
|
|
|
|||
|
|
selectedFood = food;
|
|||
|
|
animator.SetTrigger("ShowFoodInfo1");
|
|||
|
|
PlayAudioByName("ҳ<><D2B3><EFBFBD>л<EFBFBD>");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void onBackButtonClick()
|
|||
|
|
{
|
|||
|
|
step = 0;
|
|||
|
|
animator.SetTrigger("ShowFoodList");
|
|||
|
|
PlayAudioByName("ҳ<><D2B3><EFBFBD>л<EFBFBD>");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
List<FoodStepData> allMatSteps;
|
|||
|
|
List<FoodStepData> allOpSteps;
|
|||
|
|
List<FoodStepData> selectedSteps;
|
|||
|
|
List<GameObject> objSteps;
|
|||
|
|
int currentStepIndex;
|
|||
|
|
int currentObjIndex;
|
|||
|
|
GameObject currentStepObj;
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
public Text txtFoodName;
|
|||
|
|
|
|||
|
|
//<2F>ɹ<EFBFBD>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
public Text txtFoodName2;
|
|||
|
|
|
|||
|
|
//<2F>ɹ<EFBFBD>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD>ƷͼƬ<CDBC><C6AC>ʾ
|
|||
|
|
public RawImage imgFood;
|
|||
|
|
|
|||
|
|
//ѡ<><EFBFBD><F1B1B3BE><EFBFBD>
|
|||
|
|
public GameObject objSelectedMatBg;
|
|||
|
|
public GameObject objSelectedOpBg;
|
|||
|
|
|
|||
|
|
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
/// <summary>
|
|||
|
|
/// ʳ<><CAB3><EFBFBD><EFBFBD>ʾ
|
|||
|
|
/// </summary>
|
|||
|
|
public GameObject objTipMat;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>⿷<EFBFBD>ʽ<EFBFBD><CABD>ʾ
|
|||
|
|
/// </summary>
|
|||
|
|
public GameObject objTipOp;
|
|||
|
|
|
|||
|
|
GameObject tip;
|
|||
|
|
|
|||
|
|
bool isBegin = true;
|
|||
|
|
|
|||
|
|
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ʾ
|
|||
|
|
void ShowTip(GameObject objTip, float showTime = 1.5f)
|
|||
|
|
{
|
|||
|
|
IsShowTip = true;
|
|||
|
|
tip = objTip;
|
|||
|
|
objTip.SetActive(true);
|
|||
|
|
Invoke("HideTip", showTime);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void HideTip()
|
|||
|
|
{
|
|||
|
|
IsShowTip = false;
|
|||
|
|
tip.SetActive(false);
|
|||
|
|
if (isBegin)
|
|||
|
|
{
|
|||
|
|
ShowTip(objTipOp, 3f);
|
|||
|
|
isBegin = false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
//<2F><>Ϸ<EFBFBD><CFB7>ʼ
|
|||
|
|
private void onStartButtonClick()
|
|||
|
|
{
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD>Ʒʱ<C6B7><CAB1><EFBFBD>г<EFBFBD>ʼ<EFBFBD><CABC>
|
|||
|
|
if (step==0)
|
|||
|
|
{
|
|||
|
|
animator.SetTrigger("ShowGame");
|
|||
|
|
PlayAudioByName("ҳ<><D2B3><EFBFBD>л<EFBFBD>");
|
|||
|
|
animationloadmark = 0;
|
|||
|
|
luroufanTransform.SetActive(false);
|
|||
|
|
kezaijianTransform.SetActive(false);
|
|||
|
|
danzaimianTransform.SetActive(false);
|
|||
|
|
zongziTransform.SetActive(false);
|
|||
|
|
chaomifenTransform.SetActive(false);
|
|||
|
|
dingbiancuoTransform.SetActive(false);
|
|||
|
|
doufuTransform.SetActive(false);
|
|||
|
|
zhutiTransform.SetActive(false);
|
|||
|
|
shaoxiancaoTransform.SetActive(false);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><>ʼ<EFBFBD><CABC>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
foreach (Transform child in matContainer)
|
|||
|
|
{
|
|||
|
|
Destroy(child.gameObject);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//ѡ<><EFBFBD><F1B1B3BE><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>
|
|||
|
|
objSelectedMatBg.transform.SetParent(matContainer.parent);
|
|||
|
|
objSelectedMatBg.SetActive(false);
|
|||
|
|
|
|||
|
|
//<2F><>ʼ<EFBFBD><CABC>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
foreach (Transform child in opContainer)
|
|||
|
|
{
|
|||
|
|
Destroy(child.gameObject);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//ѡ<><EFBFBD><F1B1B3BE><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>
|
|||
|
|
objSelectedOpBg.transform.SetParent(opContainer.parent);
|
|||
|
|
objSelectedOpBg.SetActive(false);
|
|||
|
|
foreach (Transform child in tranStepCenter)
|
|||
|
|
{
|
|||
|
|
Destroy(child.gameObject);
|
|||
|
|
}
|
|||
|
|
allMatSteps = null;
|
|||
|
|
allOpSteps = null;
|
|||
|
|
selectedSteps = null;
|
|||
|
|
objSteps = null;
|
|||
|
|
|
|||
|
|
Matitem = 0;
|
|||
|
|
MatTrue = 0;
|
|||
|
|
string[] Matlist = new string[10];
|
|||
|
|
|
|||
|
|
Opitem = 0;
|
|||
|
|
OpTrue = 0;
|
|||
|
|
string[] Oplist = new string[10];
|
|||
|
|
|
|||
|
|
tranStepCenter.gameObject.SetActive(false);
|
|||
|
|
|
|||
|
|
// <20><>һ<EFBFBD>γ<EFBFBD>ʼ<EFBFBD><CABC>ʳ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>⿷<EFBFBD>ʽ
|
|||
|
|
if (allMatSteps == null || allOpSteps == null)
|
|||
|
|
{
|
|||
|
|
allMatSteps = new List<FoodStepData>();
|
|||
|
|
allOpSteps = new List<FoodStepData>();
|
|||
|
|
foreach (var fData in foodDataList)
|
|||
|
|
{
|
|||
|
|
foreach (var step in fData.steps)
|
|||
|
|
{
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⿲<EFBFBD><E2BFB2><EFBFBD>
|
|||
|
|
if (step.type == "1" && !allMatSteps.Any(tmpStep => tmpStep.name.Equals(step.name)))
|
|||
|
|
{
|
|||
|
|
allMatSteps.Add(step);
|
|||
|
|
}
|
|||
|
|
if (step.type == "2" && !allOpSteps.Any(tmpStep => tmpStep.name.Equals(step.name)))
|
|||
|
|
{
|
|||
|
|
allOpSteps.Add(step);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
selectedSteps = selectedFood.Data.steps;
|
|||
|
|
objSteps = new List<GameObject>();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//tranStepCenter.DetachChildren();
|
|||
|
|
var step12 = selectedFood.Data.steps.Where(step => step.type == "1" || step.type == "2").ToList();
|
|||
|
|
|
|||
|
|
for (int i = 0; i < step12.Count; i++)
|
|||
|
|
{
|
|||
|
|
float angle = i * Mathf.PI * 2f / step12.Count;
|
|||
|
|
Vector3 pos = new Vector3(Mathf.Cos(angle) * radius, Mathf.Sin(angle) * radius, 0);
|
|||
|
|
GameObject obj = Instantiate(preSelected, pos, Quaternion.identity);
|
|||
|
|
obj.transform.SetParent(tranStepCenter, false);
|
|||
|
|
//obj.transform.GetChild(0).GetComponent<RawImage>().color =
|
|||
|
|
// = step12[i].type == "1" ? Color.green : Color.yellow;
|
|||
|
|
FoodStepInitial(obj, step12[i], false, i + 1);
|
|||
|
|
objSteps.Add(obj);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//ʳ<><CAB3>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//matContainer.DetachChildren();
|
|||
|
|
foreach (var item in allMatSteps)
|
|||
|
|
{
|
|||
|
|
for (int i = 0; i < step12.Count; i++)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
if (item.name==step12[i].name)
|
|||
|
|
{
|
|||
|
|
Matlist[MatTrue] = step12[i].name;
|
|||
|
|
MatTrue++;
|
|||
|
|
GameObject obj = Instantiate(preFoodMat, matContainer);
|
|||
|
|
FoodStepInitial(obj, item);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
Matitem++;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var matfalse = 0;
|
|||
|
|
foreach (var item in allMatSteps)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
var matdifferent = 0;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɸ<EFBFBD><C9B8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
for (int i = 0; i < MatTrue; i++)
|
|||
|
|
{
|
|||
|
|
if (item.name != Matlist[i])
|
|||
|
|
{
|
|||
|
|
matdifferent++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (Random.Range(1, 100) > 70 && matfalse < 3&&matdifferent==MatTrue)
|
|||
|
|
{
|
|||
|
|
matfalse++;
|
|||
|
|
matdifferent = 0;
|
|||
|
|
GameObject obj = Instantiate(preFoodMat, matContainer);
|
|||
|
|
FoodStepInitial(obj, item);
|
|||
|
|
}
|
|||
|
|
MatTest++;
|
|||
|
|
}
|
|||
|
|
TransRandom(matContainer);
|
|||
|
|
//<2F><>⿷<EFBFBD>ʽԤ<CABD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//opContainer.DetachChildren();
|
|||
|
|
foreach (var item in allOpSteps)
|
|||
|
|
{
|
|||
|
|
for (int i = 0; i < step12.Count; i++)
|
|||
|
|
{
|
|||
|
|
if (item.name == step12[i].name)
|
|||
|
|
{
|
|||
|
|
Oplist[OpTrue] = step12[i].name;
|
|||
|
|
OpTrue++;
|
|||
|
|
GameObject obj = Instantiate(preOp, opContainer);
|
|||
|
|
FoodStepInitial(obj, item);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
Opitem++;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var opfalse = 0;
|
|||
|
|
foreach (var item in allOpSteps)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
var opdifferent = 0;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɸ<EFBFBD><C9B8><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
for (int i = 0; i < OpTrue; i++)
|
|||
|
|
{
|
|||
|
|
if (item.name != Oplist[i])
|
|||
|
|
{
|
|||
|
|
opdifferent++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (Random.Range(1, 100) > 60 && opfalse < 2 && opdifferent == OpTrue)
|
|||
|
|
{
|
|||
|
|
opfalse++;
|
|||
|
|
opdifferent = 0;
|
|||
|
|
GameObject obj = Instantiate(preOp, opContainer);
|
|||
|
|
FoodStepInitial(obj, item);
|
|||
|
|
}
|
|||
|
|
OpTest++;
|
|||
|
|
}
|
|||
|
|
TransRandom(opContainer);
|
|||
|
|
|
|||
|
|
currentObjIndex = 0;
|
|||
|
|
currentStepIndex = 0;
|
|||
|
|
currentStepObj = objSteps[currentObjIndex];
|
|||
|
|
|
|||
|
|
//<2F>趨ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD>
|
|||
|
|
Sprite sp = selectedFood.foodImage.sprite;
|
|||
|
|
Texture2D tex = new Texture2D((int)sp.rect.width, (int)sp.rect.height, TextureFormat.RGBA32, false);
|
|||
|
|
tex.filterMode = FilterMode.Point;
|
|||
|
|
tex.wrapMode = TextureWrapMode.Clamp;
|
|||
|
|
tex.SetPixels(sp.texture.GetPixels(
|
|||
|
|
(int)sp.textureRect.x,
|
|||
|
|
(int)sp.textureRect.y,
|
|||
|
|
(int)sp.textureRect.width,
|
|||
|
|
(int)sp.textureRect.height));
|
|||
|
|
tex.Apply();
|
|||
|
|
imgFood.texture = tex;
|
|||
|
|
|
|||
|
|
Invoke("phantom", 0.001f);
|
|||
|
|
|
|||
|
|
//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ʾ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>ʾ
|
|||
|
|
//ShowTip(objTipMat, 3f);
|
|||
|
|
promptMat.SetActive(true);
|
|||
|
|
promptMat.GetComponentInChildren<Text>().text = "<22><><EFBFBD><EFBFBD><EFBFBD>룺" + selectedSteps[currentStepIndex].name;
|
|||
|
|
Invoke("SetactivePromptMat", 2f);
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
|
LoadTip();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
|
void LoadTip()
|
|||
|
|
{
|
|||
|
|
//<2F><>ʾ<EFBFBD>ı<EFBFBD>ע<EFBFBD><D7A2>
|
|||
|
|
txtFoodNameTip.text = selectedFood.nameText.text;
|
|||
|
|
txtTip.text = selectedFood.Data.tip;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void HideAll()
|
|||
|
|
{
|
|||
|
|
objTipMat.SetActive(false);
|
|||
|
|
objTipOp.SetActive(false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void FoodStepInitial(GameObject obj, FoodStepData item, bool canClick = true, int index = 0)
|
|||
|
|
{
|
|||
|
|
obj.name = item.name;
|
|||
|
|
Text txt = obj.GetComponentInChildren<Text>();
|
|||
|
|
if (canClick)
|
|||
|
|
{
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ʳ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>⿷<EFBFBD>ʽͼƬ
|
|||
|
|
if (item.type == "1")
|
|||
|
|
{
|
|||
|
|
obj.GetComponent<Button>().onClick.AddListener(onFoodMatButtonClick);
|
|||
|
|
StartCoroutine(ImageLoader<RawImage>.LoadImage(
|
|||
|
|
CommonData.DataServer + "/ZX4/Mats/" + item.name + ".png",
|
|||
|
|
obj.transform.GetChild(0).GetComponent<RawImage>()));
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
obj.GetComponent<Button>().onClick.AddListener(onFoodOpButtonClick);
|
|||
|
|
StartCoroutine(ImageLoader<RawImage>.LoadImage(
|
|||
|
|
CommonData.DataServer + "/ZX4/Ops/" + item.name + ".png",
|
|||
|
|
obj.transform.GetChild(0).GetComponent<RawImage>()));
|
|||
|
|
}
|
|||
|
|
//if (txt != null)
|
|||
|
|
//txt.text = item.name;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//if (txt != null)
|
|||
|
|
// txt.text = index.ToString();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//ѡ<><D1A1><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ͼƬ
|
|||
|
|
void FoodStepInitial(GameObject objStep, GameObject objSelected)
|
|||
|
|
{
|
|||
|
|
objStep.transform.GetChild(1).GetComponent<RawImage>().texture
|
|||
|
|
=
|
|||
|
|
objSelected.transform.childCount == 2
|
|||
|
|
?
|
|||
|
|
objSelected.transform.GetChild(0).GetComponent<RawImage>().texture
|
|||
|
|
:
|
|||
|
|
objSelected.transform.GetChild(1).GetComponent<RawImage>().texture;
|
|||
|
|
|
|||
|
|
Text txt = objStep.GetComponentInChildren<Text>();
|
|||
|
|
if (txt != null)
|
|||
|
|
txt.text = objSelected.GetComponentInChildren<Text>().text;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>ųɹ<C5B3><C9B9><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void SemiInitial()
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].type == "4")
|
|||
|
|
{
|
|||
|
|
animator.SetTrigger("Success");
|
|||
|
|
PlayAudioByName("<22>ɹ<EFBFBD>");
|
|||
|
|
//Debug.Log("<22><><EFBFBD>ųɹ<C5B3><C9B9><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
|
step = 0;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//Debug.Log("<22><><EFBFBD><EFBFBD>Ʒ");
|
|||
|
|
/*
|
|||
|
|
//imgSemi.gameObject.SetActive(true);
|
|||
|
|
|
|||
|
|
StartCoroutine(ImageLoader<RawImage>.LoadImage(
|
|||
|
|
CommonData.DataServer + "/ZX4/Semis/" + selectedSteps[currentStepIndex].name + ".png", imgSemi));
|
|||
|
|
Invoke("HideSemi", 3f);
|
|||
|
|
*/
|
|||
|
|
/*
|
|||
|
|
currentStepIndex++;
|
|||
|
|
|
|||
|
|
currentObjIndex++;
|
|||
|
|
currentStepObj = objSteps[currentObjIndex];
|
|||
|
|
*/
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void HideSemi()
|
|||
|
|
{
|
|||
|
|
imgSemi.gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//ѡ<><D1A1>ʳ<EFBFBD><CAB3>
|
|||
|
|
private void onFoodMatButtonClick()
|
|||
|
|
{
|
|||
|
|
Invoke("SetactivePromptMat", 0);
|
|||
|
|
Invoke("SetactivePromptOp", 0);
|
|||
|
|
if (!IsShowTip)
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].type == "1")
|
|||
|
|
{
|
|||
|
|
GameObject obj = EventSystem.current.currentSelectedGameObject;
|
|||
|
|
for (int i = currentStepIndex; i < selectedSteps.Count; i++)
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[i].type != "1")
|
|||
|
|
{
|
|||
|
|
PlayAudioByName("ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
|
if (selectedSteps[currentStepIndex].type=="1")
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptMat");
|
|||
|
|
promptMat.SetActive(true);
|
|||
|
|
promptMat.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD><EFBFBD>,\n" + "Ӧ<><D3A6><EFBFBD>ǣ<EFBFBD>" + selectedSteps[currentStepIndex].name;
|
|||
|
|
Invoke("SetactivePromptMat", 2f);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptOp");
|
|||
|
|
promptOp.SetActive(true);
|
|||
|
|
promptOp.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD><EFBFBD>,\n" + "Ӧ<><D3A6><EFBFBD>ǣ<EFBFBD>" + selectedSteps[currentStepIndex].name;
|
|||
|
|
Invoke("SetactivePromptOp", 2f);
|
|||
|
|
}
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[i].name == obj.name)
|
|||
|
|
{
|
|||
|
|
FoodStepInitial(currentStepObj, obj);
|
|||
|
|
//objSelectedMatBg.SetActive(true);
|
|||
|
|
objSelectedMatBg.transform.position = obj.transform.position;
|
|||
|
|
objSelectedMatBg.transform.SetParent(obj.transform);
|
|||
|
|
objSelectedMatBg.transform.SetAsFirstSibling();
|
|||
|
|
StepCenter.transform.GetChild(currentStepIndex).transform.GetChild(1).GetComponent<RawImage>().color = new Color(255, 255, 255, 1);
|
|||
|
|
PlayAudioByName("ѡ<><D1A1><EFBFBD><EFBFBD>ȷ");
|
|||
|
|
if (i != currentStepIndex)
|
|||
|
|
{
|
|||
|
|
FoodStepData element = selectedSteps[i]; // <20><>ȡҪ<C8A1>ƶ<EFBFBD><C6B6><EFBFBD>Ԫ<EFBFBD>ص<EFBFBD>ֵ
|
|||
|
|
selectedSteps.RemoveAt(i); // <20>Ƴ<EFBFBD>Ҫ<EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>Ԫ<EFBFBD><D4AA>
|
|||
|
|
selectedSteps.Insert(currentStepIndex, element); // <20><>Ҫ<EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>Ԫ<EFBFBD>ز<EFBFBD><D8B2>뵽Ŀ<EBB5BD><C4BF>λ<EFBFBD><CEBB>
|
|||
|
|
}
|
|||
|
|
if (selectedSteps[currentStepIndex+1].type == "1")
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptMat");
|
|||
|
|
promptMat.SetActive(true);
|
|||
|
|
promptMat.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD>ˣ<EFBFBD>\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺" + selectedSteps[currentStepIndex + 1].name;
|
|||
|
|
Invoke("SetactivePromptMat", 2f);
|
|||
|
|
}
|
|||
|
|
else if((selectedSteps[currentStepIndex+1].type == "2"))
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptOp");
|
|||
|
|
promptOp.SetActive(true);
|
|||
|
|
promptOp.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD>ˣ<EFBFBD>\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>" + selectedSteps[currentStepIndex + 1].name;
|
|||
|
|
Invoke("SetactivePromptOp", 2f);
|
|||
|
|
}
|
|||
|
|
AnimationLoad();
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
//wok.SetActive(false);
|
|||
|
|
|
|||
|
|
|
|||
|
|
currentStepIndex++;
|
|||
|
|
currentObjIndex++;
|
|||
|
|
currentStepObj = objSteps[currentObjIndex];
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
PlayAudioByName("ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
|
if (selectedSteps[currentStepIndex].type == "1")
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptMat");
|
|||
|
|
promptMat.SetActive(true);
|
|||
|
|
promptMat.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD><EFBFBD>,\n" + "Ӧ<><D3A6><EFBFBD>ǣ<EFBFBD>" + selectedSteps[currentStepIndex].name;
|
|||
|
|
Invoke("SetactivePromptMat", 2f);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptOp");
|
|||
|
|
promptOp.SetActive(true);
|
|||
|
|
promptOp.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD><EFBFBD>,\n" + "Ӧ<><D3A6><EFBFBD>ǣ<EFBFBD>" + selectedSteps[currentStepIndex].name;
|
|||
|
|
Invoke("SetactivePromptOp", 2f);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//ѡ<><D1A1><EFBFBD><EFBFBD>⿷<EFBFBD><E2BFB7><EFBFBD>
|
|||
|
|
private void onFoodOpButtonClick()
|
|||
|
|
{
|
|||
|
|
Invoke("SetactivePromptMat", 0);
|
|||
|
|
Invoke("SetactivePromptOp", 0);
|
|||
|
|
if (!IsShowTip)
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].type == "2")
|
|||
|
|
{
|
|||
|
|
GameObject obj = EventSystem.current.currentSelectedGameObject;
|
|||
|
|
|
|||
|
|
if (selectedSteps[currentStepIndex].name == obj.name)
|
|||
|
|
{
|
|||
|
|
FoodStepInitial(currentStepObj, obj);
|
|||
|
|
|
|||
|
|
//objSelectedOpBg.SetActive(true);
|
|||
|
|
objSelectedOpBg.transform.position = obj.transform.position;
|
|||
|
|
objSelectedOpBg.transform.SetParent(obj.transform);
|
|||
|
|
objSelectedOpBg.transform.SetAsFirstSibling();
|
|||
|
|
StepCenter.transform.GetChild(currentStepIndex).transform.GetChild(1).GetComponent<RawImage>().color = new Color(255, 255, 255, 1);
|
|||
|
|
Invoke("StepAnimation", 0);
|
|||
|
|
if (selectedSteps[currentStepIndex + 1].type=="3")
|
|||
|
|
{
|
|||
|
|
step++;
|
|||
|
|
Invoke("onFoodStep", 2f);
|
|||
|
|
/*
|
|||
|
|
CancelInvoke("SetactivePromptMat");
|
|||
|
|
Invoke("OpenPrompt", 4f);
|
|||
|
|
promptMat.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD>ˣ<EFBFBD>\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺" + selectedSteps[currentStepIndex + 2].name;
|
|||
|
|
Invoke("SetactivePromptMat", 2f);
|
|||
|
|
*/
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex + 1].type == "4")
|
|||
|
|
{
|
|||
|
|
Invoke("SetactivePromptOp", 0);
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex+1].type == "1")
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptMat");
|
|||
|
|
promptMat.SetActive(true);
|
|||
|
|
promptMat.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD>ˣ<EFBFBD>\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺" + selectedSteps[currentStepIndex + 1].name;
|
|||
|
|
Invoke("SetactivePromptMat", 2f);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex+1].type == "2")
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptOp");
|
|||
|
|
promptOp.SetActive(true);
|
|||
|
|
promptOp.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD>ˣ<EFBFBD>\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>" + selectedSteps[currentStepIndex + 1].name;
|
|||
|
|
Invoke("SetactivePromptOp", 2f);
|
|||
|
|
}
|
|||
|
|
//AnimationLoad();
|
|||
|
|
if (selectedSteps[currentStepIndex].name == "װ<><D7B0>")
|
|||
|
|
{
|
|||
|
|
//Debug.Log("<22><><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD><EFBFBD><EFBFBD>" + obj.name);
|
|||
|
|
|
|||
|
|
Invoke("SemiInitial", 1.5f);
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name != "װ<><D7B0>")
|
|||
|
|
{
|
|||
|
|
//Debug.Log("<22><><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD><EFBFBD><EFBFBD>" + obj.name);
|
|||
|
|
Invoke("SemiInitial", 2f);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
PlayAudioByName("ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
|
if (selectedSteps[currentStepIndex].type == "1")
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptMat");
|
|||
|
|
promptMat.SetActive(true);
|
|||
|
|
promptMat.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD><EFBFBD>,\n" + "Ӧ<><D3A6><EFBFBD>ǣ<EFBFBD>" + selectedSteps[currentStepIndex].name;
|
|||
|
|
Invoke("SetactivePromptMat", 2f);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptOp");
|
|||
|
|
promptOp.SetActive(true);
|
|||
|
|
promptOp.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD><EFBFBD>,\n" + "Ӧ<><D3A6><EFBFBD>ǣ<EFBFBD>" + selectedSteps[currentStepIndex].name;
|
|||
|
|
Invoke("SetactivePromptOp", 2f);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
PlayAudioByName("ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
|
if (selectedSteps[currentStepIndex].type == "1")
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptMat");
|
|||
|
|
promptMat.SetActive(true);
|
|||
|
|
promptMat.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD><EFBFBD>,\n" + "Ӧ<><D3A6><EFBFBD>ǣ<EFBFBD>" + selectedSteps[currentStepIndex].name;
|
|||
|
|
Invoke("SetactivePromptMat", 2f);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptOp");
|
|||
|
|
promptOp.SetActive(true);
|
|||
|
|
promptOp.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD><EFBFBD>,\n" + "Ӧ<><D3A6><EFBFBD>ǣ<EFBFBD>" + selectedSteps[currentStepIndex].name;
|
|||
|
|
Invoke("SetactivePromptOp", 2f);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>˳<EFBFBD><CBB3><EFBFBD>Ϸ
|
|||
|
|
private void onQuitGameButtonClick()
|
|||
|
|
{
|
|||
|
|
//<2F>˳<EFBFBD><CBB3><EFBFBD>Ϸ<EFBFBD><CFB7>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
step = 0;
|
|||
|
|
animationmark=0;
|
|||
|
|
semiluroufan1.SetActive(false);
|
|||
|
|
semiluroufan2.SetActive(false);
|
|||
|
|
semikezaijian1.SetActive(false);
|
|||
|
|
semikezaijian2.SetActive(false);
|
|||
|
|
semidaizaimian1.SetActive(false);
|
|||
|
|
semidanzaimian2.SetActive(false);
|
|||
|
|
semirouzong1.SetActive(false);
|
|||
|
|
semirouzong2.SetActive(false);
|
|||
|
|
semirouzong3.SetActive(false);
|
|||
|
|
semikezaimian1.SetActive(false);
|
|||
|
|
semikezaimian2.SetActive(false);
|
|||
|
|
semichaomifen1.SetActive(false);
|
|||
|
|
semichaomifen2.SetActive(false);
|
|||
|
|
semidingbiancuo1.SetActive(false);
|
|||
|
|
semidingbiancuo2.SetActive(false);
|
|||
|
|
semidoufu1.SetActive(false);
|
|||
|
|
semidoufu2.SetActive(false);
|
|||
|
|
semizhuti1.SetActive(false);
|
|||
|
|
semizhuti2.SetActive(false);
|
|||
|
|
semishaoxiancao1.SetActive(false);
|
|||
|
|
semishaoxaincao2.SetActive(false);
|
|||
|
|
animationloadmark = 0;
|
|||
|
|
luroufanTransform.SetActive(false);
|
|||
|
|
kezaijianTransform.SetActive(false);
|
|||
|
|
danzaimianTransform.SetActive(false);
|
|||
|
|
zongziTransform.SetActive(false);
|
|||
|
|
kezaimianTransform.SetActive(false);
|
|||
|
|
chaomifenTransform.SetActive(false);
|
|||
|
|
dingbiancuoTransform.SetActive(false);
|
|||
|
|
doufuTransform.SetActive(false);
|
|||
|
|
zhutiTransform.SetActive(false);
|
|||
|
|
shaoxiancaoTransform.SetActive(false);
|
|||
|
|
|
|||
|
|
for (int i = 0; i < luroufanTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
luroufanTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
for (int i = 0; i < kezaijianTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
kezaijianTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
for (int i = 0; i < danzaimianTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
danzaimianTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
for (int i = 0; i < zongziTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
zongziTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
for (int i = 0; i < kezaimianTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
kezaimianTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
for (int i = 0; i < chaomifenTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
chaomifenTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
for (int i = 0; i < dingbiancuoTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
dingbiancuoTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
for (int i = 0; i < doufuTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
doufuTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
for (int i = 0; i < zhutiTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
zhutiTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
for (int i = 0; i < shaoxiancaoTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
shaoxiancaoTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
animator.SetTrigger("ShowFoodInfo2");
|
|||
|
|
PlayAudioByName("ҳ<><D2B3><EFBFBD>л<EFBFBD>");
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>رճ<D8B1><D5B3><EFBFBD>
|
|||
|
|
private void onCloseButtonClick()
|
|||
|
|
{
|
|||
|
|
BaseController.HideView();
|
|||
|
|
Destroy(gameObject.transform.parent.gameObject);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><>ʾ<EFBFBD><CABE>ť
|
|||
|
|
private void onBtnTipClick()
|
|||
|
|
{
|
|||
|
|
pnlTip.SetActive(!pnlTip.activeSelf);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><>ʾ<EFBFBD>رհ<D8B1>ť
|
|||
|
|
private void onBtnCloseTipClick()
|
|||
|
|
{
|
|||
|
|
pnlTip.SetActive(false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#region
|
|||
|
|
|
|||
|
|
//void PlayVideo()
|
|||
|
|
//{
|
|||
|
|
// string URL = null;
|
|||
|
|
// // <20><>ȡ<EFBFBD><C8A1>Ƶ·<C6B5><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ
|
|||
|
|
// if (H5Controller.GetPlatformType() == 0)
|
|||
|
|
// {
|
|||
|
|
// URL = Application.streamingAssetsPath + "/ZX4/Videos/" + txtFood.text + ".mp4";
|
|||
|
|
// }
|
|||
|
|
// else
|
|||
|
|
// {
|
|||
|
|
// URL = "/Content/ZX4/Videos/" + txtFood.text + ".mp4";
|
|||
|
|
// }
|
|||
|
|
// Debug.Log(URL);
|
|||
|
|
// vp.gameObject.SetActive(true);
|
|||
|
|
// Tween myTween = vp.transform.DOScale(Vector3.one, 1f);
|
|||
|
|
// myTween.SetEase(Ease.OutQuint);
|
|||
|
|
// vp.Play(URL);
|
|||
|
|
// tranFoodMatsParent.gameObject.SetActive(false);
|
|||
|
|
// RemoveSelectedFoodMats();
|
|||
|
|
//}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
//ʳ<><CAB3><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
|
public void OpenPromptMat()
|
|||
|
|
{
|
|||
|
|
promptMat.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void SetactivePromptMat()
|
|||
|
|
{
|
|||
|
|
promptMat.SetActive(false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><>⿷<EFBFBD>ʽ<EFBFBD><CABD>ʾ<EFBFBD><CABE>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
|
public void OpenPromptOp()
|
|||
|
|
{
|
|||
|
|
promptOp.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void SetactivePromptOp()
|
|||
|
|
{
|
|||
|
|
promptOp.SetActive(false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
public void Stepstips()
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].type == "1")
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptMat");
|
|||
|
|
promptMat.SetActive(true);
|
|||
|
|
promptMat.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD>ˣ<EFBFBD>\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룺" + selectedSteps[currentStepIndex].name;
|
|||
|
|
Invoke("SetactivePromptMat", 2f);
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].type == "2")
|
|||
|
|
{
|
|||
|
|
CancelInvoke("SetactivePromptOp");
|
|||
|
|
promptOp.SetActive(true);
|
|||
|
|
promptOp.GetComponentInChildren<Text>().text = "ѡ<><D1A1><EFBFBD>ˣ<EFBFBD>\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>" + selectedSteps[currentStepIndex].name;
|
|||
|
|
Invoke("SetactivePromptOp", 2f);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʳ֮<CAB3><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
/// </summary>
|
|||
|
|
public void onFoodStep()
|
|||
|
|
{
|
|||
|
|
//<2F><><EFBFBD>ײ<EFBFBD><D7B2><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>أ<EFBFBD>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
GameObject gameObject = foodsContainer.GetChild(step*10+currentSelected-1 ).gameObject;
|
|||
|
|
|
|||
|
|
Food food = gameObject.GetComponent<Food>();
|
|||
|
|
if (selectedFood != null)
|
|||
|
|
{
|
|||
|
|
selectedFood.objBgImage.SetActive(false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
food.objBgImage.SetActive(true);
|
|||
|
|
foodImage.sprite = food.foodImage.sprite;
|
|||
|
|
foodNameText.text = food.nameText.text;
|
|||
|
|
txtFoodName.text = food.nameText.text;
|
|||
|
|
txtFoodName2.text = food.nameText.text;
|
|||
|
|
descriptionText.text = food.Data.description;
|
|||
|
|
descriptionText.rectTransform.anchoredPosition = new Vector2(0f, -699f);
|
|||
|
|
matContainer.GetComponent<RectTransform>().anchoredPosition = Vector2.zero;
|
|||
|
|
opContainer.GetComponent<RectTransform>().anchoredPosition = Vector2.zero;
|
|||
|
|
selectedFood = food;
|
|||
|
|
Invoke("onStartButtonClick", 0);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0>ʾ
|
|||
|
|
/*
|
|||
|
|
public void phantom()
|
|||
|
|
{
|
|||
|
|
var step12 = selectedFood.Data.steps.Where(step => step.type == "1" || step.type == "2").ToList();
|
|||
|
|
for (int i = 0; i < StepCenter.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
//<2F><><EFBFBD><CDB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
|
if (step12[i].type == "1")
|
|||
|
|
{
|
|||
|
|
StartCoroutine(ImageLoader<RawImage>.LoadImage(
|
|||
|
|
CommonData.DataServer + "/ZX4/Mats/" + StepCenter.transform.GetChild(i).name + ".png",
|
|||
|
|
StepCenter.transform.GetChild(i).transform.GetChild(1).GetComponent<RawImage>()));
|
|||
|
|
StepCenter.transform.GetChild(i).transform.GetChild(1).GetComponent<RawImage>().color = new Color(255, 255, 255, 0.7f);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
StartCoroutine(ImageLoader<RawImage>.LoadImage(
|
|||
|
|
CommonData.DataServer + "/ZX4/Ops/" + StepCenter.transform.GetChild(i).name + ".png",
|
|||
|
|
StepCenter.transform.GetChild(i).transform.GetChild(1).GetComponent<RawImage>()));
|
|||
|
|
StepCenter.transform.GetChild(i).transform.GetChild(1).GetComponent<RawImage>().color = new Color(255, 255, 255, 0.7f);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
*/
|
|||
|
|
//<2F><><EFBFBD>趯<EFBFBD><E8B6AF>
|
|||
|
|
public void StepAnimation()
|
|||
|
|
{
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч
|
|||
|
|
if (selectedSteps[currentStepIndex].name!="<22><>")
|
|||
|
|
{
|
|||
|
|
PlayAudioByName(selectedSteps[currentStepIndex].name);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//±<>ⷹ<EFBFBD><E2B7B9><EFBFBD><EFBFBD>
|
|||
|
|
if (txtFoodName.GetComponent<Text>().text == "±<>ⷹ")
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Chaoluroufan.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Chaoluroufansetactive", 2f);
|
|||
|
|
luroufanTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < luroufanTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
luroufanTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "±")
|
|||
|
|
{
|
|||
|
|
Luluroufan.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Luluroufansetactive", 2f);
|
|||
|
|
luroufanTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < luroufanTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
luroufanTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "װ<><D7B0>")
|
|||
|
|
{
|
|||
|
|
Zhuanpanluroufan.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
semiluroufan1.SetActive(false);
|
|||
|
|
semiluroufan2.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Zhuanpansetactive", 1.5f);
|
|||
|
|
luroufanTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < luroufanTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
luroufanTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>м嶯<D0BC><E5B6AF>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD>м<EFBFBD>")
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
if (animationmark == 0)
|
|||
|
|
{
|
|||
|
|
Jiaobankezaijian.SetActive(true);
|
|||
|
|
animationloadmark++;
|
|||
|
|
}
|
|||
|
|
else if (animationmark == 1)
|
|||
|
|
{
|
|||
|
|
Jiaobankezaijian2.SetActive(true);
|
|||
|
|
}
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Jiaobankezaijiansetactive", 2f);
|
|||
|
|
kezaijianTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < kezaijianTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
kezaijianTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Jiankezaijian.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
semikezaijian1.SetActive(false);
|
|||
|
|
semikezaijian2.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Jiankezaijiansetactive", 2f);
|
|||
|
|
kezaijianTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < kezaijianTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
kezaijianTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>涯<EFBFBD><E6B6AF>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
if (animationmark == 0)
|
|||
|
|
{
|
|||
|
|
Jiaobandanzaimian.SetActive(true);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name + "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
|
}
|
|||
|
|
else if (animationmark == 1)
|
|||
|
|
{
|
|||
|
|
Jiaobandanzaimian2.SetActive(true);
|
|||
|
|
semidaizaimian1.SetActive(false);
|
|||
|
|
semidanzaimian2.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
}
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
Invoke("Jiaobandanzaimainsetactive", 2f);
|
|||
|
|
danzaimianTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < danzaimianTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
danzaimianTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Zhudanzaimian.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Zhudanzaimiansetactive", 2f);
|
|||
|
|
danzaimianTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < danzaimianTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
danzaimianTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
animationloadmark++;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>ն<EFBFBD><D5B6><EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
Jinpaorouzong.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Jinpaorouzongsetactive", 2f);
|
|||
|
|
zongziTransform.SetActive(false);
|
|||
|
|
animationloadmark++;
|
|||
|
|
for (int i = 0; i < zongziTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
zongziTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
if (animationmark == 0)
|
|||
|
|
{
|
|||
|
|
Zhurouzong.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (animationmark == 1)
|
|||
|
|
{
|
|||
|
|
Zhurouzong2.SetActive(true);
|
|||
|
|
semirouzong3.SetActive(false);
|
|||
|
|
}
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Zhurouzongsetactive", 2f);
|
|||
|
|
zongziTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < zongziTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
zongziTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Baorouzong.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
semirouzong1.SetActive(false);
|
|||
|
|
semirouzong2.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Baorouzongsetactive", 2f);
|
|||
|
|
zongziTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < zongziTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
zongziTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>涯<EFBFBD><E6B6AF>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].name == "±")
|
|||
|
|
{
|
|||
|
|
Lukezaimian.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Lukezaimiansetactive", 2f);
|
|||
|
|
kezaimianTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < kezaimianTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
kezaimianTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
if (animationmark == 0)
|
|||
|
|
{
|
|||
|
|
Zhukezaimian.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (animationmark == 1)
|
|||
|
|
{
|
|||
|
|
Zhukezaimian2.SetActive(true);
|
|||
|
|
semikezaimian1.SetActive(false);
|
|||
|
|
semikezaimian2.SetActive(false);
|
|||
|
|
}
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Zhukezaimiansetactive", 2f);
|
|||
|
|
kezaimianTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < kezaimianTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
kezaimianTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>۶<D7B7><DBB6><EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "̨<>峴<EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
if (animationmark == 0)
|
|||
|
|
{
|
|||
|
|
Chaochaomifen.SetActive(true);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name+ "<22><><EFBFBD><EFBFBD>");
|
|||
|
|
}
|
|||
|
|
else if (animationmark == 1)
|
|||
|
|
{
|
|||
|
|
Chaochaomifen2.SetActive(true);
|
|||
|
|
semichaomifen1.SetActive(false);
|
|||
|
|
semichaomifen2.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
}
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
Invoke("Chaochaomifensetactive", 2f);
|
|||
|
|
chaomifenTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < chaomifenTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
chaomifenTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Jianchaomifen.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Jianchaomifensetactive", 2f);
|
|||
|
|
chaomifenTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < chaomifenTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
chaomifenTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ﱶ<EFBFBD><EFB1B6><EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
Jiaobandingbiancuo.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name+ "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
|
Invoke("Jiaobandingbiancuosetactive", 2f);
|
|||
|
|
dingbiancuoTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < dingbiancuoTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
dingbiancuoTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Zhudingbiancuo.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Zhudingbiancuosetactive", 2f);
|
|||
|
|
dingbiancuoTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < dingbiancuoTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
dingbiancuoTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "װ<><D7B0>")
|
|||
|
|
{
|
|||
|
|
Zhuangpandingbiancuo.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
semidingbiancuo1.SetActive(false);
|
|||
|
|
semidingbiancuo2.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Zhuanpansetactive", 1.5f);
|
|||
|
|
dingbiancuoTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < dingbiancuoTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
dingbiancuoTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Jiandoufu.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Jiandoufusetactive", 2f);
|
|||
|
|
doufuTransform.SetActive(false);
|
|||
|
|
|
|||
|
|
for (int i = 0; i < doufuTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
doufuTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Chaodoufu.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Chaodoufusetactive", 2f);
|
|||
|
|
doufuTransform.SetActive(false);
|
|||
|
|
animationloadmark++;
|
|||
|
|
for (int i = 0; i < doufuTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
doufuTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Zhudoufu.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
semidoufu1.SetActive(false);
|
|||
|
|
semidoufu2.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Zhudoufusetactive", 2f);
|
|||
|
|
doufuTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < doufuTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
doufuTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>㶯<EFBFBD><E3B6AF>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
if (animationmark == 0)
|
|||
|
|
{
|
|||
|
|
Zhuzhuti.SetActive(true);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name+"<22><><EFBFBD><EFBFBD>");
|
|||
|
|
animationloadmark++;
|
|||
|
|
}
|
|||
|
|
else if (animationmark == 1)
|
|||
|
|
{
|
|||
|
|
Zhuzhuti2.SetActive(true);
|
|||
|
|
semizhuti2.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
}
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
Invoke("Zhuzhutisetactive", 2f);
|
|||
|
|
zhutiTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < zhutiTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
zhutiTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Chaozhuti.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
semizhuti1.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Chaozhutisetactive", 2f);
|
|||
|
|
zhutiTransform.SetActive(false);
|
|||
|
|
animationloadmark++;
|
|||
|
|
for (int i = 0; i < zhutiTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
zhutiTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>ɲݶ<C9B2><DDB6><EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD>ɲ<EFBFBD>")
|
|||
|
|
{
|
|||
|
|
if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Zhengshaoxiancao.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Zhengshaoxiancaosetactive", 2f);
|
|||
|
|
shaoxiancaoTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < shaoxiancaoTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
shaoxiancaoTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "<22><>")
|
|||
|
|
{
|
|||
|
|
Zhushaoxiancao.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
wok.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Zhushaoxiancaosetactive", 2f);
|
|||
|
|
shaoxiancaoTransform.SetActive(false);
|
|||
|
|
animationloadmark++;
|
|||
|
|
for (int i = 0; i < shaoxiancaoTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
shaoxiancaoTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
else if (selectedSteps[currentStepIndex].name == "װ<><D7B0>")
|
|||
|
|
{
|
|||
|
|
Zhuangpanshaoxiancao.SetActive(true);
|
|||
|
|
StepCenter.SetActive(false);
|
|||
|
|
semishaoxiancao1.SetActive(false);
|
|||
|
|
semishaoxaincao2.SetActive(false);
|
|||
|
|
animator.SetTrigger(selectedSteps[currentStepIndex].name);
|
|||
|
|
Invoke("Zhuanpansetactive", 1.5f);
|
|||
|
|
shaoxiancaoTransform.SetActive(false);
|
|||
|
|
for (int i = 0; i < shaoxiancaoTransform.transform.childCount; i++)
|
|||
|
|
{
|
|||
|
|
shaoxiancaoTransform.transform.GetChild(i).gameObject.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
currentStepIndex++;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F>ر<EFBFBD><D8B1><EFBFBD>⿶<EFBFBD><E2BFB6><EFBFBD>
|
|||
|
|
//±<>ⷹ
|
|||
|
|
public void Chaoluroufansetactive()
|
|||
|
|
{
|
|||
|
|
Chaoluroufan.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semiluroufan1.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
luroufanTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Luluroufansetactive()
|
|||
|
|
{
|
|||
|
|
Luluroufan.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semiluroufan2.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
luroufanTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>м<EFBFBD>
|
|||
|
|
public void Jiaobankezaijiansetactive()
|
|||
|
|
{
|
|||
|
|
if (animationmark==0)
|
|||
|
|
{
|
|||
|
|
Jiaobankezaijian.SetActive(false);
|
|||
|
|
animationmark++;
|
|||
|
|
semikezaijian1.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (animationmark == 1)
|
|||
|
|
{
|
|||
|
|
Jiaobankezaijian2.SetActive(false);
|
|||
|
|
semikezaijian2.SetActive(true);
|
|||
|
|
}
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
kezaijianTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Jiankezaijiansetactive()
|
|||
|
|
{
|
|||
|
|
Jiankezaijian.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
kezaijianTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
public void Jiaobandanzaimainsetactive()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
if (animationmark==0)
|
|||
|
|
{
|
|||
|
|
Jiaobandanzaimian.SetActive(false);
|
|||
|
|
semidaizaimian1.SetActive(true);
|
|||
|
|
animationmark++;
|
|||
|
|
}
|
|||
|
|
else if (animationmark==1)
|
|||
|
|
{
|
|||
|
|
Jiaobandanzaimian2.SetActive(false);
|
|||
|
|
}
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
danzaimianTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Zhudanzaimiansetactive()
|
|||
|
|
{
|
|||
|
|
Zhudanzaimian.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semidanzaimian2.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
danzaimianTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>
|
|||
|
|
public void Jinpaorouzongsetactive()
|
|||
|
|
{
|
|||
|
|
Jinpaorouzong.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semirouzong1.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
zongziTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Zhurouzongsetactive()
|
|||
|
|
{
|
|||
|
|
if (animationmark == 0)
|
|||
|
|
{
|
|||
|
|
Zhurouzong.SetActive(false);
|
|||
|
|
semirouzong2.SetActive(true);
|
|||
|
|
animationmark++;
|
|||
|
|
}
|
|||
|
|
else if (animationmark == 1)
|
|||
|
|
{
|
|||
|
|
Zhurouzong2.SetActive(false);
|
|||
|
|
}
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
zongziTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Baorouzongsetactive()
|
|||
|
|
{
|
|||
|
|
Baorouzong.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semirouzong3.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
zongziTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
public void Lukezaimiansetactive()
|
|||
|
|
{
|
|||
|
|
Lukezaimian.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semikezaimian1.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
kezaimianTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Zhukezaimiansetactive()
|
|||
|
|
{
|
|||
|
|
if (animationmark == 0)
|
|||
|
|
{
|
|||
|
|
Zhukezaimian.SetActive(false);
|
|||
|
|
semikezaimian2.SetActive(true);
|
|||
|
|
animationmark++;
|
|||
|
|
}
|
|||
|
|
else if (animationmark == 1)
|
|||
|
|
{
|
|||
|
|
Zhukezaimian2.SetActive(false);
|
|||
|
|
}
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
kezaimianTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//̨<>峴<EFBFBD><EFBFBD>
|
|||
|
|
public void Chaochaomifensetactive()
|
|||
|
|
{
|
|||
|
|
if (animationmark == 0)
|
|||
|
|
{
|
|||
|
|
Chaochaomifen.SetActive(false);
|
|||
|
|
semichaomifen1.SetActive(true);
|
|||
|
|
animationmark++;
|
|||
|
|
}
|
|||
|
|
else if (animationmark == 1)
|
|||
|
|
{
|
|||
|
|
Chaochaomifen2.SetActive(false);
|
|||
|
|
}
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
chaomifenTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Jianchaomifensetactive()
|
|||
|
|
{
|
|||
|
|
Jianchaomifen.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semichaomifen2.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
chaomifenTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
public void Jiaobandingbiancuosetactive()
|
|||
|
|
{
|
|||
|
|
Jiaobandingbiancuo.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semidingbiancuo1.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
dingbiancuoTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Zhudingbiancuosetactive()
|
|||
|
|
{
|
|||
|
|
Zhudingbiancuo.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semidingbiancuo2.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
dingbiancuoTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD>
|
|||
|
|
public void Jiandoufusetactive()
|
|||
|
|
{
|
|||
|
|
Jiandoufu.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semidoufu1.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
doufuTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Chaodoufusetactive()
|
|||
|
|
{
|
|||
|
|
Chaodoufu.SetActive(false);
|
|||
|
|
semidoufu2.SetActive(true);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
doufuTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Zhudoufusetactive()
|
|||
|
|
{
|
|||
|
|
Zhudoufu.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
doufuTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
public void Zhuzhutisetactive()
|
|||
|
|
{
|
|||
|
|
if (animationmark == 0)
|
|||
|
|
{
|
|||
|
|
Zhuzhuti.SetActive(false);
|
|||
|
|
semizhuti1.SetActive(true);
|
|||
|
|
animationmark++;
|
|||
|
|
}
|
|||
|
|
else if (animationmark == 1)
|
|||
|
|
{
|
|||
|
|
Zhuzhuti2.SetActive(false);
|
|||
|
|
}
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
zhutiTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Chaozhutisetactive()
|
|||
|
|
{
|
|||
|
|
Chaozhuti.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semizhuti2.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
zhutiTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>ɲ<EFBFBD>
|
|||
|
|
public void Zhengshaoxiancaosetactive()
|
|||
|
|
{
|
|||
|
|
Zhengshaoxiancao.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semishaoxiancao1.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
shaoxiancaoTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
public void Zhushaoxiancaosetactive()
|
|||
|
|
{
|
|||
|
|
Zhushaoxiancao.SetActive(false);
|
|||
|
|
wok.SetActive(true);
|
|||
|
|
semishaoxaincao2.SetActive(true);
|
|||
|
|
Invoke("Stepstips", 0);
|
|||
|
|
shaoxiancaoTransform.SetActive(true);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//װ<><D7B0>
|
|||
|
|
public void Zhuanpansetactive()
|
|||
|
|
{
|
|||
|
|
Zhuanpanluroufan.SetActive(false);
|
|||
|
|
Zhuangpandingbiancuo.SetActive(false);
|
|||
|
|
Zhuangpanshaoxiancao.SetActive(false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ
|
|||
|
|
public AudioClip audiowin;
|
|||
|
|
public AudioClip audioright;
|
|||
|
|
public AudioClip audiomistake;
|
|||
|
|
public AudioClip audiopage;
|
|||
|
|
|
|||
|
|
//<2F><>⿶<EFBFBD><E2BFB6><EFBFBD><EFBFBD><EFBFBD>Ƶ
|
|||
|
|
public AudioClip audiochao;
|
|||
|
|
public AudioClip audiojiaoban;
|
|||
|
|
public AudioClip audiojinpao;
|
|||
|
|
public AudioClip audiolu;
|
|||
|
|
public AudioClip audiojian;
|
|||
|
|
public AudioClip audiozhu;
|
|||
|
|
public AudioClip audiozheng;
|
|||
|
|
public AudioClip audiozhuangpan;
|
|||
|
|
|
|||
|
|
//<2F><>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD>
|
|||
|
|
public void PlayAudioByName(string name)
|
|||
|
|
{
|
|||
|
|
AudioManager.Instance.PlayAudio(name);
|
|||
|
|
|
|||
|
|
//AudioClip audio = null;
|
|||
|
|
//if (name == "win") audio = audiowin;
|
|||
|
|
//else if (name == "right") audio = audioright;
|
|||
|
|
//else if (name == "mistake") audio = audiomistake;
|
|||
|
|
//else if (name == "page") audio = audiopage;
|
|||
|
|
|
|||
|
|
//else if (name == "<22><>") audio = audiochao;
|
|||
|
|
//else if (name == "<22><><EFBFBD><EFBFBD>") audio = audiojiaoban;
|
|||
|
|
//else if (name == "<22><><EFBFBD><EFBFBD>") audio = audiojinpao;
|
|||
|
|
//else if (name == "±") audio = audiolu;
|
|||
|
|
//else if (name == "<22><>") audio = audiojian;
|
|||
|
|
//else if (name == "<22><>") audio = audiozhu;
|
|||
|
|
//else if (name == "<22><>") audio = audiozheng;
|
|||
|
|
//else if (name == "װ<><D7B0>") audio = audiozhuangpan;
|
|||
|
|
////else if (name == "<22><>") audio = null;
|
|||
|
|
|
|||
|
|
//AudioSource.PlayClipAtPoint(audio, Camera.main.transform.position);
|
|||
|
|
}
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4>
|
|||
|
|
public void AnimationLoad()
|
|||
|
|
{
|
|||
|
|
GameObject obj = EventSystem.current.currentSelectedGameObject;
|
|||
|
|
//±<>ⷹ<EFBFBD><E2B7B9><EFBFBD><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
if (txtFoodName.GetComponent<Text>().text == "±<>ⷹ")
|
|||
|
|
{
|
|||
|
|
luroufanTransform.SetActive(true);
|
|||
|
|
if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
onions.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22>㹽")
|
|||
|
|
{
|
|||
|
|
mushroom.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22>廨<EFBFBD><E5BBA8>")
|
|||
|
|
{
|
|||
|
|
pork.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
rice.SetActive(true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>м嶯<D0BC><E5B6AF><EFBFBD>ز<EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD>м<EFBFBD>")
|
|||
|
|
{
|
|||
|
|
kezaijianTransform.SetActive(true);
|
|||
|
|
if (obj.name == "<22><><EFBFBD><EFBFBD>"&& animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
egg.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>"&& animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
oysters.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>"&&animationloadmark==1)
|
|||
|
|
{
|
|||
|
|
eggliquid.SetActive(true);
|
|||
|
|
semikezaijian1.SetActive(false);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>" && animationloadmark == 1)
|
|||
|
|
{
|
|||
|
|
oyster2.SetActive(true);
|
|||
|
|
semikezaijian2.SetActive(false);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>" )
|
|||
|
|
{
|
|||
|
|
onionskezaijian.SetActive(true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>涯<EFBFBD><E6B6AF><EFBFBD>ز<EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
danzaimianTransform.SetActive(true);
|
|||
|
|
if (obj.name == "<22>廨<EFBFBD><E5BBA8>")
|
|||
|
|
{
|
|||
|
|
porkdanzaimian.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>"&& animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
noodles.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>" && animationloadmark == 1)
|
|||
|
|
{
|
|||
|
|
noodles2.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "Ϻ<><CFBA>")
|
|||
|
|
{
|
|||
|
|
shrimpdanzaimian.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
coriander.SetActive(true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>ն<EFBFBD><D5B6><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
zongziTransform.SetActive(true);
|
|||
|
|
if (obj.name == "Ŵ<><C5B4>" && animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
ricezongzi.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
onionszongzi.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22>㹽")
|
|||
|
|
{
|
|||
|
|
mushroomzongzi.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
porkzongzi.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "Ŵ<><C5B4>" && animationloadmark == 1)
|
|||
|
|
{
|
|||
|
|
ricezongzi2.SetActive(true);
|
|||
|
|
semirouzong1.SetActive(false);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><>Ҷ")
|
|||
|
|
{
|
|||
|
|
leaves.SetActive(true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>涯<EFBFBD><E6B6AF><EFBFBD>ز<EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
kezaimianTransform.SetActive(true);
|
|||
|
|
if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
intestine.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
oysterskezaimian.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
nooldeskezaimian.SetActive(true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>۶<D7B7><DBB6><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "̨<>峴<EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
chaomifenTransform.SetActive(true);
|
|||
|
|
if (obj.name == "<22>㹽"&& animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
mushroomchaomifen.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>"&& animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
onionschaomifen.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>"&& animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
porkchaomifen.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
eggchaomifen.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
flour.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22>㹽" && animationloadmark == 1)
|
|||
|
|
{
|
|||
|
|
mushroomchaomifen2.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>" && animationloadmark == 1)
|
|||
|
|
{
|
|||
|
|
onionschaomifen2.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>" && animationloadmark == 1)
|
|||
|
|
{
|
|||
|
|
porkchaomifen2.SetActive(true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ﱶ<EFBFBD><EFB1B6><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
dingbiancuoTransform.SetActive(true);
|
|||
|
|
if (obj.name == "ľ<><C4BE><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
powderdingbiancuo.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22>㹽")
|
|||
|
|
{
|
|||
|
|
mushroomdingbiancuo.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "Ϻ<><CFBA>")
|
|||
|
|
{
|
|||
|
|
shrimpdingbiancuo.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
oysterdingbiancuo.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
chive.SetActive(true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
doufuTransform.SetActive(true);
|
|||
|
|
if (obj.name == "<22><><EFBFBD><EFBFBD>"&& animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
doufu.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>"&& animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
garlic.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>" && animationloadmark == 1)
|
|||
|
|
{
|
|||
|
|
doufu2.SetActive(true);
|
|||
|
|
semidoufu1.SetActive(false);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>" && animationloadmark == 1)
|
|||
|
|
{
|
|||
|
|
garlic2.SetActive(true);
|
|||
|
|
semidoufu2.SetActive(false);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>㶯<EFBFBD><E3B6AF><EFBFBD>ز<EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
zhutiTransform.SetActive(true);
|
|||
|
|
if (obj.name == "<22><><EFBFBD><EFBFBD>"&&animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
trotters.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
candy.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>" && animationloadmark == 1)
|
|||
|
|
{
|
|||
|
|
trotters2.SetActive(true);
|
|||
|
|
semizhuti1.SetActive(false);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>" && animationloadmark == 2)
|
|||
|
|
{
|
|||
|
|
trotters3.SetActive(true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>ɲݶ<C9B2><DDB6><EFBFBD><EFBFBD>ز<EFBFBD>
|
|||
|
|
else if (txtFoodName.GetComponent<Text>().text == "<22><><EFBFBD>ɲ<EFBFBD>")
|
|||
|
|
{
|
|||
|
|
shaoxiancaoTransform.SetActive(true);
|
|||
|
|
if (obj.name == "<22><><EFBFBD><EFBFBD>")
|
|||
|
|
{
|
|||
|
|
potato.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><>Բ" && animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
ball.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>" && animationloadmark == 0)
|
|||
|
|
{
|
|||
|
|
pearl.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22>ɲ<EFBFBD>")
|
|||
|
|
{
|
|||
|
|
grass.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "ţ<><C5A3>")
|
|||
|
|
{
|
|||
|
|
milk.SetActive(true);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><>Բ" && animationloadmark == 1)
|
|||
|
|
{
|
|||
|
|
ball2.SetActive(true);
|
|||
|
|
semishaoxaincao2.SetActive(false);
|
|||
|
|
}
|
|||
|
|
else if (obj.name == "<22><><EFBFBD><EFBFBD>" && animationloadmark == 1)
|
|||
|
|
{
|
|||
|
|
pearl2.SetActive(true);
|
|||
|
|
semishaoxaincao2.SetActive(false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
//ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
private void TransRandom(Transform transPar)
|
|||
|
|
{
|
|||
|
|
System.Random ran = new System.Random();
|
|||
|
|
int index = 0;
|
|||
|
|
Transform temp;
|
|||
|
|
for (int i = 0; i < transPar.childCount; i++)
|
|||
|
|
{
|
|||
|
|
index = ran.Next(0, transPar.childCount - 1);
|
|||
|
|
if (index!=i)
|
|||
|
|
{
|
|||
|
|
temp = transPar.GetChild(index);
|
|||
|
|
transPar.GetChild(i).SetSiblingIndex(index);
|
|||
|
|
temp.SetSiblingIndex(i);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|