Commit d37db3d0 authored by 15박보승's avatar 15박보승

Merge branch 'mirror'

# Conflicts:
#	Assets/2019-07-02-13-21-35.json.meta
parents 7c754168 ea184ec5
{"objects":[{"tag":0,"xPos":20.0,"yPos":0.0},{"tag":2,"xPos":-2.0,"yPos":-0.5},{"tag":2,"xPos":-1.0,"yPos":-0.5},{"tag":2,"xPos":0.5,"yPos":-1.0},{"tag":3,"xPos":0.0,"yPos":-0.5},{"tag":3,"xPos":1.0,"yPos":-0.5},{"tag":1,"xPos":-2.0,"yPos":1.0},{"tag":1,"xPos":-1.0,"yPos":1.0},{"tag":1,"xPos":0.0,"yPos":1.0},{"tag":1,"xPos":1.0,"yPos":1.0},{"tag":1,"xPos":1.0,"yPos":0.0},{"tag":1,"xPos":0.0,"yPos":0.0},{"tag":1,"xPos":-1.0,"yPos":0.0},{"tag":1,"xPos":-2.0,"yPos":0.0},{"tag":1,"xPos":-2.0,"yPos":-1.0},{"tag":1,"xPos":-1.0,"yPos":-1.0},{"tag":1,"xPos":0.0,"yPos":-1.0},{"tag":1,"xPos":1.0,"yPos":-1.0},{"tag":1,"xPos":1.0,"yPos":-2.0},{"tag":1,"xPos":0.0,"yPos":-2.0},{"tag":1,"xPos":-1.0,"yPos":-2.0},{"tag":1,"xPos":-2.0,"yPos":-2.0},{"tag":4,"xPos":-2.0,"yPos":-2.0},{"tag":5,"xPos":1.0,"yPos":-2.0},{"tag":6,"xPos":1.0,"yPos":-1.0}],"clears":[{"type":6,"goal":1}],"bullets":[1,1]}
\ No newline at end of file
......@@ -48,6 +48,7 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor
MapManager.inst.currentMap.clearConditions[GameManager.aCase].IsDone(1);
if (GameManager.nCase >= 0)
MapManager.inst.currentMap.clearConditions[GameManager.nCase].IsDone(1);
floor.objOnFloor = null;
Destroy(gameObject);
}
}
......
......@@ -10,8 +10,7 @@ public class Floor : MonoBehaviour
public Vector2Int mapPos;
public bool isGoalFloor = false;
public IObject objOnFloor = null;
public int copyCounter = 0; // count for mirror copy
public bool isPlayerOn = false;
// Start is called before the first frame update
void Start()
......
This diff is collapsed.
......@@ -72,7 +72,9 @@ public class Player : MonoBehaviour
while (Mathf.Abs(transform.position.x - destination.x) > 0.01f || Mathf.Abs(transform.position.z - destination.z) > 0.01f)
yield return null;
transform.position = new Vector3(destination.x, transform.position.y, destination.z);
currentFloor.isPlayerOn = false;
currentFloor = MapManager.inst.currentMap.GetFloorAtPos(new Vector2Int((int)destination.x, (int)destination.z));
currentFloor.isPlayerOn = true;
PlayerController.inst.CheckCurrentFloors();
anim.SetBool("isWalking", false);
PlayerController.inst.isPlayerMoving = false;
......
......@@ -38,6 +38,7 @@ public class PlayerController : SingletonBehaviour<PlayerController>
}
GameObject player = Instantiate(MapManager.inst.player, floor.transform.position + new Vector3(0, 0.1f, 0), Quaternion.identity);
player.GetComponent<Player>().currentFloor = floor;
floor.isPlayerOn = true;
MapManager.inst.players.Add(player);
if (GameManager.nPlayer >= 0)
{
......@@ -67,6 +68,7 @@ public class PlayerController : SingletonBehaviour<PlayerController>
{
if (obj.GetComponent<Player>().currentFloor == floor)
{
floor.isPlayerOn = false;
MapManager.inst.players.Remove(obj);
if (GameManager.nPlayer >= 0)
{
......
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