Пример #1
0
    // Update is called once per frame
    void Update()
    {
        // this is in Update to make sure to get references
        if (energyStorage == null)
        {
            energyStorage           = GameObject.FindGameObjectWithTag("Canvas").GetComponent <ReactorController> ().GetEnergyStorage();
            distModel.EnergyStorage = energyStorage;
        }

        // this is in Update to make sure to get references
        if (coolantController == null)
        {
            coolantController           = GameObject.FindGameObjectWithTag("Canvas").GetComponent <CoolantView> ().coolController;
            distModel.CoolantController = coolantController;
        }

        time += Time.deltaTime;

        if (time >= TIME_STEP)
        {
            time = 0.0f;
            distModel.UpdateModel();
        }
    }
 void Awake()
 {
     coolController = new CoolantController();
 }