我正在实现一个纸牌匹配游戏。
该事件将在卡首次部署后发送。
public void cardFlipStateUpdate()
{
foreach (Card card in cardAllInformation[current_pageNumber])
{
GameObject card_gameObj = cardAllGameObject[current_pageNumber][card.cardIndex] as GameObject;
int c_idx = card.cardIndex;
int c_uidx = card.cardUniqueIndex;
float delay_s = c_idx * 0.15f;
float delay_r = 2.5f + c_idx * 0.15f;
TouchEventManager.Instance.dispatch(c_idx, c_uidx, card_gameObj, card, true, "none", delay_s);
TouchEventManager.Instance.dispatch(c_idx, c_uidx, card_gameObj, card, true, "cardSelectionCriteria", delay_r);
}
}
public void onTuchHandler(object obj, EventArgs e)
{
TouchEventTypes t_evt = e as TouchEventTypes;
WordReviewUtil.cardFlipAnimation(t_evt.card_idx, t_evt.card_selectNum, t_evt.go, t_evt.card, t_evt.init, t_evt.complete, t_evt.delay);
}
这是接收上述事件的代码。
public static void cardFlipAnimation(int card_idx, int card_selectNum, GameObject gobj, Card card, bool init = false, string complete = "cardDifferentiate", float delay = 0f)
{
Hashtable data = new Hashtable();
// Debug.Log("cardFlipAnimation Receive Param >> " + card_idx + " / " + card_selectNum + " / " + gobj + " / ");
// Debug.Log("cardFlipAnimation Receive Param >> " + card + " / " + init + " / " + complete + " / " + delay);
// Debug.Log("============================================================================================");
data.Add("gobj", gobj);
data.Add("card", card);
Hashtable run_hash = new Hashtable();
run_hash.Add("y", 0.5);
run_hash.Add("time", 0.7);
run_hash.Add("delay", delay);
run_hash.Add("easetype", iTween.EaseType.easeInOutCubic);
run_hash.Add("onupdate", "test");
run_hash.Add("onupdatetarget", gobj);
run_hash.Add("onupdateparams", data);
run_hash.Add("oncomplete", complete);
run_hash.Add("oncompletetarget", gobj);
//Debug.Log("run_hash >> " + run_hash);
iTween.RotateBy(gobj, run_hash);
}
我创建了一个临时函数来检查上述代码是否正常工作。(("onupdate", "test");)
public void test()
{
Debug.Log("hello Moto~~");
}
但是无法验证日志。
我找不到原因。
你写错了什么?以及如何解决?
您的意见很有价值。请帮我。