void OnDrop(GameObject go) { UIPlate plate = go.transform.GetComponent <UIPlate>(); if (plate != null) { plate.ResetPostion(true); } }
void OnDrop(GameObject go) { if (go.transform.GetComponent <UIPlate>()) { UIPlate plate = go.transform.GetComponent <UIPlate>(); plate.backSprite.depth = 6; plate.icon.depth = 7; if (plate.icon != null) { plate.icon.transform.parent = this.transform; plate.icon.transform.localPosition = Vector3.zero; plate.icon.alpha = 0; sprite = plate.icon; this.plate = plate; if (plate.data.answer == UIPlateManager.instance.curQuestionData.rightOne || plate.data.answer == UIPlateManager.instance.curQuestionData.rightTwo) { plate.ResetPostion(false); plate.SetColliderEnable(false); SetCollierEnable(false); Invoke("SetSpriteRightBack", 0.2f); if (PlayMonsterAnimations.instance != null) { PlayMonsterAnimations.instance.PlayEatAnimation(); } } else { plate.ResetPostion(true); SetCollierEnable(false); plate.SetColliderEnable(false); Invoke("SetSpriteWrongBack", 0.2f); if (PlayMonsterAnimations.instance != null) { PlayMonsterAnimations.instance.PlayEatAnimation(); } } } } }
void OnDrop(GameObject go) { if(go.transform.GetComponent<UIPlate>()) { UIPlate plate = go.transform.GetComponent<UIPlate>(); plate.backSprite.depth = 6; plate.icon.depth = 7; if(plate.icon != null) { plate.icon.transform.parent = this.transform; plate.icon.transform.localPosition = Vector3.zero; plate.icon.alpha = 0; sprite = plate.icon; this.plate = plate; if(plate.data.answer == UIPlateManager.instance.curQuestionData.rightOne || plate.data.answer == UIPlateManager.instance.curQuestionData.rightTwo) { plate.ResetPostion(false); plate.SetColliderEnable(false); SetCollierEnable(false); Invoke("SetSpriteRightBack",0.2f); if(PlayMonsterAnimations.instance != null) { PlayMonsterAnimations.instance.PlayEatAnimation(); } }else{ plate.ResetPostion(true); SetCollierEnable(false); plate.SetColliderEnable(false); Invoke("SetSpriteWrongBack",0.2f); if(PlayMonsterAnimations.instance != null) { PlayMonsterAnimations.instance.PlayEatAnimation(); } } } } }
void OnDrop(GameObject go) { if (go.transform.GetComponent <UIPlate>()) { UIPlate plate = go.transform.GetComponent <UIPlate>(); plate.backSprite.depth = 6; plate.icon.depth = 7; plate.ResetPostion(true); if (!UIArithmeticGuideManager.isGuide) { if (UIArithmeticGuideManager.Instance != null) { UIArithmeticGuideManager.Instance.PlayWrongDragAudio(); } } } }