void UpdateSwitchColor() { buttonState = portalControl.GetActivePortal(); portalSwitchSprite.SetSprite(buttonState); }
/* * private void OnTriggerEnter(Collider other) * { * if (other.CompareTag("Player") && IsActive && other.GetComponent<PortalTimer>().IsTeleportable) * { * other.GetComponent<PlayerInput>().Teleport(destinationPortal); * other.GetComponent<PortalTimer>().StartPortalTimer(); * } * } */ public void UpdatePortal() { IsActive = (portalColor == portalControl.GetActivePortal()); }