void Update()
    {
        GameObject obj    = GameObject.Find("MainDialog");
        MainDialog dialog = obj.GetComponent <MainDialog>();

        EnergyController energyCtrler = (EnergyController)AppController.Instance.GetController(Controller.ENERGY);
        GameController   gameCtrler   = (GameController)AppController.Instance.GetController(Controller.GAME);
        GachaController  gachaCtrler  = (GachaController)AppController.Instance.GetController(Controller.GACHA);

        if (!dialog.isShowingDialog && !gachaCtrler.isSpinning && energyCtrler.currentEnergy > 0 && canMove && !gameCtrler.gameEnded)
        {
            Vector3 pos = transform.position;
            pos.z = 0;
            transform.position = pos;
            float timeRatio = (gameCtrler.startTime - gameCtrler.currentTime) / gameCtrler.startTime;
            _speed = minSpeed + ((maxSpeed - minSpeed) * timeRatio);
            float _horizontalInput = Input.GetAxisRaw("Horizontal");
            float _verticalInput   = Input.GetAxisRaw("Vertical");
            if (_verticalInput != 0f)
            {
                _animator.SetFloat("HorizontalInput", 0f);
            }
            else
            {
                _animator.SetFloat("HorizontalInput", _horizontalInput);
            }
            _animator.SetFloat("VerticalInput", _verticalInput);
            _charController.Move(new Vector3(_horizontalInput * _speed * Time.deltaTime, _verticalInput * _speed * Time.deltaTime, 0.0f));
        }
        else
        {
            _animator.SetFloat("HorizontalInput", 0);
            _animator.SetFloat("VerticalInput", 0);
        }
    }
Beispiel #2
0
 protected override void OnDestroy()
 {
     base.OnDestroy();
     if (!Object.op_Inequality((Object)this.mGachaController, (Object)null))
     {
         return;
     }
     Object.Destroy((Object)((Component)this.mGachaController).get_gameObject());
     this.mGachaController = (GachaController)null;
 }
Beispiel #3
0
 private void DecideTutorialGacha()
 {
     if (Object.op_Inequality((Object)this.m_GachaController, (Object)null))
     {
         Object.Destroy((Object)((Component)this.m_GachaController).get_gameObject());
         this.m_GachaController = (GachaController)null;
     }
     if (Object.op_Inequality((Object)this.m_GachaResult, (Object)null))
     {
         Object.Destroy((Object)this.m_GachaResult);
         this.m_GachaResult = (GameObject)null;
     }
     FlowNode_GameObject.ActivateOutputLinks((Component)this, 13);
 }
Beispiel #4
0
 void CloseDialog()
 {
     dialogObj.SetActive(false);
     isShowingDialog = false;
     if (npcAsset != null)
     {
         GachaController gachaCtrler = (GachaController)AppController.Instance.GetController(Controller.GACHA);
         gachaCtrler.SpinGacha(npcAsset);
     }
     if (callback != null)
     {
         callback();
     }
 }
Beispiel #5
0
    IEnumerator Post(string postdata)
    {
        UnityWebRequest request = new UnityWebRequest(URL, "POST");

        byte[] bodyRaw = Encoding.UTF8.GetBytes(postdata);
        request.uploadHandler   = (UploadHandler) new UploadHandlerRaw(bodyRaw);
        request.downloadHandler = (DownloadHandler) new DownloadHandlerBuffer();
        request.SetRequestHeader("Content-Type", "application/json");

        yield return(request.Send());

        DataContractJsonSerializerSettings settings = new DataContractJsonSerializerSettings();

        settings.MaxItemsInObjectGraph = 10;

        string     json       = request.downloadHandler.text;
        GameObject Messageobj = GameObject.Find("Message");

        if (request.responseCode == 200)
        {
            GachaResponse data = JsonUtils.ToObject <GachaResponse>(json);
//Dbg.s(Messageobj);
            Text Messagetext = Messageobj.GetComponent <Text>();
            Messagetext.text = data.name + "をゲットしました";


            GameObject      gachacontrollerobj = GameObject.Find("GachaController");
            GachaController gachacontroller    = gachacontrollerobj.GetComponent <GachaController>();

            gachacontroller.Executionflag = true;
        }
        else   // todo 配列で返ってきたパターンでちゃんと表示できるようにする
        {
            ErrorResponse errorobj = JsonUtils.ToObject <ErrorResponse>(json);
            //errorobj.message = "test";
            Text Messagetext = Messageobj.GetComponent <Text>();

            Messagetext.text = errorobj.ErrorMessage;

            Debug.Log("GACHAFAILED");
        }
    }
Beispiel #6
0
 public void setGachaSummonButton(GachaController gachaController, Item item)
 {
     button.onClick.AddListener(delegate {
         gachaController.selectSummonItem(item);
     });
 }