# Conflicts: # Assets/Scenes/SampleScene.unitymaster
@ -0,0 +1,8 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 4e4e17e5beebfb746ac8d3e8d10c137b | |||||
folderAsset: yes | |||||
DefaultImporter: | |||||
externalObjects: {} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@ -0,0 +1,28 @@ | |||||
using System.Collections; | |||||
using System.Collections.Generic; | |||||
using UnityEngine; | |||||
public class GameStateController : MonoBehaviour | |||||
{ | |||||
// Start is called before the first frame update | |||||
void Start() | |||||
{ | |||||
} | |||||
public void WinState() | |||||
{ | |||||
Debug.Log("You win!"); | |||||
} | |||||
public void LoseState() | |||||
{ | |||||
Debug.Log("You lose!"); | |||||
} | |||||
// Update is called once per frame | |||||
void Update() | |||||
{ | |||||
} | |||||
} |
@ -0,0 +1,11 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 24cee4f9f3aafc34fb344ec4b026a3ae | |||||
MonoImporter: | |||||
externalObjects: {} | |||||
serializedVersion: 2 | |||||
defaultReferences: [] | |||||
executionOrder: 0 | |||||
icon: {instanceID: 0} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@ -0,0 +1,28 @@ | |||||
using System.Collections; | |||||
using System.Collections.Generic; | |||||
using UnityEngine; | |||||
public class KillZone : MonoBehaviour | |||||
{ | |||||
public HerdController herd; | |||||
// Start is called before the first frame update | |||||
void Start() | |||||
{ | |||||
herd = FindObjectOfType<HerdController>(); | |||||
} | |||||
private void OnTriggerEnter(Collider other) | |||||
{ | |||||
Debug.Log("Hit"); | |||||
PlayerController horse = other.GetComponent<PlayerController>(); | |||||
if (horse != null) | |||||
herd.RemoveHorse(horse); | |||||
} | |||||
// Update is called once per frame | |||||
void Update() | |||||
{ | |||||
} | |||||
} |
@ -0,0 +1,11 @@ | |||||
fileFormatVersion: 2 | |||||
guid: a6921e276aa68434aa72e38b4ad0190f | |||||
MonoImporter: | |||||
externalObjects: {} | |||||
serializedVersion: 2 | |||||
defaultReferences: [] | |||||
executionOrder: 0 | |||||
icon: {instanceID: 0} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |
@ -0,0 +1,36 @@ | |||||
using System.Collections; | |||||
using System.Collections.Generic; | |||||
using UnityEngine; | |||||
public class Objective : MonoBehaviour | |||||
{ | |||||
private List<PlayerController> onObjective = new List<PlayerController>(); | |||||
private GameStateController GameState; | |||||
// Start is called before the first frame update | |||||
void Start() | |||||
{ | |||||
GameState = FindObjectOfType<GameStateController>(); | |||||
} | |||||
private void OnTriggerEnter(Collider other) | |||||
{ | |||||
PlayerController horse = other.GetComponent<PlayerController>(); | |||||
if (horse != null) | |||||
onObjective.Add(horse); | |||||
} | |||||
private void OnTriggerExit(Collider other) | |||||
{ | |||||
PlayerController horse = other.GetComponent<PlayerController>(); | |||||
if (horse != null) | |||||
onObjective.Remove(horse); | |||||
} | |||||
// Update is called once per frame | |||||
void Update() | |||||
{ | |||||
if(onObjective.Count >= 10) | |||||
GameState.WinState(); | |||||
} | |||||
} |
@ -0,0 +1,11 @@ | |||||
fileFormatVersion: 2 | |||||
guid: 7ae3efa00f9dbc5458f2601705870f17 | |||||
MonoImporter: | |||||
externalObjects: {} | |||||
serializedVersion: 2 | |||||
defaultReferences: [] | |||||
executionOrder: 0 | |||||
icon: {instanceID: 0} | |||||
userData: | |||||
assetBundleName: | |||||
assetBundleVariant: |