Nearly finished.....
This commit is contained in:
@@ -61,5 +61,7 @@ namespace Scampz.GameJam.Assets.Scripts.Audio
|
||||
public static string TempleStep => "temple step ed";
|
||||
|
||||
public static string GrassStep => "grass step ed";
|
||||
|
||||
public static string Void => "void";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,8 +45,9 @@ namespace Scampz.GameJam
|
||||
EndDialogue();
|
||||
}
|
||||
|
||||
public void StartDialogue(Dialogue dialogue)
|
||||
public void StartDialogue(Dialogue dialogue, TextMeshProUGUI textMeshProUGUI)
|
||||
{
|
||||
_dialogueTextGUI = textMeshProUGUI;
|
||||
_animator.SetBool("IsOpen", true);
|
||||
IsTalking = true;
|
||||
sentences.Clear();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Scampz.GameJam
|
||||
@@ -5,10 +6,12 @@ namespace Scampz.GameJam
|
||||
public class DialogueTrigger : MonoBehaviour
|
||||
{
|
||||
public Dialogue dialogue;
|
||||
[SerializeField]
|
||||
private TextMeshProUGUI _dialogueTextGUI;
|
||||
|
||||
public void TriggerDialogue()
|
||||
{
|
||||
DialogueManager.Instance.StartDialogue(dialogue);
|
||||
DialogueManager.Instance.StartDialogue(dialogue, _dialogueTextGUI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
13
Assets/Scripts/Player/OpenVoid.cs
Normal file
13
Assets/Scripts/Player/OpenVoid.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Scampz.GameJam.Assets.Scripts.Player
|
||||
{
|
||||
public class OpenVoid : MonoBehaviour
|
||||
{
|
||||
private void Update()
|
||||
{
|
||||
if (UnlockSanctumState.Instance.VoidOpened)
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Player/OpenVoid.cs.meta
Normal file
11
Assets/Scripts/Player/OpenVoid.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac239a5b51bd7c84d8abe88686241cf1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
13
Assets/Scripts/Player/TalkedToAirshipGuy.cs
Normal file
13
Assets/Scripts/Player/TalkedToAirshipGuy.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Scampz.GameJam.Assets.Scripts.Player
|
||||
{
|
||||
public class TalkedToAirshipGuy : MonoBehaviour
|
||||
{
|
||||
public void OnTriggerStay(Collider other)
|
||||
{
|
||||
if (Input.GetButton(InputOptions.Submit))
|
||||
UnlockSanctumState.Instance.TalkedToAirshipGuy = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Player/TalkedToAirshipGuy.cs.meta
Normal file
11
Assets/Scripts/Player/TalkedToAirshipGuy.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b68a11e9789f6344a053b00f7cc3dcc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
13
Assets/Scripts/Player/TalkedToFrogLady.cs
Normal file
13
Assets/Scripts/Player/TalkedToFrogLady.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Scampz.GameJam.Assets.Scripts.Player
|
||||
{
|
||||
public class TalkedToFrogLady : MonoBehaviour
|
||||
{
|
||||
public void OnTriggerStay(Collider other)
|
||||
{
|
||||
if (Input.GetButton(InputOptions.Submit))
|
||||
UnlockSanctumState.Instance.TalkedToFrog = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Player/TalkedToFrogLady.cs.meta
Normal file
11
Assets/Scripts/Player/TalkedToFrogLady.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0be6aa3e5193f4f4e91e4b2707b8e1ae
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
13
Assets/Scripts/Player/TalkedToIceGuy.cs
Normal file
13
Assets/Scripts/Player/TalkedToIceGuy.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Scampz.GameJam.Assets.Scripts.Player
|
||||
{
|
||||
public class TalkedToIceGuy : MonoBehaviour
|
||||
{
|
||||
public void OnTriggerStay(Collider other)
|
||||
{
|
||||
if (Input.GetButton(InputOptions.Submit))
|
||||
UnlockSanctumState.Instance.TalkedToIceGuy = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Player/TalkedToIceGuy.cs.meta
Normal file
11
Assets/Scripts/Player/TalkedToIceGuy.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26df9f81f16eb254dae2480172770084
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
Assets/Scripts/Player/TalkedToVoid.cs
Normal file
16
Assets/Scripts/Player/TalkedToVoid.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Scampz.GameJam.Assets.Scripts.Player
|
||||
{
|
||||
public class TalkedToVoid : MonoBehaviour
|
||||
{
|
||||
public void OnTriggerStay(Collider other)
|
||||
{
|
||||
if (other.CompareTag("Player"))
|
||||
{
|
||||
if (Input.GetButton(InputOptions.Submit))
|
||||
UnlockSanctumState.Instance.VoidOpened = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Player/TalkedToVoid.cs.meta
Normal file
11
Assets/Scripts/Player/TalkedToVoid.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b45a63a9fe7ce264e9e339f4366a5651
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
32
Assets/Scripts/Player/UnlockSanctumState.cs
Normal file
32
Assets/Scripts/Player/UnlockSanctumState.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Scampz.GameJam.Assets.Scripts
|
||||
{
|
||||
public class UnlockSanctumState : MonoBehaviour
|
||||
{
|
||||
public bool TalkedToFrog = false;
|
||||
public bool TalkedToIceGuy = false;
|
||||
public bool TalkedToAirshipGuy = false;
|
||||
public bool SanctumUnlocked = false;
|
||||
public bool VoidOpened = false;
|
||||
|
||||
public static UnlockSanctumState Instance;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance != null && Instance != this)
|
||||
{
|
||||
Destroy(this);
|
||||
return;
|
||||
}
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (TalkedToFrog && TalkedToIceGuy && TalkedToAirshipGuy)
|
||||
SanctumUnlocked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Player/UnlockSanctumState.cs.meta
Normal file
11
Assets/Scripts/Player/UnlockSanctumState.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c388cea5ac5cb0241bc77335e96e4f59
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
57
Assets/Scripts/SceneManagement/ConditionalTeleportPlayer.cs
Normal file
57
Assets/Scripts/SceneManagement/ConditionalTeleportPlayer.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Scampz.GameJam.Assets.Scripts.SceneManagement
|
||||
{
|
||||
public class ConditionalTeleportPlayer : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private Transform _spawnPointA;
|
||||
[SerializeField]
|
||||
private Transform _spawnPointB;
|
||||
[SerializeField]
|
||||
private Camera[] camerasToActivateA;
|
||||
[SerializeField]
|
||||
private Camera[] camerasToActivateB;
|
||||
|
||||
private void OnTriggerEnter(Collider collider)
|
||||
{
|
||||
if (collider.CompareTag("Player"))
|
||||
{
|
||||
StartCoroutine(LoadNextLevel());
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator LoadNextLevel()
|
||||
{
|
||||
var spawnPoint = _spawnPointA;
|
||||
var cameras = camerasToActivateA;
|
||||
|
||||
if (UnlockSanctumState.Instance.SanctumUnlocked)
|
||||
{
|
||||
spawnPoint = _spawnPointB;
|
||||
cameras = camerasToActivateB;
|
||||
}
|
||||
|
||||
var levelChanger = FindObjectOfType<LevelChanger>();
|
||||
levelChanger.FadeAnimation();
|
||||
yield return null;
|
||||
var player = GameObject.FindGameObjectWithTag("Player");
|
||||
var cc = player.GetComponent<CharacterController>();
|
||||
cc.enabled = false;
|
||||
player.SetActive(false);
|
||||
yield return new WaitForSeconds(1.0f);
|
||||
yield return null;
|
||||
player.transform.position = spawnPoint.position;
|
||||
player.transform.rotation = spawnPoint.rotation;
|
||||
cc.enabled = true;
|
||||
var allCamerasInCurrentScene = FindObjectsOfType<Camera>();
|
||||
foreach (var sceneCamera in allCamerasInCurrentScene)
|
||||
sceneCamera.enabled = false;
|
||||
foreach (var camera in cameras)
|
||||
camera.enabled = true;
|
||||
player.SetActive(true);
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1fb7be0fc28d35643b97add275864329
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,4 +1,5 @@
|
||||
using Scampz.GameJam.Assets.Scripts;
|
||||
using Scampz.GameJam.Assets.Scripts.Audio;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
@@ -42,6 +43,7 @@ namespace Scampz.GameJam
|
||||
private void LoadNextLevel()
|
||||
{
|
||||
_loaded = true;
|
||||
SFXManager.Instance.PlaySoundEffect(SoundEffectName.Ok);
|
||||
GameManager.Instance.LoadScene(_scene, LoadSceneMode.Single);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user