public static void startMiniGame(XmlNode gameData) { string name = gameData.getString(); singleton.current = (GameObject)Instantiate(singleton.miniGameTypes[name]); singleton.current.transform.parent = singleton.gameObject.transform; singleton.current.GetComponent<MiniGameAPI>().Data = gameData; }
private static bool checkHave(XmlNode haveReq) { int haveQuantity = UserProperty.GetPropNode(haveReq.getString()).GetInt(); foreach (XmlNode atLeast in haveReq.SelectNodes(AT_LEAST)) { if (MathData.GetInt(atLeast) > haveQuantity) { return false; } } foreach (XmlNode exactly in haveReq.SelectNodes(EXACTLY)) { if (MathData.GetInt(exactly) != haveQuantity) { return false; } } return true; }