コード例 #1
0
    void OnDrop(GameObject go)
    {
        UIPlate plate = go.transform.GetComponent <UIPlate>();

        if (plate != null)
        {
            plate.ResetPostion(true);
        }
    }
コード例 #2
0
ファイル: UIDropZone.cs プロジェクト: Hengle/ClientFrameWork
 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();
                 }
             }
         }
     }
 }
コード例 #3
0
	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();
					}
				}
			}
		}
	}
コード例 #4
0
 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();
             }
         }
     }
 }