-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
146 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,24 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class Enemy : MonoBehaviour, IDamageable | ||
{ | ||
public float health = 100; | ||
|
||
// Start is called before the first frame update | ||
void Start() | ||
private void Start() | ||
{ | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
private void Update() | ||
{ | ||
if (health <= 0) | ||
{ | ||
Destroy(gameObject); | ||
} | ||
if (health <= 0) Destroy(gameObject); | ||
} | ||
|
||
public void Damage(float damageAmount) | ||
{ | ||
Debug.Log("hit"); | ||
health -= damageAmount; | ||
if (health <= 0) | ||
{ | ||
Destroy(gameObject); | ||
} | ||
if (health <= 0) Destroy(gameObject); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.AI; | ||
|
||
public class Navigation : MonoBehaviour | ||
{ | ||
[SerializeField] private Transform destination; | ||
private NavMeshAgent navMeshAgent; | ||
|
||
private void Awake() | ||
{ | ||
navMeshAgent = GetComponent<NavMeshAgent>(); | ||
} | ||
|
||
private void Update() | ||
{ | ||
navMeshAgent.destination = destination.position; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class InteractDoor : MonoBehaviour, IInteractable | ||
{ | ||
[SerializeField] private string interactionPrompt; | ||
|
||
public string interactPrompt => interactionPrompt; | ||
|
||
public bool Interact(Interactor interactor) | ||
{ | ||
Debug.Log("Interacting with door!"); | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class InteractWeapon : MonoBehaviour, IInteractable | ||
{ | ||
[SerializeField] private string interactionPrompt; | ||
|
||
public string interactPrompt => interactionPrompt; | ||
|
||
public bool Interact(Interactor interactor) | ||
{ | ||
Debug.Log("Interacting with weapon!"); | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.