private void RefillCoolant(EventInfo ei) { CoolantRefillStatusEventInfo crsei = (CoolantRefillStatusEventInfo)ei; refillingCoolant = crsei.Status; coolantPerSecond = crsei.Coolant; }
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; } } }
private void DeactivateCoolantRefill() { CoolantRefillStatusEventInfo crsei = new CoolantRefillStatusEventInfo(gameObject, false, 0); EventCoordinator.ActivateEvent(crsei); }
private void ActivateCoolantRefill() { CoolantRefillStatusEventInfo crsei = new CoolantRefillStatusEventInfo(gameObject, true, cooling); EventCoordinator.ActivateEvent(crsei); }