public void Copy(CardGroundBehaviour CGB)
    {
        this.m_Description1.GetComponent<Text>().text = CGB.m_Description1.GetComponent<Text>().text;
        this.m_Description2.GetComponent<Text>().text = CGB.m_Description2.GetComponent<Text>().text;
        this.m_Description3.GetComponent<Text>().text = CGB.m_Description3.GetComponent<Text>().text;
        this.m_name.GetComponent<Text>().text = CGB.m_name.GetComponent<Text>().text;

        this.m_type = CGB.m_type;
    }
    public void setNewCardLandFromCard(CardGroundBehaviour CGB)
    {
        if (currentCard != null)
            this.removeCard ();

        CardViewer.GetComponent<CardViewerBehaviour> ().setAllyTexture ();

        CardUI = (GameObject)Resources.Load("CardGUILand", typeof(GameObject));
        CardGroundBehaviour script = CardUI.GetComponent<CardGroundBehaviour>();

        script.Copy (CGB);

        getGoodTypePrefabLand (script.m_type, script);

        currentCard = GameObject.Instantiate((GameObject)CardUI);

        currentCard.transform.SetParent (transform);
        currentCard.transform.localScale = Vector3.one;
    }
 public void getGoodTypePrefabLand(string type, CardGroundBehaviour scriptLand)
 {
     if (scriptLand != null)
     {
         switch (type) {
         case "Forest":
             CardUI.GetComponent<Image> ().sprite = scriptLand.m_forest;
             break;
         case "Mountain":
             CardUI.GetComponent<Image> ().sprite = scriptLand.m_mountain;
             break;
         case "Plain":
             CardUI.GetComponent<Image> ().sprite = scriptLand.m_plain;
             break;
         case "Ruin":
             CardUI.GetComponent<Image> ().sprite = scriptLand.m_ruin;
             break;
         case "Swamp":
             CardUI.GetComponent<Image> ().sprite = scriptLand.m_swamp;
             break;
         }
     }
 }
    public void OnMouseExit()
    {
        if (Hand.GetComponent<HandBehaviour> ().m_cardDragLand != null)
        {

            scriptLand = Hand.GetComponent<HandBehaviour> ().m_cardDragLand;
            BoardBehaviour boardBehaviour = GameObject.FindObjectOfType<BoardBehaviour>().GetComponent<BoardBehaviour>();

            for (int i = 0; i < scriptLand.xValue.Count; i++)
            {
                boardBehaviour.HoverCubeOff((m_gridX + scriptLand.xValue[i]),(m_gridY +  scriptLand.yValue[i]));
            }
        }

        if (m_isOccuped)
        {
            m_cardHolder.GetComponent<CardHolderBehaviour> ().removeCard ();
        }

        m_isPointed = false;

        OverOff ();
    }
    public void OnMouseEnter()
    {
        if (m_isOccuped)
        {
            m_cardHolder.setNewCarUnitFromTokken (m_tokken.GetComponent<TokkenBehaviour> ());
        }
        m_isPointed = true;

        if (Hand.GetComponent<HandBehaviour> ().m_cardDragLand != null) {

            scriptLand = Hand.GetComponent<HandBehaviour> ().m_cardDragLand;
            BoardBehaviour boardBehaviour = GameObject.FindObjectOfType<BoardBehaviour>().GetComponent<BoardBehaviour>();

            for (int i = 0; i < scriptLand.xValue.Count; i++)
            {
                boardBehaviour.HoverCubeOn((m_gridX + scriptLand.xValue[i]),(m_gridY +  scriptLand.yValue[i]));
            }
        }

        /*if (Hand.GetComponentInChildren<DraggableBehaviour> ().m_currentTypeCard == "Land") {
            Debug.Log ("Okay 1");
            foreach (DraggableBehaviour scriptLand in Hand.GetComponentsInChildren<DraggableBehaviour>()) {
                Debug.Log(scriptLand.m_isDrag);
                if (scriptLand.m_isDrag) {
                    Debug.Log ("Okay 2");
                }
            }
        }*/

        OverOn ();
    }
    public void ChangeTextureClose(CardGroundBehaviour LandScript)
    {
        BoardBehaviour boardBehaviour = GameObject.FindObjectOfType<BoardBehaviour>().GetComponent<BoardBehaviour>();

        for (int i = 0; i < LandScript.xValue.Count; i++)
        {
            boardBehaviour.ChangeTextureCubes((m_gridX + LandScript.xValue[i]),(m_gridY +  LandScript.yValue[i]),this.GetComponent<Renderer>().material);
        }
    }