Commit 94b01f3c authored by Jonas's avatar Jonas

Merge branch 'master' of...

Merge branch 'master' of gitlab.fsi.hochschule-trier.de:GameDevWeek/sommersemester-2019/unity/touch-me-if-you-can
parents 12e7c702 a63f8fd5
fileFormatVersion: 2
guid: 6de4aea1d19a51b4da8b810082d30f95
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4287269793653179316
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4979490206211125694}
- component: {fileID: 537870465706917231}
- component: {fileID: 3150255801453280764}
- component: {fileID: 2008477302556361684}
m_Layer: 5
m_Name: PlayerTag
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4979490206211125694
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4287269793653179316}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -18.691284, y: -2.4674377}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &537870465706917231
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4287269793653179316}
m_CullTransparentMesh: 0
--- !u!114 &3150255801453280764
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4287269793653179316}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_text: New Text
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_outlineColor:
serializedVersion: 2
rgba: 4278190080
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_textAlignment: 257
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: -1
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_ignoreRectMaskCulling: 0
m_ignoreCulling: 1
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_VertexBufferAutoSizeReduction: 1
m_firstVisibleCharacter: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 3150255801453280764}
characterCount: 8
spriteCount: 0
spaceCount: 1
wordCount: 2
linkCount: 0
lineCount: 1
pageCount: 1
materialCount: 1
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_hasFontAssetChanged: 0
m_subTextObjects:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &2008477302556361684
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4287269793653179316}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6a24ac252658c014ca1ebf474572bc02, type: 3}
m_Name:
m_EditorClassIdentifier:
player: -1
bodyTag:
tag: {fileID: 0}
data: {fileID: 0}
character: {fileID: 0}
offset: {x: 0, y: 1, z: 0}
fileFormatVersion: 2
guid: c7c81494d91977b4ab6e5e21dbb5530e
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 2d82b416b9dd4b947824ee48c81f7e12
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
fileFormatVersion: 2
guid: 9237b512751da1745bd5dfebe51f8e0b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System;
using UnityEngine;
namespace _Game.Scripts.Camera {
public class CameraFollowMovement : MonoBehaviour {
private Transform _head, _body;
private void OnEnable() {
_head = GameObject.FindWithTag("HeadPlayer").transform;
_body = GameObject.FindWithTag("BodyPlayer").transform;
}
private void Update() {
var target = (_head.position + _body.position) / 2;
Debug.DrawLine(transform.position, target);
target = new Vector3(0, target.y, target.z) - transform.position;
var rotation = Quaternion.LookRotation(target, Vector3.up);
transform.rotation = Quaternion.RotateTowards(transform.rotation, rotation.normalized, 5);
}
}
}
fileFormatVersion: 2
guid: d718df83990771b47be6e1ec9df7498b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -77,11 +77,13 @@ namespace _Game.Scripts.GameManager {
if (data.IsSwitched) {
data.IsSwitched = false;
SceneManager.LoadScene("MainLevel");
SceneManager.LoadScene("InGameUI", LoadSceneMode.Additive);
SceneManager.LoadScene("DelayTimer", LoadSceneMode.Additive);
}
else {
data.IsSwitched = true;
SceneManager.LoadScene("MainLevelSwitched");
SceneManager.LoadScene("InGameUI", LoadSceneMode.Additive);
SceneManager.LoadScene("DelayTimer", LoadSceneMode.Additive);
}
}
......
......@@ -23,7 +23,6 @@ namespace _Game.Scripts.Observer {
public virtual IEnumerator StartCountdown() {
_isCounting = false;
if (!_isCounting) {
//_onStart.Invoke();
_isCounting = true;
_countdownTime = 0;
while (_countdownTime <= 1) {
......
......@@ -7,9 +7,8 @@ using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class CharacterCustomization : MonoBehaviour
{
public GameData data;
public class CharacterCustomization : MonoBehaviour {
[SerializeField] private GameData data;
public TMP_InputField player1InputField;
public TMP_InputField player2InputField;
public Button greenButtonP1;
......@@ -21,32 +20,26 @@ public class CharacterCustomization : MonoBehaviour
public Button yellowButtonP2;
public Button redButtonP2;
public Button blueButtonP2;
public Button greyButtonP2;
// Start is called before the first frame update
public Button greyButtonP2;
// Start is called before the first frame update
// called first
void OnEnable()
{
void OnEnable() {
SceneManager.sceneLoaded += OnSceneLoaded;
}
void OnDisable()
{
void OnDisable() {
Debug.Log("OnDisable");
SceneManager.sceneLoaded -= OnSceneLoaded;
}
//
// called second
void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
void OnSceneLoaded(Scene scene, LoadSceneMode mode) {
player1InputField.text = data.player1.name;
player2InputField.text = data.player2.name;
}
......@@ -58,24 +51,23 @@ public class CharacterCustomization : MonoBehaviour
data.player1.Reset(player1InputField.text, GameData.Role.Head);
data.player2.Reset(player2InputField.text, GameData.Role.Body);
SceneManager.LoadScene("MainLevel");
SceneManager.LoadScene("InGameUI", LoadSceneMode.Additive);
SceneManager.LoadScene("DelayTimer", LoadSceneMode.Additive);
}
public void ChangeColorPlayer1(int colors)
{
switch (colors)
{
public void ChangeColorPlayer1(int colors) {
switch (colors) {
case 1:
data.player1.color = Color.green;
break;
case 2 :
case 2:
data.player1.color = Color.yellow;
break;
case 3 :
case 3:
data.player1.color = Color.red;
break;
case 4 :
case 4:
data.player1.color = Color.blue;
break;
......@@ -83,131 +75,110 @@ public class CharacterCustomization : MonoBehaviour
data.player1.color = Color.gray;
break;
}
}
public void ChangeColorPlayer2(int colors2)
{
switch (colors2)
{
case 1:
data.player2.color = Color.green;
break;
case 2 :
data.player2.color = Color.yellow;
break;
case 3 :
data.player2.color = Color.red;
break;
case 4 :
data.player2.color = Color.blue;
break;
default :
data.player2.color = Color.gray;
break;
}
public void ChangeColorPlayer2(int colors2) {
switch (colors2) {
case 1:
data.player2.color = Color.green;
break;
case 2:
data.player2.color = Color.yellow;
break;
case 3:
data.player2.color = Color.red;
break;
case 4:
data.player2.color = Color.blue;
break;
default:
data.player2.color = Color.gray;
break;
}
}
public void ButtonSelected1(int buttonNummber)
{
switch (buttonNummber)
{
case 0 :
greenButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
yellowButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
case 1 :
yellowButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
case 2 :
redButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
case 3 :
blueButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
default :
greyButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
}
public void ButtonSelected1(int buttonNummber) {
switch (buttonNummber) {
case 0:
greenButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
yellowButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
}
public void ButtonSelected2(int buttonNummber2)
{
switch (buttonNummber2)
{
case 0 :
greenButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
yellowButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
case 1 :
yellowButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
case 2 :
redButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
case 3 :
blueButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
default :
greyButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
}
case 1:
yellowButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
case 2:
redButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
case 3:
blueButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
default:
greyButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP1.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
}
}
public void ButtonSelected2(int buttonNummber2) {
switch (buttonNummber2) {
case 0:
greenButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
yellowButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
case 1:
yellowButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
case 2:
redButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
case 3:
blueButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
greyButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
default:
greyButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.BoldAndItalic;
greenButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
yellowButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
redButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
blueButtonP2.GetComponentInChildren<Text>().fontStyle = FontStyle.Normal;
break;
}
}
}
using System;
using _Game.Scripts.GameManager;
using TMPro;
using UnityEngine;
using Debug = System.Diagnostics.Debug;
namespace _Game.Scripts.UI
{
public class PlayerTags : MonoBehaviour
{
public GameManagerData.GameManagerData data;
private TMP_Text _text;
private String _playerTag1;
private String _playerTag2;
private Color _playerColor;
public Transform player;