예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (IsBroken)
        {
            if (repairing)
            {
                float curTime = (Time.time - startTime);
                InteractionController.SetUseDisplay(repairTime, curTime);

                if (curTime >= repairTime)
                {
                    IsBroken  = false;
                    repairing = false;
                    InteractionController.FinishRepair();
                }
            }
            else if ((Time.time - brokenTime) >= autoRepairTime)
            {
                RepairManager.Instance.ShowRepairNotification("Auto repaired " + gameObject.name + " for " + MoneySystem.FormatMoney(autoRepairCost));

                IsBroken = false;
                InteractionController.FinishRepair();
                MoneySystem.TakeMoney(autoRepairCost);
            }
        }
    }