|
|
@@ -35,6 +35,9 @@ public class CameraController : MonoBehaviour
|
|
|
|
|
|
public GameObject lineInCamera;
|
|
|
|
|
|
+ public int leftID;
|
|
|
+ public int rightID;
|
|
|
+ public bool isSplit;
|
|
|
|
|
|
private void Start()
|
|
|
{
|
|
|
@@ -63,13 +66,16 @@ public class CameraController : MonoBehaviour
|
|
|
if (player0Pos.x < player1Pos.x)
|
|
|
{
|
|
|
leftTargetPos = CameraTargetMove(PlayersInput.instance[0]);
|
|
|
+ leftID = 0;
|
|
|
rightTargetPos = CameraTargetMove(PlayersInput.instance[1]);
|
|
|
+ rightID = 1;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
leftTargetPos = CameraTargetMove(PlayersInput.instance[1]);
|
|
|
+ leftID = 1;
|
|
|
rightTargetPos = CameraTargetMove(PlayersInput.instance[0]);
|
|
|
-
|
|
|
+ rightID = 0;
|
|
|
}
|
|
|
|
|
|
view = Mathf.Clamp((distance - minDistance) * ratio, 0, maxView);
|
|
|
@@ -79,7 +85,7 @@ public class CameraController : MonoBehaviour
|
|
|
leftCamera.enabled = false;
|
|
|
rightCamera.enabled = false;
|
|
|
lineInCamera.SetActive(false);
|
|
|
-
|
|
|
+ isSplit = false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -94,7 +100,7 @@ public class CameraController : MonoBehaviour
|
|
|
leftCamera.enabled = true;
|
|
|
rightCamera.enabled = true;
|
|
|
lineInCamera.SetActive(true);
|
|
|
-
|
|
|
+ isSplit = true;
|
|
|
}
|
|
|
else
|
|
|
{
|