Inheritance: MonoBehaviour
Beispiel #1
0
    IEnumerator FindTarget()
    {
        while (true)
        {
            yield return(new WaitForSeconds(.5f));

            if (target != null)
            {
                LookAtMe lam = gameObject.GetComponentInChildren <LookAtMe>();
                if (lam == null || lam.gameObject != target)
                {
                    target = null;
                }
            }

            if (target == null)
            {
                LookAtMe lam = gameObject.GetComponentInChildren <LookAtMe>();
                if (lam != null)
                {
                    target = lam.gameObject;
                }
            }
        }
    }
Beispiel #2
0
 private void Awake()
 {
     _dic                 = new Dictionary <MinimapEntity, GameObject>();
     _backRect            = minimap.GetComponent <RectTransform>().rect;
     _lam                 = FindObjectOfType <LookAtMe>();
     _cameraRectTransform = cameraRect.GetComponent <RectTransform>();
 }
    // Use this for initialization
    void Start()
    {
        lookAtMe = GameObject.Find("DataTag/AirConditioner").GetComponent <LookAtMe>();

        dataPanel = GameObject.Find("Canvas/DataChart").GetComponent <DataPanel>();

        dataShow = GameObject.Find("Canvas").GetComponent <DataShow>();
    }
Beispiel #4
0
        public void StartWork(bool needBug = false, bool istest = true)
        {
            List <string> deviceIds = new List <string>();
            string        token     = "";
            string        gamgId    = "";

            gamgId = GameID;
            for (int idex = 0; idex <= 2; ++idex)
            {
                string tempId = QyCsharpProgramTools.Tools.GetEnvironmentValue("id" + idex.ToString());

                Debug.Log("尝试取参" + "【id" + idex.ToString() + "】: " + tempId);
                if (tempId != "")
                {
                    deviceIds.Add(tempId);
                }
            }
            token = QyCsharpProgramTools.Tools.GetEnvironmentValue("token");
            Debug.Log("尝试取参" + "【token】: " + token);

            if (istest)
            {
                token = "WkE8fSqkq3Zm1Mfruj61uK0zj0OaScOF0znl";//
                deviceIds.Clear();
                deviceIds.Add("4000");
                deviceIds.Add("6006");
                //token = "91yrf3qkqstxlix3rlvouwvjaxrk28fflgwh";//自己
                //deviceIds.Clear();
                //deviceIds.Add("10000");
            }
            Debug.Log("token:   " + token);
            string ret = "";

            for (int i = 0; i < deviceIds.Count; i++)
            {
                ret += deviceIds[i] + "\n";
            }
            Debug.Log(ret);

            LookAtMe.needDebug = needBug;
            LookAtMe.token     = token;
            LookAtMe.gameId    = gamgId;
            print("初始化成功");
            LookAtMe.JLAM_Event_Fir += GameDataHandle.NetEventFir;
            //二维码生成
            _gameDataHandle.TryLoginIn += TryLoginInPlayer;
            _gameDataHandle.RoomVerifyCompleteEvent += OnRoomVerify;
            GameDataHandle.GameReady += GameDataHandle_GameReady;



            _gameDataHandle.LoginOut += LogginOutPlayer;
            GameDataHandle.LoginIn   += GameDataHandle_LoginIn;
            LookAtMe.StartLAM(m_netOption, 12 * 1000, deviceIds.ToArray());
        }
Beispiel #5
0
        /// <summary>
        /// 尝试登录回复
        /// </summary>
        /// <param name="receiver"></param>
        /// <param name="msg"></param>
        public void ResponseTryLoginMsg(string receiver, MsgTryLoginRes msg)
        {
            Debug.Log("用户尝试登陆信息回复:--- in --- ");
            List <string> receivers = new List <string>();

            receivers.Add(receiver);

            Debug.Log(Qy_CSharp_NetWork.Tools.Json.JsonTools.ToJson(msg));
            LookAtMe.PushMsgToOther(msg, receivers.ToArray(), false, true);
            Debug.Log("用户尝试登陆信息回复:--- out --- ");
        }
Beispiel #6
0
    //BodyRot bodyRotScript;

    void Start()
    {
        // название объекта FPS
        player   = GameObject.Find("FPSController").transform;
        animator = GetComponent <Animator> ();
        // путь к объекту со скриптом LookAtMe в иерархии объекта-персонажа
        lookingScript = transform.Find("mixamorig:Hips/mixamorig:Spine/mixamorig:Spine1/mixamorig:Spine2/mixamorig:Neck").GetComponent <LookAtMe> ();
        //bodyRotScript = GetComponent<BodyRot>();


        // при рождении объекта запускаем проверку дистанции раз в checkInterval секундorig:Spine2/mixamorig:Neck").GetComponent<LookAtMe> ();

        StartCoroutine(SlowDistanceCheck());
    }
    // Update is called once per frame
    void Update()
    {
        float dist = (transform.position - glowToMatch.transform.position).magnitude;

        if (dist < 50)
        {
            for (int i = 0; i < ListToEnable.Length; i++)
            {
                ListToEnable[i].SetActive(true);
            }
            SoundPlayer.PlayClipByName(SoundNames.tree_branches, Random.Range(0.9f, 1.0f));
            LookAtMe myLookScript = gameObject.GetComponent <LookAtMe>();
            myLookScript.WatchMeNow();
            //Debug.Log("Triggered by distance");
            this.enabled = false;
        }
    }
Beispiel #8
0
    // Update is called once per frame
    void Update()
    {
        if (didHappen)
        {
            return;
        }
        float dist = (OrangeTree.transform.position - Orange.transform.position).magnitude;

        if (dist < 10)
        {
            didHappen = true;
            SoundPlayer.PlayClipByName(SoundNames.tree_branches, Random.Range(0.9f, 1.0f));
            animator.SetTrigger("Touched");
            LookAtMe myLookScript = gameObject.GetComponent <LookAtMe>();
            myLookScript.WatchMeNow();
            Debug.Log("Triggered by distance");
        }
    }
Beispiel #9
0
 private void OnDestroy()
 {
     LookAtMe.Dispose();
     Debug.Log("游戏退出");
 }
Beispiel #10
0
 /// <summary>
 /// 向服务器发送准备的信息,不发会项目一直在准备中
 /// </summary>
 public void GameStarusIsReady()
 {
     Debug.LogError(" --------------_GameStarusIsReady -------------- ");
     LookAtMe.PushGameStatus("1", true, true);
     SceneController.Instance.ChangeScene("Scene02", ChangeSceneHandler, Utils.WAIT_TIME);
 }
Beispiel #11
0
 private void GameDataHandle_GameReady()
 {
     Debug.LogError("游戏准备好了");
     creatCode.GameQrCodePosOnGame();//二维码游戏中位置
     LookAtMe.PushGameStatus("2", true, true);
 }