Esempio n. 1
0
    private void RefillCoolant(EventInfo ei)
    {
        CoolantRefillStatusEventInfo crsei = (CoolantRefillStatusEventInfo)ei;

        refillingCoolant = crsei.Status;
        coolantPerSecond = crsei.Coolant;
    }
Esempio n. 2
0
    void Update()
    {
        if (player != null)
        {
            Debug.Log(player.transform.position + " : " + playerPos);
            timer += Time.deltaTime;
            if (player.transform.position != playerPos)
            {
                Debug.Log("player Moved");
                moved     = true;
                playerPos = player.transform.position;
            }
            else
            {
                moved = false;
                Debug.Log("player not moving");
            }

            if (moved)
            {
                timer = 0;
                if (refilling)
                {
                    station.GetComponent <MeshRenderer>().material = standardMat;
                    CoolantRefillStatusEventInfo crsei = new CoolantRefillStatusEventInfo(gameObject, false, 0);
                    EventCoordinator.ActivateEvent(crsei);
                }
            }

            if (timer > timeBeforeActivate && !refilling)
            {
                station.GetComponent <MeshRenderer>().material = refillMat;
                CoolantRefillStatusEventInfo crsei = new CoolantRefillStatusEventInfo(gameObject, true, coolantPerSecond);
                EventCoordinator.ActivateEvent(crsei);
                refilling = true;
            }
        }
    }
Esempio n. 3
0
    private void DeactivateCoolantRefill()
    {
        CoolantRefillStatusEventInfo crsei = new CoolantRefillStatusEventInfo(gameObject, false, 0);

        EventCoordinator.ActivateEvent(crsei);
    }
Esempio n. 4
0
    private void ActivateCoolantRefill()
    {
        CoolantRefillStatusEventInfo crsei = new CoolantRefillStatusEventInfo(gameObject, true, cooling);

        EventCoordinator.ActivateEvent(crsei);
    }