예제 #1
0
 void OnGachaLoaded()
 {
     // npnf feature: Getting inputs for gacha
     this.input = GachaInput.GetCachedById(gacha.GachaInputIds [0]);
     if (this.input != null)
     {
         OnGachaInputLoaded();
     }
     else
     {
         NPNF.Gachas.GachaInput.GetById(gacha.GachaInputIds [0],
                                        (GachaInput input, NPNFError error) => {
             if (input != null)
             {
                 this.input = input;
                 OnGachaInputLoaded();
             }
             else
             {
                 isSpinning = false;
                 LoadingSpinner.Instance.DisableLoadingSpinner();
                 Debug.LogError("Get Product Failed: " + error);
                 AppController.Instance.IsNetworkError(error);
             }
         });
     }
 }
예제 #2
0
    void OnTriggerEnter(Collider other)
    {
        GameObject obj        = GameObject.Find("MainDialog");
        MainDialog mainDialog = obj.GetComponent <MainDialog>();

        if (!entered && other.gameObject.name == "Player")
        {
            if (assetName != "Woo" && talkCount > 2)
            {
                mainDialog.ShowDialog("Half day!", null, null);
                return;
            }

            GameController gameCtrler = (GameController)AppController.Instance.GetController(Controller.GAME);

            //check if user has won
            if (assetName == "Woo" && gameCtrler.hasPitch)
            {
                gameCtrler.EndGame(true);
                return;
            }

            EnergyController energyCtrler = (EnergyController)AppController.Instance.GetController(Controller.ENERGY);

            string     sku   = (assetName == "Henry") ? "expensive fight" : "fight";
            GachaInput price = GachaInput.GetCachedBySku(sku);

            if (energyCtrler.currentEnergy >= price.Price.Amount)
            {
                int    i      = Random.Range(0, dialogs.Length);
                string dialog = dialogs [i];
                _animator.SetFloat("HorizontalInput", other.gameObject.transform.position.x - transform.position.x);
                _animator.SetFloat("VerticalInput", other.gameObject.transform.position.y - transform.position.y);

                mainDialog.ShowDialog(dialog, asset);
                talkCount++;
                StartCoroutine(CancelAnimation());
            }
            else
            {
                mainDialog.ShowDialog("Go away...", null, null);
            }
        }
    }
예제 #3
0
 public void StartModule()
 {
     if (ModuleHelpers.IsThisModuleActive(this.gameObject))
     {
         // npnf feature: Getting all Energy Bars
         Gacha.GetAll((List <Gacha> gachaDict, NPNFError error) => {
             GachaInput.GetAll((List <GachaInput> gachaInputList, NPNFError inputError) => {
                 if (error == null && inputError == null)
                 {
                     SetReady();
                 }
                 else
                 {
                     AppController.Instance.IsNetworkError(inputError);
                 }
             });
         });
     }
 }