예제 #1
0
    public void HttpAisResultDelegate(bool isError, Dictionary <string, ShipData> datas, string errorMsg)
    {
        if (isError)
        {
            _errorText.text = errorMsg;
            _alertAnimator.SetTrigger("SetAlertAction");
            return;
        }
        _errorText.text = "";

        lock (_lockObj)
        {
            //삭제
            List <string> newRemoveKeys = new List <string>();
            foreach (string userID_a in _shipObjs.Keys)
            {
                foreach (string userID_b in datas.Keys)
                {
                    if (userID_a.Equals(userID_b))
                    {   //있으면 일루 들어와짐. 삭제 예정해주고, 통신시간 틀리면 데이터 정보만 바꿔주는걸로.
                        newRemoveKeys.Add(userID_a);

                        ShipObjectScript shipSC = _shipObjs[userID_a].GetComponent <ShipObjectScript>();
                        if (!shipSC.GetShipData().regDate.Equals(datas[userID_b].regDate))
                        {
                            shipSC.SetChangeMoveCoroutineAction(datas[userID_b]);  //이동 정보 수정해주고.
                        }
                        break;
                    }
                }
            }
            foreach (string str in newRemoveKeys)
            {
                datas.Remove(str);
            }

            //추가
            foreach (string userID in datas.Keys)
            {
                AddShipObject(userID, datas[userID]);
            }
        }

        if (_loadingView.activeSelf)
        {
            _loadingView.SetActive(false);
            _data5GView.SetActive(true);
        }
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        // _errorText.text = "x- " + Camera.main.transform.position.x + ",\n" + "y- " + Camera.main.transform.position.y + ",\n" + "z- " + Camera.main.transform.position.z;

        if (Input.touchCount == 1 && _userState == SystemState.kNone)
        {
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            if (Input.GetTouch(0).phase == TouchPhase.Began)
            {
                if (Physics.Raycast(ray, out hit))
                {
                    ShipObjectScript sc = hit.transform.gameObject.GetComponent <ShipObjectScript>();
                    OpenShipInfoViewAction(sc._userKey, sc.GetShipData(), sc._distance);
                    //sc._shipSc._userKey
                    //sc._shipSc._shipData
                }
            }
        }
    }