Commit 1f9e632d authored by 18손재민's avatar 18손재민

아이템이랑 머지하고 포탈 작동 이제 아이템의 작동 방식을 따름

parent 3b2b7a60
......@@ -170,8 +170,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: adab373df646d5f4fb794a3b6ffdf2d7, type: 3}
m_Name:
m_EditorClassIdentifier:
map: {fileID: 0}
roomInGame: {fileID: 0}
allTiles:
- {fileID: 11400000, guid: cad5b727dcc80234584fe4c3d4bac3ac, type: 2}
- {fileID: 11400000, guid: 648b887233c145948994a645b8a15292, type: 2}
......
......@@ -65,7 +65,7 @@ BoxCollider2D:
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1, y: 2.5}
m_Size: {x: 3.2, y: 2.35}
m_EdgeRadius: 0
--- !u!114 &114406776515389056
MonoBehaviour:
......
......@@ -238,7 +238,7 @@ public class PlayerController : MonoBehaviour
bool GetItemRay()
{
RaycastHit2D hit1 = Physics2D.Raycast(transform.position , Vector2.down, rayDistance, itemLayer);
Debug.DrawRay(transform.position , rayDistance * Vector2.down, Color.white);
Debug.DrawRay(transform.position , rayDistance * Vector2.down, Color.red);
if (hit1.collider != null)
{
IPlayerInteraction temp = hit1.collider.GetComponent<IPlayerInteraction>();
......
......@@ -2,14 +2,16 @@
using System.Collections.Generic;
using UnityEngine;
public class Portal : MonoBehaviour {
public class Portal : MonoBehaviour, IPlayerInteraction {
private void OnTriggerStay2D(Collider2D collision)
public void Apply()
{
if (collision.tag.Equals("Player") && Input.GetButtonDown("Interaction"))
{
if(GameManager.gameState == GameState.Ingame)
StartCoroutine(GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraController>().ChangeScene(GameState.Portal));
}
}
public void HighlightSwitch(bool enabled)
{
}
// Use this for initialization
......
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