Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bce5d88
Adding new scene and related code
Aug 25, 2025
06f4e94
fixing UI Manager bug
Aug 25, 2025
5534b49
add new code for newly addied
Aug 25, 2025
0dddae7
Remvoe unused code
Aug 25, 2025
7c8a9f0
Update UIManager and add new props to BehaviourIdentifation Scenes
Aug 25, 2025
2a4bebd
Update component file
Aug 25, 2025
9eaea23
Updated Scene
Aug 25, 2025
ae34868
updated scene
Aug 25, 2025
e3a5f74
Fixing Bug
Aug 28, 2025
5971527
Merge branch 'Insider-Threat-Sonny' of https://github.com/Hardhat-Ent…
Aug 28, 2025
edf48f3
Fix merge conflicts in UIManager.cs
Aug 28, 2025
e3a63a1
Adding Player POV and movement in Insider-Threat-2-BehaviourIdentific…
Aug 28, 2025
c439802
Making Player POV camera by default
Aug 28, 2025
bf71e98
Update Scene setting
Aug 28, 2025
de2817c
Fixing the player camera movement so it follows the player’s movement.
Aug 28, 2025
c523f6f
Fixing the player camera movement so it follows the player’s movement.
Aug 28, 2025
1e1d937
Update User setting
Aug 28, 2025
3795492
Resizing InfoPanel to display content
Aug 28, 2025
b0ac863
Canvas Resizing
Aug 28, 2025
647a6d9
Adding new infoPanel message
Sep 11, 2025
2c1ca9e
Fixing Typo and Update infoPanel Size to display content
Sep 18, 2025
576982c
Update InsiderThreat-02 Scene
Sep 18, 2025
05ac00b
update UIManager.cs
Sep 18, 2025
4c15598
Update InsiderThreat-03 Scene
Sep 18, 2025
1f1dc8b
Update InsiderThreat-02 Scene
Sep 18, 2025
bbc9772
Update InsiderThreat-03 Scene
Sep 18, 2025
b138c39
Update Movement script on InsiderThreat-02 Player Object
Sep 18, 2025
5e9eb65
Update Movement script for InsiderThreat-03 Player Object
Sep 18, 2025
60cdc41
Updating .gitignore
Sep 18, 2025
f037dc1
Update UserSetting files
Sep 18, 2025
694d627
Update Activity 2 and 3
Sep 21, 2025
4c60cf5
Updated Scene object and layer
Sep 24, 2025
fb10265
Adding new script for testing
Sep 24, 2025
90b2252
Adding new layer
Sep 24, 2025
8be83cb
Update Assets setting
Sep 24, 2025
667b30e
update namespace
Sep 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ sysinfo.txt

# Unity cache
obj/

# Asset meta data should only be ignored when the corresponding asset is also ignored
/UserSettings/EditorUserSettings.asset
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"visualstudiotoolsforunity.vstuc"
]
}
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Unity",
"type": "vstuc",
"request": "attach"
}
]
}
60 changes: 60 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"files.exclude": {
"**/.DS_Store": true,
"**/.git": true,
"**/.vs": true,
"**/.gitmodules": true,
"**/.vsconfig": true,
"**/*.booproj": true,
"**/*.pidb": true,
"**/*.suo": true,
"**/*.user": true,
"**/*.userprefs": true,
"**/*.unityproj": true,
"**/*.dll": true,
"**/*.exe": true,
"**/*.pdf": true,
"**/*.mid": true,
"**/*.midi": true,
"**/*.wav": true,
"**/*.gif": true,
"**/*.ico": true,
"**/*.jpg": true,
"**/*.jpeg": true,
"**/*.png": true,
"**/*.psd": true,
"**/*.tga": true,
"**/*.tif": true,
"**/*.tiff": true,
"**/*.3ds": true,
"**/*.3DS": true,
"**/*.fbx": true,
"**/*.FBX": true,
"**/*.lxo": true,
"**/*.LXO": true,
"**/*.ma": true,
"**/*.MA": true,
"**/*.obj": true,
"**/*.OBJ": true,
"**/*.asset": true,
"**/*.cubemap": true,
"**/*.flare": true,
"**/*.mat": true,
"**/*.meta": true,
"**/*.prefab": true,
"**/*.unity": true,
"build/": true,
"Build/": true,
"Library/": true,
"library/": true,
"obj/": true,
"Obj/": true,
"Logs/": true,
"logs/": true,
"ProjectSettings/": true,
"UserSettings/": true,
"temp/": true,
"Temp/": true
},
"dotnet.defaultSolution": "CyberSafeVR.2.sln"
}
40 changes: 40 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/AuditManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System.Collections.Generic;
using UnityEngine;

namespace InsiderThreat02
{
/// <summary>
/// Manages the audit process, tracking inspected objects and calculating scores.
/// </summary>

public class AuditManager : MonoBehaviour
{
public List<Interactable> allObjects = new List<Interactable>(); // All objects in scene
private int inspectedCount = 0;

private UIManager uiManager;

public void ObjectInspected(Interactable obj)
{
if (!allObjects.Contains(obj))
{
allObjects.Add(obj);
inspectedCount++;
Debug.Log("Inspected: " + obj.title);
}
}

public void ShowAuditScore()
{
int totalObjects = allObjects.Count;
string message = $"You inspected {inspectedCount} out of {totalObjects} objects.";

Debug.Log(message);

if (uiManager != null)
{
uiManager.ShowInfo("Audit Complete", message, "safe");
}
}
}
}
2 changes: 2 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/AuditManager.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/CollectEvidenceOnSelect.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;

namespace InsiderThreat02
{
/// <summary>
/// Collects evidence when the object is selected in a VR environment.
/// </summary>

public class CollectEvidenceOnSelect : MonoBehaviour
{
[SerializeField] EvidenceItem evidence;

public void OnSelected(SelectEnterEventArgs _)
{
if (evidence) EvidenceManager.Instance?.Collect(evidence);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/EventManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace InsiderThreat02
{
/// <summary>
/// Manages the collection and tracking of evidence items.
/// </summary>
///

public class EvidenceManager : MonoBehaviour
{
public static EvidenceManager Instance { get; private set; }
public List<EvidenceItem> collected = new();

[Header("UI")]
[SerializeField] GameObject listPanel;
[SerializeField] Transform listRoot;
[SerializeField] GameObject listRowPrefab; // a simple prefab: Text for name + (optional) icon

void Awake()
{
if (Instance != null && Instance != this) { Destroy(gameObject); return; }
Instance = this;
}

public void Collect(EvidenceItem item)
{
if (item == null || collected.Contains(item)) return;
collected.Add(item);
AddRow(item);
}

void AddRow(EvidenceItem item)
{
if (!listRoot || !listRowPrefab) return;
var row = Instantiate(listRowPrefab, listRoot);
var texts = row.GetComponentsInChildren<Text>();
if (texts.Length > 0) texts[0].text = item.displayName;
}

public int SuspiciousCount()
{
int c = 0;
foreach (var e in collected) if (e.suspicious) c++;
return c;
}
}
}
2 changes: 2 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/EventManager.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/EvidenceItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using UnityEngine;

namespace InsiderThreat02
{
/// <summary>
/// ScriptableObject representing an evidence item in the training module.
/// </summary>

[CreateAssetMenu(menuName = "Training/Evidence Item")]
public class EvidenceItem : ScriptableObject
{
public string evidenceId;
public string displayName;
[TextArea] public string description;
public bool suspicious;
}
}
2 changes: 2 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/EvidenceItem.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/Interactable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using UnityEngine;

namespace InsiderThreat02
{
/// <summary>
/// Base class for all interactable objects in the scene.
/// </summary>

public class Interactable : MonoBehaviour
{
[Header("Object Info")]
public string title;
[TextArea] public string body;
public string status; // "safe", "risky", "warning"

private UIManager uiManager;
public AuditManager auditManager;

void Start()
{
// Recommended Unity 2023 LTS method
uiManager = Object.FindFirstObjectByType<UIManager>();

if (uiManager == null)
Debug.LogWarning("UIManager not found in scene!");
}

/// <summary>
/// Call this when the player selects/inspects the object
/// </summary>
public void OnSelect()
{
if (uiManager != null)
uiManager.ShowInfo(title, body, status);

if (auditManager != null)
auditManager.ObjectInspected(this);
}
}
}
2 changes: 2 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/Interactable.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/PlayerInteraction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using UnityEngine;

namespace InsiderThreat02
{
/// <summary>
/// Handles player interactions with objects in a VR environment.
/// </summary>

public class PlayerInteraction : MonoBehaviour
{
public float interactDistance = 3f; // how far the player can interact
public LayerMask interactableLayer; // assign in Inspector (e.g., "Interactable")

void Update()
{
if (Input.GetKeyDown(KeyCode.E)) // press E to interact (or replace with VR button)
{
Ray ray = new Ray(Camera.main.transform.position, Camera.main.transform.forward);
RaycastHit hit;

if (Physics.Raycast(ray, out hit, interactDistance, interactableLayer))
{
Interactable interactable = hit.collider.GetComponent<Interactable>();
if (interactable != null)
{
Debug.Log("Interacting with: " + hit.collider.name);
interactable.OnSelect();
}
}
}
}
}
}
2 changes: 2 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/PlayerInteraction.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Assets/Code/Scripts/InsiderSscript/ToggleCanvasOnSelect.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;

namespace InsiderThreat02
{
/// <summary>
/// Toggles a specified canvas on or off when the object is selected.
/// </summary>

public class ToggleCanvasOnSelect : MonoBehaviour
{
[SerializeField] GameObject targetCanvas;

public void OnSelected(SelectEnterEventArgs _)
{
if (targetCanvas) targetCanvas.SetActive(!targetCanvas.activeSelf);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading