Commit 518f188b authored by Chae Ho Shin's avatar Chae Ho Shin

Merge remote-tracking branch 'origin/collision-model' into collision-model

parents 3fdc0f0e ca905aa3
......@@ -17,10 +17,14 @@ public class AlertManager : MonoBehaviour
Queue<string> alertTextQueue;
private void Awake()
{
Close();
}
// Start is called before the first frame update
void Start()
{
Close();
//string[] aa = { "a","b" };
//Alert(aa);
}
......@@ -56,13 +60,13 @@ public class AlertManager : MonoBehaviour
}
public void AlertQueue()
protected void AlertQueue()
{
if(alertTextQueue.Count >= 2)
{
Alert(alertTextQueue.Dequeue(), AlertQueue, DeleteQueue);
}
else
else if(alertTextQueue.Count == 1)
{
Alert(alertTextQueue.Dequeue());
}
......
This diff is collapsed.
fileFormatVersion: 2
guid: 09fd81914134c4f4a823ec2102b1bbfb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -395,13 +395,24 @@ MonoBehaviour:
m_GameObject: {fileID: 279236942}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 14f968d942299c84ca786317f6de8274, type: 3}
m_Script: {fileID: 11500000, guid: 85f33cc515852874d98f6c1e43799fe5, type: 3}
m_Name:
m_EditorClassIdentifier:
uiManager: {fileID: 394305455}
gamma: 0
player: {fileID: 739347346}
ExplanationText:
- "\uBC11\uC5D0 \uC18D\uB825 \uBC14\uAFB8\uACE0 \uB354\uBE14\uD074\uB9AD\uD558\uBA74
\uC774\uB3D9\uB428"
- "\uADF8\uBC29\uD5A5\uC73C\uB85C \uBA40\uB9AC\uBA40\uB9AC"
- "\uD574\uBCF4\uC790"
- "cancel \uB204\uB974\uBA74 \uB354 \uB098\uC62C\uB9D0\uB4E4 \uC0AC\uB77C\uC9D0"
- "\u3147\u3147"
winstate: 0
DoubleClickMove: 1
PathRanderMove: 0
WASDMove: 0
Todo:
--- !u!1 &332710466
GameObject:
m_ObjectHideFlags: 0
......@@ -743,9 +754,13 @@ MonoBehaviour:
levelManager: {fileID: 279236944}
player: {fileID: 739347346}
pathRenderer: {fileID: 948598108}
todoText: {fileID: 1387602088}
playerSquare: {fileID: 934514725}
cameraMovement: {fileID: 1661408491}
scrollSpeed: 5
WASDMove: 1
DoubleCLickMove: 1
alert: {fileID: 1878497986}
--- !u!4 &394305456
Transform:
m_ObjectHideFlags: 0
......@@ -1192,11 +1207,11 @@ MonoBehaviour:
m_GameObject: {fileID: 535323107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 11c0c0a758005e0408c9a767ec478e97, type: 3}
m_Script: {fileID: 11500000, guid: d21dcedb7a777274ab532991e3f871d8, type: 3}
m_Name:
m_EditorClassIdentifier:
objectType: 3
collisionPreset: 4
objectType: 4
collisionPreset: 3
beta: 0
alpha: {x: 0, y: 0, z: 0}
v: {x: 0, y: 0, z: 0}
......@@ -1206,8 +1221,6 @@ MonoBehaviour:
time: 0
theobject: {fileID: 535323107}
mass: 10
starttime: 60
otherclock: {fileID: 1094934749}
--- !u!4 &535323109
Transform:
m_ObjectHideFlags: 0
......@@ -1216,7 +1229,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 535323107}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -3.72, y: 0, z: 0.72}
m_LocalPosition: {x: 2.73, y: 0, z: 0.72}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 439858922}
......@@ -2095,7 +2108,7 @@ MonoBehaviour:
PathColliderPrefab: {fileID: 8684657376034186961, guid: bf9de3c1290fd0749b383f44c1e706f8,
type: 3}
playercamera: {fileID: 1661408489}
levelManager: {fileID: 279236944}
levelManager: {fileID: 0}
background: {fileID: 1713675715}
velocityslider: {fileID: 260633610}
ui: {fileID: 394305455}
......@@ -2147,10 +2160,10 @@ RectTransform:
m_Father: {fileID: 1193230061}
m_RootOrder: 3
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: -374.6, y: 176.4}
m_SizeDelta: {x: 26.5, y: 17.4}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 25.400024, y: -48.600006}
m_SizeDelta: {x: 26.5, y: 17.399994}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &959584786
MonoBehaviour:
......@@ -3027,11 +3040,11 @@ MonoBehaviour:
m_GameObject: {fileID: 1094934748}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 11c0c0a758005e0408c9a767ec478e97, type: 3}
m_Script: {fileID: 11500000, guid: d21dcedb7a777274ab532991e3f871d8, type: 3}
m_Name:
m_EditorClassIdentifier:
objectType: 3
collisionPreset: 4
objectType: 4
collisionPreset: 3
beta: 0
alpha: {x: 0, y: 0, z: 0}
v: {x: 0, y: 0, z: 0}
......@@ -3041,8 +3054,6 @@ MonoBehaviour:
time: 0
theobject: {fileID: 1094934748}
mass: 10
starttime: 0
otherclock: {fileID: 535323108}
--- !u!4 &1094934750
Transform:
m_ObjectHideFlags: 0
......@@ -3359,6 +3370,7 @@ RectTransform:
- {fileID: 1086622586}
- {fileID: 527034808}
- {fileID: 798238900}
- {fileID: 1387602087}
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -3461,10 +3473,10 @@ RectTransform:
m_Father: {fileID: 1193230061}
m_RootOrder: 4
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: -348.1, y: 176.39998}
m_SizeDelta: {x: 26.5, y: 17.4}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 51.899994, y: -48.60002}
m_SizeDelta: {x: 26.5, y: 17.399994}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1207526025
MonoBehaviour:
......@@ -3770,6 +3782,85 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1335777780}
m_CullTransparentMesh: 0
--- !u!1 &1387602086
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1387602087}
- component: {fileID: 1387602089}
- component: {fileID: 1387602088}
m_Layer: 5
m_Name: ToDo
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1387602087
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1387602086}
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: 1193230061}
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 92.3, y: -217}
m_SizeDelta: {x: 160, y: 300}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1387602088
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1387602086}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, 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_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\uD560\uC77C\n"
--- !u!222 &1387602089
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1387602086}
m_CullTransparentMesh: 0
--- !u!1 &1477382725
GameObject:
m_ObjectHideFlags: 0
......@@ -4074,9 +4165,9 @@ RectTransform:
m_Father: {fileID: 1193230061}
m_RootOrder: 2
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: -307.85, y: 184.8}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 92.149994, y: -40.199997}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1678224218
......@@ -4275,9 +4366,9 @@ RectTransform:
m_Father: {fileID: 1193230061}
m_RootOrder: 1
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: -307.85, y: 203.2}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 92.149994, y: -21.800003}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1710021924
......@@ -4431,7 +4522,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a937b7b15233ade4b8c2766ff3695fb7, type: 3}
m_Name:
m_EditorClassIdentifier:
levelManager: {fileID: 279236944}
levelManager: {fileID: 0}
starttime: 0
gamma: 1
--- !u!1 &1751424968
......
......@@ -5,14 +5,28 @@ using UnityEngine;
public class Level1Manager : LevelManager
{
// Start is called before the first frame update
void Start()
Vector3 orig;
protected override void Start()
{
base.Start();
orig = player.transform.position;
}
protected override bool WinCondition()
{
if(XZLengthSquare(player.transform.position,orig) > 100)
{
return true;
}
else
{
return false;
}
}
// Update is called once per frame
void Update()
float XZLengthSquare(Vector3 a, Vector3 b)
{
return (a.x - b.x) * (a.x - b.x) + (a.z - b.z) * (a.z - b.z);
}
}
......@@ -9,16 +9,41 @@ public class LevelManager : MonoBehaviour
public double gamma;
public PlayerMovement player;
public string[] ExplanationText = { "aa","bb"};
[SerializeField]
protected bool winstate = false;
[SerializeField]
protected bool DoubleClickMove = true;
[SerializeField]
protected bool PathRanderMove = true;
[SerializeField]
protected bool WASDMove = true;
[SerializeField]
protected string Todo;
// Start is called before the first frame update
void Start()
protected virtual void Start()
{
winstate = false;
uiManager.WASDMove = WASDMove;
uiManager.PathCreateAble = PathRanderMove;
uiManager.DoubleCLickMove = DoubleClickMove;
uiManager.TodoText = Todo;
uiManager.alert.Alert(ExplanationText);
}
// Update is called once per frame
void Update()
protected virtual void Update()
{
if (WinCondition())
{
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts.ObjectMovement
{
class NormalObject : Planemovement
{
}
}
fileFormatVersion: 2
guid: d21dcedb7a777274ab532991e3f871d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -45,7 +45,7 @@ public class PlayerMovement : FlatlandMovement,IInteractor,IGraber
if (obj)
{
uiManager.InteractText = obj.InteractType;
uiManager.InteractText = "G:"+obj.InteractType;
}
else
{
......
......@@ -48,7 +48,7 @@ public class PathRenderer : MonoBehaviour
_pathRenderer = GetComponent<LineRenderer>();
_ResetPaths();
pathcreatable = true;
//pathcreatable = true;
}
// Update is called once per frame
......
......@@ -31,11 +31,18 @@ public class UIManager : MonoBehaviour
public PlayerMovement player;
public PathRenderer pathRenderer;
public Text todoText;
public Square playerSquare;
public CameraMovement cameraMovement;
public float scrollSpeed = 1.0f;
public bool WASDMove = true;
public bool DoubleCLickMove = true;
public AlertManager alert;
private int prevSelectPathNum = -1;
private Text pathName;
private Text pathVelocity;
......@@ -46,6 +53,8 @@ public class UIManager : MonoBehaviour
GraphicRaycaster gr;
PointerEventData ped;
// Start is called before the first frame update
void Start()
{
......@@ -57,6 +66,10 @@ public class UIManager : MonoBehaviour
gr = canvas.GetComponent<GraphicRaycaster>();
ped = new PointerEventData(null);
//string[] a = { "a", "b" };
//alert.Alert(a);
}
// Update is called once per frame
......@@ -120,9 +133,11 @@ public class UIManager : MonoBehaviour
cameraMovement.Size += scroll;
playerSquare.Scale = 1/cameraMovement.SizeScale;
//player movement
if (pathRenderer.pathcreatable)
//player movement
if (WASDMove)
{
if (Input.GetKeyDown("w"))
{
......@@ -188,6 +203,14 @@ public class UIManager : MonoBehaviour
wintext.GetComponent<Text>().text = "Lose";
}
public bool PathCreateAble
{
set
{
pathRenderer.pathcreatable = value;
}
}
private void updatePathInfo(int pathNum)
{
pathName.text = "Path - " + pathNum;
......@@ -274,9 +297,10 @@ public class UIManager : MonoBehaviour
public void OnDoubleClicked()
{
try
{
if (levelManager.player.IsInertial && pathRenderer.pathcreatable)
if (levelManager.player.IsInertial && DoubleCLickMove)
{
RaycastHit hit;
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
......@@ -308,6 +332,14 @@ public class UIManager : MonoBehaviour
}
}
public string TodoText
{
set
{
todoText.text = "할일:\n" + value;
}
}
public void PopupLastPathUI(int pathNum, RaycastHit hit)
{
prevSelectPathNum = pathNum;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment