private void InitialiseSubControllers( SpeedController speedController, HotkeyWatcher hotkeyWatcher, CardAnimationController cardAnimationController, MapController mapController, EndGameAnimController endGameAnimController, Notifier notifier, OptionsPanel optionsPanel) { orig_InitialiseSubControllers( speedController, hotkeyWatcher, cardAnimationController, mapController, endGameAnimController, notifier, optionsPanel); if (_defaultMapSprite != null) { return; } var image = mapBackground.GetComponent <Image>(); _defaultMapSprite = image.sprite; }
void DrawProperty(MaterialProperty mp, MaterialEditor me) { if (mp != null) { if (mp.type == MaterialProperty.PropType.Texture) { me.TexturePropertySingleLine(new GUIContent(mp.displayName), mp); } else { EditorGUI.BeginChangeCheck(); me.ShaderProperty(mp, mp.displayName); if (EditorGUI.EndChangeCheck()) { if (Selection.activeGameObject != null) { CardAnimationController cac = Selection.activeGameObject.GetComponent <CardAnimationController>(); if (cac != null) { cac.ApplyDefaultValues(mp.name); } } } } } }
private extern void orig_InitialiseSubControllers( SpeedController speedController, HotkeyWatcher hotkeyWatcher, CardAnimationController cardAnimationController, MapController mapController, EndGameAnimController endGameAnimController, Notifier notifier, OptionsPanel optionsPanel);
void OnEnable() { mTarget = target as CardAnimationController; layerArr = layerSelections.ToArray(); typeArr = typeSelections.ToArray(); RebuiltDatas(); if (mTarget.Mat == null) { return; } for (int i = 0; i < mTarget.Mat.GetPropertyCount(); i++) { string propertyName = mTarget.Mat.GetPropertyName(i); propertyNameIndex.Add(propertyName, i); } }
public void CheckGameOver() { CardAnimationController[] allCards = GameObject.FindObjectsOfType <CardAnimationController>(); if (allCards != null && allCards.Length > 0) { List <CardAnimationController> cardsInFront = new List <CardAnimationController>(); for (int i = 0; i < allCards.Length; i++) { CardAnimationController cardTem = allCards[i]; if (cardTem.isInFront && !cardTem.isOver) { cardsInFront.Add(cardTem); } if (cardsInFront.Count >= 2) { string cardImageName1 = cardsInFront[0].GetCardImageName(); string cardImageName2 = cardsInFront[1].GetCardImageName(); if (cardImageName1 == cardImageName2) { cardsInFront[0].MatchSuccess(); //将这张牌标记成匹配成功的状态 cardsInFront[1].MatchSuccess(); //将这张牌标记成匹配成功的状态 } else { cardsInFront[0].MatchFail(); //反转这张牌到反面 cardsInFront[1].MatchFail(); //反转这张牌到反面 } allCards = GameObject.FindObjectsOfType <CardAnimationController>(); bool isAllOver = true; for (int o = 0; o < allCards.Length; o++) { isAllOver &= allCards[o].isOver; } if (isAllOver) { ToGameOverPage(); } break; } } } }