Example #1
0
    void Start()
    {
        tree = GetComponentInParent <Stage3_5_tree_coco>();
        transform.parent.gameObject.SetActive(false);
        try{
            likeListUI     = GameObject.Find("quest12_likelist(Clone)");
            likeListScript = likeListUI.GetComponent <Stage3_5_likeList>();
        } catch {
        }

        if (GameObject.Find("Stage3_5_GameController") != null)
        {
            stage3_5_GameController = GameObject.Find("Stage3_5_GameController").GetComponent <Stage3_5_GameController> ();
            likeOn  = stage3_5_GameController.likeOn;
            likeOff = stage3_5_GameController.likeOff;
        }
        else if (GameObject.Find("Stage3_6_GameController") != null)
        {
            stage3_6_GameController = GameObject.Find("Stage3_6_GameController").GetComponent <Stage3_6_GameController> ();
            likeOn  = stage3_6_GameController.likeOn;
            likeOff = stage3_6_GameController.likeOff;
        }

        if (tree.ID >= 1 && tree.ID <= 3 && Stage3_Controller.q [tree.ID + 15])
        {
            GetComponent <SpriteRenderer>().sprite = likeOn;
        }
        else
        {
            GetComponent <SpriteRenderer>().sprite = likeOff;
        }
    }
Example #2
0
 void OnEnable()
 {
     try{
         likeListUI     = GameObject.Find("quest12_likelist(Clone)");
         likeListScript = likeListUI.GetComponent <Stage3_5_likeList>();
     } catch {
     }
 }
Example #3
0
    void showHeart(int i)
    {
        likeListUI     = GameObject.Find("quest12_likelist(Clone)");
        likeListScript = likeListUI.GetComponent <Stage3_5_likeList>();

        if (tree.like && likeListUI != null)
        {
            likeListScript.heart[i].GetComponent <Image>().enabled = true;
        }
        else if (!tree.like && likeListUI != null)
        {
            likeListScript.heart[i].GetComponent <Image>().enabled = false;
        }
    }