Пример #1
0
 public void Vote(bool value)
 {
     PageSwapper.SetPage(PageSwapper.Page + 1, true);
     PlayerPrefs.SetInt("currentDatingPage", PageSwapper.Page);
     if (value && Random.Range(0f, 1f) > .5f)
     {
         Profile p = Data.SearchProfile(photo.sprite);
         if (p != null && !Data.chats.Contains(p))
         {
             Data.chats.Add(p);
         }
     }
 }
Пример #2
0
    public static void OpenChat(Profile profile)
    {
        if (SceneManager.GetActiveScene().name != "Chat")
        {
            SceneManager.LoadScene("Chat");
        }

        Text  name  = GameObject.Find("Canvas/Grid/Page1/TopBar/Name").GetComponent <Text>();
        Image image = GameObject.Find("Canvas/Grid/Page1/TopBar/PhotoMask/Photo").GetComponent <Image>();

        name.text    = profile.name;
        image.sprite = profile.profilePic;

        MessageHandler messageHandler = GameObject.Find("Canvas/Grid/Page1/InputBar/InputField").GetComponent <MessageHandler>();

        Debug.Log("message");
        messageHandler.SetMessages(profile);

        PageSwapper.SetPage(1);
    }
Пример #3
0
 void Start()
 {
     PageSwapper.SetPage(PlayerPrefs.GetInt("currentDatingPage"));
 }