Add light intensity focussing
This commit is contained in:
@@ -161,6 +161,17 @@ public class CameraController : MonoBehaviour
|
||||
originalColour = currentlyHoveredRenderer.material.color;
|
||||
currentlyHoveredRenderer.material.color = highlightColour;
|
||||
}
|
||||
|
||||
|
||||
if (currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>() != null)
|
||||
{
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>().isfocussed = 1;
|
||||
}
|
||||
|
||||
if (currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>() != null)
|
||||
{
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>().isfocussed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -181,6 +192,23 @@ public class CameraController : MonoBehaviour
|
||||
{
|
||||
currentlyHoveredRenderer.material.color = originalColour;
|
||||
}
|
||||
|
||||
if (
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>() != null &&
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>() != currentDoorManager
|
||||
)
|
||||
{
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>().isfocussed = 0;
|
||||
}
|
||||
|
||||
if (
|
||||
currentlyHoveredRenderer.gameObject.GetComponent<GuardManager>() != null &&
|
||||
currentlyHoveredRenderer.gameObject.GetComponent<GuardManager>() != currentGuardManager
|
||||
)
|
||||
{
|
||||
currentlyHoveredRenderer.gameObject.GetComponent<GuardManager>().isfocussed = 0;
|
||||
}
|
||||
|
||||
currentlyHoveredRenderer = null;
|
||||
}
|
||||
}
|
||||
@@ -227,14 +255,20 @@ public class CameraController : MonoBehaviour
|
||||
if (talkButton != null) talkButton.gameObject.SetActive(false);
|
||||
if (doorButton != null) doorButton.gameObject.SetActive(false);
|
||||
|
||||
UnsetAll();
|
||||
currentDoorManager = null;
|
||||
currentGuardManager = null;
|
||||
|
||||
if (guard != null)
|
||||
{
|
||||
currentGuardManager = guard;
|
||||
guard.isfocussed = 2;
|
||||
if (talkButton != null) talkButton.gameObject.SetActive(true);
|
||||
}
|
||||
else if (door != null)
|
||||
{
|
||||
currentDoorManager = door;
|
||||
door.isfocussed = 2;
|
||||
if (doorButton != null) doorButton.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
@@ -278,6 +312,7 @@ public class CameraController : MonoBehaviour
|
||||
currentGuardManager = null;
|
||||
currentDoorManager = null;
|
||||
|
||||
UnsetAll();
|
||||
if (talkButton != null) talkButton.gameObject.SetActive(false);
|
||||
if (doorButton != null) doorButton.gameObject.SetActive(false);
|
||||
}
|
||||
@@ -294,4 +329,17 @@ public class CameraController : MonoBehaviour
|
||||
explorationCamera.transform.rotation = startingRotation;
|
||||
}
|
||||
}
|
||||
|
||||
private void UnsetAll()
|
||||
{
|
||||
foreach (var doorManager in LevelLoader.Instance.Doors)
|
||||
{
|
||||
doorManager.isfocussed = 0;
|
||||
}
|
||||
foreach (var doorManager in LevelLoader.Instance.Guards)
|
||||
{
|
||||
doorManager.isfocussed = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user