コード例 #1
0
    // Use this for initialization
    IEnumerator Start()
    {
        panelanim = PanelImage.GetComponent <Animator>();

        /* BacktoryUser.LoginAsGuestInBackground(loginResponse =>
         * {
         *   if (loginResponse.Successful)
         *   {
         *       // Getting new username and password from CURRENT user
         *       string guestUsername = BacktoryUser.CurrentUser.Username;
         *       string guestPassword = BacktoryUser.CurrentUser.Password;
         *
         *       // Logging new username and password
         *       Debug.Log("your guest username: "******" & your guest password: "******"Login failed for other reasons like network issues.");
         +   }
         + });*/


        yield return(new WaitUntil(() => InternetChecker.Instance.internetConnectBool));

        if (!GameManager.Instance.stateData.hadBoughtFirstOffer)
        {
            BTNImage.gameObject.SetActive(true);
            BTNImage.sprite   = FirstBTN;
            PanelImage.sprite = FirstImage;
            BTNImage.GetComponent <Button>().onClick.AddListener(OnCLick);
            // yield return new WaitForSeconds(4f);
            loadingScreen.Instance.Disapear();
        }
        else
        {
            CheckForOffer();
            yield return(new WaitUntil(() => Show));

            BTNImage.gameObject.SetActive(true);
            BTNImage.GetComponent <Button>().onClick.AddListener(OnCLick);
            if (loadingScreen.Instance.GetComponent <Animator>().GetCurrentAnimatorStateInfo(0).IsName("MoveOut"))
            {
                loadingScreen.Instance.Disapear();
            }
        }
    }
コード例 #2
0
 public void init(int id)
 {
     if (!inPanel)
     {
         objectPanel.GetComponent <Transform>().position = new Vector3(Camera.main.GetComponent <Transform>().position.x, objectPanel.GetComponent <Transform>().position.y, objectPanel.GetComponent <Transform>().position.z);
         objectPanel.SetActive(true);
         PanelImage.GetComponent <Image>().sprite = objectsTexture[id];
         PanelTitle.GetComponent <Text>().text    = objectTitle[id];
         PanelText.GetComponent <Text>().text     = objectDescribe[id];
         if (objectApply[id] != "")
         {
             PanelApply.SetActive(true);
             PanelApply.GetComponent <Text>().text = objectApply[id];
         }
         else
         {
             PanelApply.SetActive(false);
         }
         mostRecentID = id;
         objectPanel.GetComponent <Animator>().Play("panel-zoom-in");
     }
 }