Exemplo n.º 1
0
    void disableImage()
    {
        myPos = "";
//        VisitNumber++;
//		VisitItem [n].GetComponent<Item> ().save ();
//		VisitCounter.text = VisitNumber.ToString();
        FriendImage.GetComponent <Image>().enabled = false;
        TalkBalloonImage.SetActive(false);
        TalkBalloonImage2.SetActive(false);
        FriendList.VisitorNum--;
    }
Exemplo n.º 2
0
    void EnableImage()
    {
        TalkBalloonImage.GetComponent <TalkBalloon> ().load();
        TalkBalloonImage2.GetComponent <TalkBalloon> ().load();
        SetEnableTalkList();
        if (TalkBalloonImage.GetComponent <TalkBalloon> ().EnableTalkList.Count > 0)
        {
            bool isKnown;
            do
            {
                RandomNumber = UnityEngine.Random.Range(0, TalkBalloonImage.GetComponent <TalkBalloon> ().EnableTalkList.Count);
                isKnown      = TalkBalloonImage.GetComponent <TalkBalloon> ().alreadyShow(RandomNumber) && RandomNumber < PrevTalkNum();
            } while (isKnown);
            saveNumber = TalkBalloonImage.GetComponent <TalkBalloon> ().EnableTalkList [RandomNumber];
        }
        else
        {
            saveNumber = 0;
        }

        /////change emotion!_ except Ammonite & crocodile///
        colOfSeatImage = GetEmotionNumber(saveNumber);          //get column of SeatImage
        rowOfSeatImage = posNumber;
        if (!(ThisObject.GetComponent <VisitFriend> ().FriendNameVisit == "crocodileVisit") && !(ThisObject.GetComponent <VisitFriend> ().FriendNameVisit == "ammoniteVisit"))
        {
            RectTransform rt = seat_image [rowOfSeatImage].Image [colOfSeatImage].GetComponent <RectTransform> ();
            FriendImage.GetComponent <RectTransform> ().sizeDelta = new Vector2(rt.rect.width, rt.rect.height);
            FriendImage.sprite = seat_image [rowOfSeatImage].Image [colOfSeatImage].sprite;
        }
        ////////////////////////////////////////////////////


        FriendImage.GetComponent <Image>().enabled = true;
        if (IsAlreadyShow(saveNumber))
        {
            TalkBalloonImage.SetActive(true);
            TalkBalloonImage.GetComponent <TalkBalloon> ().SaveTalkNumber = saveNumber;
            TalkBalloonImage.GetComponent <TalkBalloon> ().save();
        }
        else
        {
            TalkBalloonImage2.SetActive(true);
            TalkBalloonImage2.GetComponent <TalkBalloon> ().SaveTalkNumber = saveNumber;
            TalkBalloonImage2.GetComponent <TalkBalloon> ().save();
        }
        FriendList.VisitorNum++;
        VisitNumber++;
        VisitItem [n].GetComponent <Item> ().save();
        VisitCounter.text = VisitNumber.ToString();
    }