Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     if (RayInfo.GetMoneyFlag() == true)
     {
         CastNum = RayInfo.GetHitNum();
         RootGauge_MS.setGaugeRate(setSpeed(RMoney[CastNum].Amount));
         Gen.getObjStatus(RMoney[CastNum].Amount, RMoney[CastNum].isRooted);
         RootInfo.getInfo(RMoney[CastNum].Amount);
         if (RootGauge_MS.GetComp() == true)
         {
             if (MGetFlag)
             {
                 StartCoroutine(M_Get());
             }
             SResource.Instance.Nmoney += RMoney[CastNum].Amount;
             resourcel.MoneyUpdate();
             if (SResource.Instance.Nmoney >= 200000)
             {
                 SResource.Instance.IsFali = false;
                 SceneManager.LoadScene("CutScene");
             }
             RMoney[CastNum].Amount   = 0;
             RMoney[CastNum].isRooted = true;
         }
     }
 }
Exemple #2
0
    void FixedUpdate()
    {
        AngleCalc();

        transform.Rotate(SearchPos.up, Torque * Time.deltaTime * 20);
        Debug.DrawRay(SearchPos.position, SearchPos.forward * 20, Color.green);

        if (Input.GetKeyDown(KeyCode.T))
        {
            SResource.Instance.Nmoney += 100000;
        }

        if (Input.GetKeyDown(KeyCode.R))
        {
            temp1 -= 10000000;
        }

        if (Physics.Raycast(SearchPos.position, SearchPos.forward, out hit, 20.0f))
        {
            if (hit.collider.tag == "Player")
            {
                if (SResource.Instance.Nmoney > 0 && Cooltime == false)
                {
                    if (SResource.Instance.Nmoney >= 100000)
                    {
                        SResource.Instance.Nmoney -= 30000;
                    }
                    else if (SResource.Instance.Nmoney >= 10000)
                    {
                        SResource.Instance.Nmoney -= 10000;
                    }
                    resourcel.MoneyUpdate();
                    temp = 0;
                    for (int a = 0; a < 22; a++)
                    {
                        temp = temp + Money.RMoney[a].Amount;
                    }
                    temp = SResource.Instance.Nmoney + temp + temp1;

                    Cooltime = true;
                    StartCoroutine(CoolTime_Manager());
                    Hit_motion.IsLoad = true;
                    if (!(temp >= 200000))
                    {
                        SResource.Instance.IsFali = true;
                        SceneManager.LoadScene("CutScene");
                    }
                }
                if (FolCool == false)
                {
                    WifeInfo.isDied();
                    FolCool = true;
                    StartCoroutine(FolCool_Manager());
                }

                //Destroy(Enemy);
            }
        }
    }