Commit af4780c9 authored by Chae Ho Shin's avatar Chae Ho Shin

Add Clock Level

parent a36508da
......@@ -306,7 +306,7 @@ SphereCollider:
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Radius: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &951264407139232476
MonoBehaviour:
......@@ -375,8 +375,10 @@ MonoBehaviour:
levelManager: {fileID: 0}
gamma: 1
time: 0
apparenttime: 0
theobject: {fileID: 951264407063557756}
mass: 1
isClock: 0
background: {fileID: 951264406399792102}
uiManager: {fileID: 0}
--- !u!1 &951264407764097795
......
This diff is collapsed.
......@@ -9,7 +9,7 @@
new CollisionType(ObjectType.player,true),
new CollisionType(ObjectType.normalobject,true),
new CollisionType(ObjectType.interactive,false),
new CollisionType(ObjectType.clock,true),
new CollisionType(ObjectType.clock,false),
new CollisionType(ObjectType.wall,true)
};
......@@ -30,10 +30,10 @@
};
public static CollisionType[] Clock { get; private set; } = {
new CollisionType(ObjectType.player,true),
new CollisionType(ObjectType.player,false),
new CollisionType(ObjectType.normalobject,true),
new CollisionType(ObjectType.interactive,false),
new CollisionType(ObjectType.clock,true),
new CollisionType(ObjectType.clock,false),
new CollisionType(ObjectType.wall,true)
};
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ClockLevelManager : LevelManager
{
// Start is called before the first frame update
protected override void Start()
{
ExplanationText = new string[] { "파란색 시계와 빨간색 시계는 20초씩 어긋나 있다.",
"이 둘의 시간 차가 2초 이하가 되게 만들어 서로 붇히면 레벨 Clear!" };
Todo = "빨강 & 파랑 시계 차이가 2초 이하 되게 만들어 붙히기.";
base.Start();
}
}
fileFormatVersion: 2
guid: 964860b1293e755448c6009070e0ef62
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
public class LinkedClock : Clock
{
public Clock otherclock;
public override void OnCollisionStaychild(Collision collision)
{
base.OnCollisionStaychild(collision);
//Debug.Log("hit!");
//if(collision.transform.parent.name != "AnObject(Clone)")
// Debug.Log(collision.gameObject.name + " wow!");
if (collision.transform.parent != null)
{
var x = collision.transform.parent.gameObject.GetComponent(typeof(Clock)) as Clock;
if (x != null && x.Equals(otherclock))
{
Debug.Log("hit!");
if (Mathf.Abs((float)(otherclock.GetTime() - time)) <= 2.0f)
{
levelManager.WinState = true;
}
else
{
Debug.Log(Mathf.Abs((float)(otherclock.GetTime() - time)));
}
}
}
}
}
fileFormatVersion: 2
guid: 37142b9be36036449855b563a41b4337
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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