/// <summary> /// 初期カードをセット /// </summary> /// <param name="cards">カードのオブジェクト配列</param> IEnumerator InitSetCard(GameObject[] cards, bool dealer) { bool reverse = dealer; foreach (var obj in cards.Select((value, index) => new { index, value })) { DeckClass.Card card = DrawDeck(); obj.value.GetComponent<CardData>().SetData(card, dealer, obj.index > 1, reverse); reverse = false; } yield return null; }
private bool WaypointsAreValid(GameObject[] waypoints) { //first check whether whey all have a OrderedWaypoint component if (!waypoints.All(x => x.GetComponent<OrderedWaypointForEditor>() != null)) { EditorUtility.DisplayDialog("Error", "All waypoints must have an ordered waypoint component", "OK"); return false; } //check if all Order fields on the orderwaypoint components are different if (waypoints.Count() != waypoints.Select(x=>x.GetComponent<OrderedWaypointForEditor>().Order).Distinct().Count()) { EditorUtility.DisplayDialog("Error", "All waypoints must have a different order", "OK"); return false; } return true; }