void Update() { // 인터렉팅 중이 아니라면 // 가장 가까운 오브젝트 아웃라인 활성화 if (!nowInteract) { //Set nearest NPC Outline if (nearNpcList.Count >= 1) { int minIndex = FindNearestColIndex(nearNpcList); EnableOutLinesOnly(nearNpcList, minIndex); } //Set nearest Object Outline if (nearObjList.Count >= 1) { int minIndex = FindNearestColIndex(nearObjList); EnableOutLinesOnly(nearObjList, minIndex); } } //Interact Part if (Input.GetKeyDown(KeyCode.E)) { if (nearNpcList.Count >= 1) { int minIndex = FindNearestColIndex(nearNpcList); if (!nowInteract) { nearNpcList[minIndex].GetComponent <NPC>().Interact(); nowInteract = true; } } // if (nearObjList.Count >= 1) { if (nowInteract) { interactingObj.StopInteract(); } else { int minIndex = FindNearestColIndex(nearObjList); if (nearObjList[minIndex].GetComponent <InteractInterface>() != null) { interactingObj = nearObjList[minIndex].GetComponent <InteractInterface>(); nearObjList[minIndex].GetComponent <InteractInterface>().Interact(); } } } } }
private static void SendMessageToMobile(LitJson.JsonData data) { Utility.LogPrint(data.ToString()); switch (Application.platform) { case RuntimePlatform.Android: AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject> ("currentActivity"); if (data.ToJson() != "") { jo.Call("UnityCallBack", data.ToJson()); } break; case RuntimePlatform.IPhonePlayer: #if UNITY_IPHONE InteractInterface.UnityCallBack(data.ToJson()); #endif break; default: break; } }
public void removeAction() { action = null; canInteract = false; }
public void addAction(InteractInterface intInter) { action = intInter; canInteract = true; }
private void OnTriggerExit(Collider other) { currentInteract = null; }
public void StartCapBtnClicked() { string json = "{'Method': 'StartScreenCap','DataSetName': 'Tarmac','TestNull':''}"; InteractInterface.InteractionInterfaceMethod(json); }
public void LoadBtnClicked() { string json = "{'Method': 'LoadDataSet','DataSetName': 'Tarmac','TestNull':''}"; InteractInterface.InteractionInterfaceMethod(json); }
public void EnableCamera() { string json = "{'Method': 'DisableCamera','DataSetName': 'Tarmac','TestNull':''}"; InteractInterface.InteractionInterfaceMethod(json); }
public void SwitchCameraBtnClicked() { string json = "{'Method': 'SwitchCamera','DataSetName': 'Tarmac','TestNull':''}"; InteractInterface.InteractionInterfaceMethod(json); }