95 lines
4.2 KiB
C#
95 lines
4.2 KiB
C#
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class PortalMgr : MonoBehaviour
|
||
|
|
{
|
||
|
|
public GameObject go_portal, go_portal2; // 앞에꺼는 1->2, 뒤에꺼는 2->1
|
||
|
|
public GameObject go_portal3; // 2 로 감(들판에서 켈베로스 뒤에 있는 포탈)
|
||
|
|
|
||
|
|
float RestartJoystick = 0f;
|
||
|
|
|
||
|
|
private void Awake()
|
||
|
|
{
|
||
|
|
//MobInfo.Ins.m_PortalMgr = this;
|
||
|
|
//go_portal.SetActive(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void Update()
|
||
|
|
{
|
||
|
|
if (RestartJoystick > 0f)
|
||
|
|
{
|
||
|
|
//RestartJoystick -= Time.deltaTime;
|
||
|
|
//if (RestartJoystick <= 0f)
|
||
|
|
// UIJoystick.Ins.enabled = true;
|
||
|
|
}
|
||
|
|
|
||
|
|
// 포탈이 달라졌음 다 주석처리
|
||
|
|
//if (go_portal != null && go_portal.activeInHierarchy)
|
||
|
|
//{
|
||
|
|
// var pc_pos = MyValue.MyPC.Get_position();
|
||
|
|
// var portal_pos = go_portal.transform.position;
|
||
|
|
|
||
|
|
// if (Vector3.Distance(new Vector3(pc_pos.x, 0f, pc_pos.z), new Vector3(portal_pos.x, 0f, portal_pos.z)) <= 2f)
|
||
|
|
// {
|
||
|
|
// var curstagedata = InGameInfo.Ins.Get_CurStageData();
|
||
|
|
// MyValue.MyPC.Set_AutoBraking(true);
|
||
|
|
// MyValue.MyPC.Set_Warp(curstagedata.StartPcPos2);
|
||
|
|
// var fairy = ActorInfo.Ins.Get_Actor(eRole.Fairy);
|
||
|
|
// if (fairy != null) fairy.Set_Warp(curstagedata.StartPcPos2 + Vector3.back);
|
||
|
|
// InGameTouchInfo.Ins.m_RealCamera.rotateAround = curstagedata.CameraRot2;
|
||
|
|
// var pets = ActorInfo.Ins.Get_Actors(eRole.Pet, 0, true);
|
||
|
|
// for (int i = 0; i < pets.Count; i++)
|
||
|
|
// pets[i].Set_Warp(curstagedata.StartPetPos2[i]);
|
||
|
|
// UIJoystick.Ins.Stop_Joystick();
|
||
|
|
// RestartJoystick = 0.1f;
|
||
|
|
// //go_portal.SetActive(false);
|
||
|
|
// //MobInfo.Ins.Load_Mob();
|
||
|
|
// }
|
||
|
|
//}
|
||
|
|
|
||
|
|
//if (go_portal2 != null && go_portal2.activeInHierarchy)
|
||
|
|
//{
|
||
|
|
// var pc_pos = MyValue.MyPC.Get_position();
|
||
|
|
// var portal_pos = go_portal2.transform.position;
|
||
|
|
|
||
|
|
// if (Vector3.Distance(new Vector3(pc_pos.x, 0f, pc_pos.z), new Vector3(portal_pos.x, 0f, portal_pos.z)) <= 2f)
|
||
|
|
// {
|
||
|
|
// var curstagedata = InGameInfo.Ins.Get_CurStageData();
|
||
|
|
// MyValue.MyPC.Set_AutoBraking(true);
|
||
|
|
// //MyValue.MyPC.Set_Warp(curstagedata.StartPcPos);
|
||
|
|
// var fairy = ActorInfo.Ins.Get_Actor(eRole.Fairy);
|
||
|
|
// //if (fairy != null) fairy.Set_Warp(curstagedata.StartPcPos + Vector3.back);
|
||
|
|
// //InGameTouchInfo.Ins.m_RealCamera.rotateAround = curstagedata.CameraRot;
|
||
|
|
// var pets = ActorInfo.Ins.Get_Actors(eRole.Pet, 0, true);
|
||
|
|
// for (int i = 0; i < pets.Count; i++)
|
||
|
|
// pets[i].Set_Warp(curstagedata.StartPetPos[i]);
|
||
|
|
// UIJoystick.Ins.Stop_Joystick();
|
||
|
|
// RestartJoystick = 0.1f;
|
||
|
|
// //go_portal.SetActive(false);
|
||
|
|
// //MobInfo.Ins.Load_Mob();
|
||
|
|
// }
|
||
|
|
//}
|
||
|
|
|
||
|
|
//if (go_portal3 != null && go_portal3.activeInHierarchy)
|
||
|
|
//{
|
||
|
|
// var pc_pos = MyValue.MyPC.Get_position();
|
||
|
|
// var portal_pos = go_portal3.transform.position;
|
||
|
|
|
||
|
|
// if (Vector3.Distance(new Vector3(pc_pos.x, 0f, pc_pos.z), new Vector3(portal_pos.x, 0f, portal_pos.z)) <= 2f)
|
||
|
|
// {
|
||
|
|
// var curstagedata = InGameInfo.Ins.Get_CurStageData();
|
||
|
|
// MyValue.MyPC.Set_AutoBraking(true);
|
||
|
|
// MyValue.MyPC.Set_Warp(curstagedata.StartPcPos2);
|
||
|
|
// var fairy = ActorInfo.Ins.Get_Actor(eRole.Fairy);
|
||
|
|
// if (fairy != null) fairy.Set_Warp(curstagedata.StartPcPos2 + Vector3.back);
|
||
|
|
// InGameTouchInfo.Ins.m_RealCamera.rotateAround = curstagedata.CameraRot2;
|
||
|
|
// var pets = ActorInfo.Ins.Get_Actors(eRole.Pet, 0, true);
|
||
|
|
// for (int i = 0; i < pets.Count; i++)
|
||
|
|
// pets[i].Set_Warp(curstagedata.StartPetPos2[i]);
|
||
|
|
// UIJoystick.Ins.Stop_Joystick();
|
||
|
|
// RestartJoystick = 0.1f;
|
||
|
|
// //go_portal.SetActive(false);
|
||
|
|
// //MobInfo.Ins.Load_Mob();
|
||
|
|
// }
|
||
|
|
//}
|
||
|
|
}
|
||
|
|
}
|