Ejemplo n.º 1
0
    public void StartDay()
    {
        Time.timeScale = 1.0f;
        CollectBunny(0);
        timeLeftInDay = amountOfTimePerDay;

        powerDispPanel.SetActive(true);
        shopPanel.SetActive(false);

        if (we != null)
        {
            WirePort pswp = PowerSupply.Instance.gameObject.GetComponent <WirePort>();
            we.PlugInWire(pswp);
            we = null;
        }

        foreach (GameObject go in activatedComponents)
        {
            go.GetComponent <ComputerComponent>().ResetObj();
        }

        foreach (GameObject component in mainComponents)
        {
            MainComponents compMA = component.GetComponent <MainComponents>();

            compMA.currentTemp = MainComponents.minTemp;

            switch (compMA.mca)
            {
            case MainCompAttach.CPU:
                compMA.speed = cpuSpeed;
                break;

            case MainCompAttach.GPU:
                compMA.speed = gpuSpeed;
                break;

            case MainCompAttach.RAM:
                compMA.speed = ramSpeed;
                break;

            case MainCompAttach.HDD:
                compMA.speed = hddSpeed;
                break;

            case MainCompAttach.PSU:
                PowerSupply.Instance.maxPowerDraw = maxPowerDraw = psuWatts;
                break;

            default:
                break;
            }
        }

        dayOver = false;
    }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        wires = GameObject.FindGameObjectsWithTag("MainFan");
        CollectBunny(0);
        timeLeftInDay = amountOfTimePerDay;
        cam           = Camera.main;
        player        = GameObject.FindGameObjectWithTag("Player");

        mainComponents.Add(PowerSupply.Instance.gameObject);
        psuWatts = maxPowerDraw = PowerSupply.Instance.maxPowerDraw;

        foreach (GameObject mc in GameObject.FindGameObjectsWithTag("Main Component"))
        {
            mainComponents.Add(mc);

            MainComponents mcs = mc.GetComponent <MainComponents>();

            switch (mcs.mca)
            {
            case MainCompAttach.CPU:
                cpuSpeed = mcs.speed;
                cpuDraw  = mcs.powerDraw;
                break;

            case MainCompAttach.GPU:
                gpuSpeed = mcs.speed;
                gpuDraw  = mcs.powerDraw;
                break;

            case MainCompAttach.RAM:
                ramSpeed = mcs.speed;
                ramDraw  = mcs.powerDraw;
                break;

            case MainCompAttach.HDD:
                hddSpeed = mcs.speed;
                hddDraw  = mcs.powerDraw;
                break;

            default:
                break;
            }
        }
    }