diff --git a/Assets/Scripts/Level2/Canvas2.cs b/Assets/Scripts/Level2/Canvas2.cs deleted file mode 100644 index 99b2670..0000000 --- a/Assets/Scripts/Level2/Canvas2.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using Cinemachine; -using UnityEngine.SceneManagement; -using UnityEngine.UI; -using DG.Tweening; - -public class Canvas2 : MonoBehaviour -{ - public AudioClip[] ac; - AudioSource audioSource; - public GameObject tip2; - public GameObject step2_1; - public GameObject step2_2; - public Animator animator; - public GameObject errorTip; - public GameObject step2_3; - private void Start() - { - audioSource = GetComponent(); - EventManager.Instance.register("NextAc", NextAc); - EventManager.Instance.register("ActionTwoEnd", ActionTwoEnd); - EventManager.Instance.register("guancha",Guancha); - tip2.SetActive(true); - Invoke("InitLevel2", 3); - } - - - - void InitLevel2() - { - tip2.GetComponentInChildren().str = "请选择正确的部位进行拍打询问"; - tip2.SetActive(false); - step2_1.SetActive(true); - tip2.SetActive(true); - } - - void Guancha(params object[] data) { - audioSource.clip = ac[1]; - audioSource.Play(); - } - public void ActionOne(bool inspect) { - if (inspect) - { - step2_1.SetActive(false); - audioSource.clip = ac[0]; - audioSource.Play(); - animator.SetTrigger("Huhuan"); - } - - - else { - errorTip.SetActive(true); - errorTip.GetComponentInChildren().InitThis("当前拍打部位错误,请重试"); - } - } - void NextAc(params object[] data) { - GameObject obj = Instantiate(Resources.Load("operate"), GameObject.FindWithTag("Grid").transform); - obj.GetComponent().str = "1-判断被救者有无意识"; - tip2.GetComponentInChildren().str = "请选择正确的部位进行观察被救者的呼吸"; - tip2.SetActive(false); - tip2.SetActive(true); - step2_2.SetActive(true); - - } - - void ActionTwoEnd(params object[] data) { - step2_3.SetActive(true); - } - - public void ActionTwo(bool inspect) - { - if (inspect) - { - step2_2.SetActive(false); - animator.SetTrigger("Tuoyi"); - } - else - { - errorTip.SetActive(true); - errorTip.GetComponentInChildren().InitThis("当前观察部位错误,请重试"); - } - } - - -} diff --git a/Assets/Scripts/Level2/Canvas2.cs.meta b/Assets/Scripts/Level2/Canvas2.cs.meta deleted file mode 100644 index f5a62ef..0000000 --- a/Assets/Scripts/Level2/Canvas2.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e546a613bbac3ad44acb0fff81fb0b44 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Level2/DrawLine.cs b/Assets/Scripts/Level2/DrawLine.cs deleted file mode 100644 index a39c2b5..0000000 --- a/Assets/Scripts/Level2/DrawLine.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; -using UnityEngine.EventSystems; -public class DrawLine : MonoBehaviour,IPointerClickHandler -{ - RectTransform rt; - void Start() - { - rt = GetComponent(); - Vector2 point1 = rt.anchoredPosition + new Vector2(-rt.sizeDelta.x / 2, rt.sizeDelta.y / 2); - Vector2 point2 = rt.anchoredPosition + new Vector2(rt.sizeDelta.x / 2, rt.sizeDelta.y / 2); - Vector2 point3 = rt.anchoredPosition + new Vector2(-rt.sizeDelta.x / 2, -rt.sizeDelta.y / 2); - Vector2 point4 = rt.anchoredPosition + new Vector2(rt.sizeDelta.x / 2, -rt.sizeDelta.y / 2); - DrawStraightLine(point1, point2); - DrawStraightLine(point2, point4); - DrawStraightLine(point3, point4); - DrawStraightLine(point3, point1); - } - void DrawStraightLine(Vector2 a, Vector2 b) - { - GameObject img = new GameObject(); - img.AddComponent(); - img.transform.SetParent(transform); - img.GetComponent().raycastTarget = false; - float distance = Vector2.Distance(a, b); - float angle = Vector2.SignedAngle(a - b, Vector2.left); - img.GetComponent().anchoredPosition = (a + b) / 2; - img.GetComponent().sizeDelta = new Vector2(distance, 5); - img.transform.localRotation = Quaternion.AngleAxis(-angle, Vector3.forward); - img.GetComponent().color = Color.red; - } - - public void OnPointerClick(PointerEventData eventData) - { - - } -} diff --git a/Assets/Scripts/Level2/DrawLine.cs.meta b/Assets/Scripts/Level2/DrawLine.cs.meta deleted file mode 100644 index 84f6621..0000000 --- a/Assets/Scripts/Level2/DrawLine.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7f500fe94495be2459997134376a881e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Level2/Question2.cs b/Assets/Scripts/Level2/Question2.cs deleted file mode 100644 index 06811c6..0000000 --- a/Assets/Scripts/Level2/Question2.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; -public class Question2 : MonoBehaviour -{ - public int index;//玩家选择的答案记录 - int rand;//随机的结果 - public string[] questionInfo; - Toggle tg; - void Start() - { - - tg = GetComponent(); - Debug.Log("对题目进行初始化"); - rand = Step2_3.rand; - transform.GetChild(1).GetComponent().text = questionInfo[rand]; - tg.onValueChanged.AddListener((bool value) => - { - if (value) - { - EventManager.Instance.emit("Question2", index); - } - }); - } - - -} diff --git a/Assets/Scripts/Level2/Question2.cs.meta b/Assets/Scripts/Level2/Question2.cs.meta deleted file mode 100644 index 61e6ecc..0000000 --- a/Assets/Scripts/Level2/Question2.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fd91c0d5a804bf64498ad6c20b35d0fd -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Level2/Tip.cs b/Assets/Scripts/Level2/Tip.cs deleted file mode 100644 index 50157b9..0000000 --- a/Assets/Scripts/Level2/Tip.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using DG.Tweening; -using UnityEngine.UI; -public class Tip : MonoBehaviour -{ - public float time; - [TextArea] - public string str; - Text myText; - private void Awake() - { - myText = GetComponent(); - } - private void OnEnable() - { - myText.text = ""; - myText.DOText(str, time); - } -} diff --git a/Assets/Scripts/Level2/Tip.cs.meta b/Assets/Scripts/Level2/Tip.cs.meta deleted file mode 100644 index fd7ffc1..0000000 --- a/Assets/Scripts/Level2/Tip.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4cb08099ae8f90d4890c0319edd1e963 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Pass3/Tool/Const.cs b/Assets/Scripts/Pass3/Tool/Const.cs deleted file mode 100644 index 455f508..0000000 --- a/Assets/Scripts/Pass3/Tool/Const.cs +++ /dev/null @@ -1,9 +0,0 @@ -锘縰sing System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class Const:MonoBehaviour -{ - -} diff --git a/Assets/Scripts/Pass3/Tool/Const.cs.meta b/Assets/Scripts/Pass3/Tool/Const.cs.meta deleted file mode 100644 index b1bfc90..0000000 --- a/Assets/Scripts/Pass3/Tool/Const.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2cb7a923ce234c242a10dd106105826f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Tools/GameManager.cs b/Assets/Tools/GameManager.cs deleted file mode 100644 index 7ca5cd3..0000000 --- a/Assets/Tools/GameManager.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using Cinemachine; -using UnityEngine.UI; -public class GameManager : MonoSingleton -{ - public GameObject GameEndTip; - public GameObject greenPerson; - public GameObject person2; - public GameObject[] needRemoveObjs; - public GameObject[] needTransferObjs; - public GameObject errorTip; - public GameObject clickTip; - bool safe=false; - public bool remove=false; - public int safeOperate;//玩家选择的对应操作,0对应转移,1对应清理 - RaycastHit rh; - protected override void Awake() - { - base.Awake(); - DontDestroyOnLoad(gameObject); - //safe = Random.Range(0,1f) > 0.5 ? true : false; - InitScene(safe); - } - private void Start() - { - - } - - private void Update() - { - if (remove) { - Ray ray=Camera.main.ScreenPointToRay(Input.mousePosition); - if (Physics.Raycast(ray, out rh)) { - if (rh.collider.tag == "ZAW" && Input.GetMouseButtonDown(0)) { - if (rh.collider.GetComponent()) - { - rh.collider.GetComponent().SetTrigger("Sankai"); - } - else { - rh.collider.gameObject.SetActive(false); - clickTip.SetActive(false); - } - rh.collider.tag = "Untagged"; - } - } - } - } - - public void InitScene(bool safe) { - greenPerson.GetComponent().SetPosBySafe(safe); - if (!safe) - { - foreach (GameObject obj in needRemoveObjs) - { - obj.SetActive(true); - } - greenPerson.tag = "ZAW"; - } - } - - public void PanDuanSafe(bool safe) { - EventManager.Instance.emit("PanDuanSafe", this.safe == safe,this.safe); - } - - public void SetSafeOperate(int index) { - safeOperate = index; - if (index == 0) { - EventManager.Instance.emit("SafeOperate",0); - Invoke("TransferObjs", 1); - } else if (index==1) { - greenPerson.tag = "ZAW"; - remove = true; - EventManager.Instance.emit("SafeOperate",1); - } - } - - void TransferObjs() { - person2.SetActive(true); - greenPerson.GetComponent().SetPosBySafe(true); - FindObjectOfType().LookAt = needTransferObjs[0].transform; - FindObjectOfType().Follow = needTransferObjs[0].transform; - FindObjectOfType().m_YAxis.Value = 0.75f; - FindObjectOfType().m_XAxis.Value = 56.27f; - foreach (GameObject obj in needTransferObjs) - { - obj.transform.position += new Vector3(2, 0, -35); - } - GameObject obj2 = Instantiate(Resources.Load("operate")); - obj2.GetComponent().str = "2-将被救者转移到安全位置"; - Invoke("ZhuanyiEnd",2); - - - } - - void ZhuanyiEnd() { - errorTip.SetActive(true); - errorTip.GetComponentInChildren().InitThis("恭喜通关", 60); - GameEndTip.SetActive(true); - GameEndTip.GetComponentInChildren().text="已成功转移到安全位置"; - EduCoderTool.WebConnecter.Singleton.SendResultToWeb(true); - } -} diff --git a/Assets/Tools/GameManager.cs.meta b/Assets/Tools/GameManager.cs.meta deleted file mode 100644 index 03a2ad0..0000000 --- a/Assets/Tools/GameManager.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: fc62637c6246ccc428064df41cb5be1d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Tools/LoadManager.cs b/Assets/Tools/LoadManager.cs deleted file mode 100644 index 2b3814a..0000000 --- a/Assets/Tools/LoadManager.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class LoadManager : MonoSingleton -{ - public T Load(string path) where T:class - { - return Resources.Load(path) as T; - } -} diff --git a/Assets/Tools/LoadManager.cs.meta b/Assets/Tools/LoadManager.cs.meta deleted file mode 100644 index 1102fd1..0000000 --- a/Assets/Tools/LoadManager.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: c94f25fee4a4da34bbe263f631e5cd65 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Tools/Observer.meta b/Assets/Tools/Observer.meta deleted file mode 100644 index a259f19..0000000 --- a/Assets/Tools/Observer.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0f0567f363b89b847b07c63968cf7b33 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Tools/Observer/IObserver.cs b/Assets/Tools/Observer/IObserver.cs deleted file mode 100644 index 92b82d8..0000000 --- a/Assets/Tools/Observer/IObserver.cs +++ /dev/null @@ -1,3 +0,0 @@ -public interface IObserver { - void Notify(); -} \ No newline at end of file diff --git a/Assets/Tools/Observer/IObserver.cs.meta b/Assets/Tools/Observer/IObserver.cs.meta deleted file mode 100644 index 2035938..0000000 --- a/Assets/Tools/Observer/IObserver.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 46ec0ffc8508fa24aa92cddc19d59dcc -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Tools/Observer/MessageCenter.cs b/Assets/Tools/Observer/MessageCenter.cs deleted file mode 100644 index a3bb7bc..0000000 --- a/Assets/Tools/Observer/MessageCenter.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using System; -public class MessageCenter : MonoSingleton -{ - public delegate void Message(); - Dictionary Events=new Dictionary(); - - protected override void Awake() - { - base.Awake(); - DontDestroyOnLoad(gameObject); - Events = new Dictionary(); - } - public void AddListen(string eventName, IObserver observer) { - if (!Events.ContainsKey(eventName)) - { - Message message = new Message(observer.Notify); - Events.Add(eventName, message); - return; - } - Events[eventName]+=observer.Notify; - } - - public void RemoveListen(string eventName, IObserver observer) - { - if (Events.ContainsKey(eventName)) - { - Events[eventName] -= observer.Notify; - } - } - - public void SendEvent(string eventName) { - if (!Events.ContainsKey(eventName)) return; - Events[eventName](); - } - -} \ No newline at end of file diff --git a/Assets/Tools/Observer/MessageCenter.cs.meta b/Assets/Tools/Observer/MessageCenter.cs.meta deleted file mode 100644 index 07c8116..0000000 --- a/Assets/Tools/Observer/MessageCenter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e86b7a137f0e0fe4baf15cad99c6bcff -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: