You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.7 KiB
50 lines
1.7 KiB
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using DG.Tweening;
|
|
using Cinemachine;
|
|
public class Step1_2 : MonoBehaviour
|
|
{
|
|
public Text tip;
|
|
public GameObject safeBt;
|
|
public Button finishBt;
|
|
public GameObject selectBt;
|
|
public float speed = 1;
|
|
public GameObject huadongTip;
|
|
private void OnEnable()
|
|
{
|
|
Level1Manager.Instance.allOperates[0].Finished();
|
|
Level1Manager.Instance.AddOperate(Level1Const.operate2Info);
|
|
Level1Manager.Instance.mouseMove = true;
|
|
tip.DOText("请用鼠标拖动视角查看周围环境并在上方做出正确选择", 3);
|
|
safeBt.GetComponent<RectTransform>().DOLocalMove(Vector3.zero, 2);
|
|
}
|
|
public void SafeFinish() {
|
|
safeBt.SetActive(false);
|
|
selectBt.GetComponent<RectTransform>().DOLocalMove(Vector3.zero,2);
|
|
tip.text = "";
|
|
tip.DOText("周围环境存在风险,请选择解决方式",2);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (Input.GetMouseButton(0) && Level1Manager.Instance.mouseMove) {
|
|
if (Input.GetAxis("Mouse X")!=0) {
|
|
huadongTip.SetActive(false);
|
|
}
|
|
FindObjectOfType<CinemachineFreeLook>().m_XAxis.Value += Input.GetAxis("Mouse X") * speed;
|
|
}
|
|
}
|
|
|
|
public void Remove() {
|
|
tip.text = "";
|
|
tip.DOText("请用鼠标进行点击,保持周边环境空旷(提示周边物品和靠的太近的人)", 2);
|
|
selectBt.SetActive(false);
|
|
finishBt.gameObject.SetActive(true);
|
|
FindObjectOfType<CinemachineFreeLook>().m_Orbits[1].m_Radius = 3 ;
|
|
FindObjectOfType<CinemachineFreeLook>().Follow = GameObject.FindWithTag("TargetPos").transform;
|
|
FindObjectOfType<CinemachineFreeLook>().LookAt = GameObject.FindWithTag("TargetPos").transform;
|
|
}
|
|
}
|