Ejemplo n.º 1
0
        public void Update(float delta)
        {
            // -------------------------------------
            if (Input.GetMouseButtonDown(0) && SceneRuntime.HandleClickEvent == false && m_bAutoLocked)
            {
                ushort fishid = SceneRuntime.FishMgr.GetFishIDByScreenPoint(Input.mousePosition);
                //m_bAutoLocked = fishid != 0;
                m_LockedFishID = fishid;
            }
            // -------------------------------------
            if (m_LockedFishID != 0)
            {
                Vector3 startScrPoint  = SceneRuntime.GetLauncherScrStartPos(MyClientSeat);
                Vector3 startViewPoint = SceneRuntime.GetLauncherViewStartPos(MyClientSeat);
                Fish    fish           = SceneRuntime.FishMgr.FindFishByID(m_LockedFishID);

                if (fish == null || fish.IsDelay || fish.Catched || Utility.IsInScreen(fish.ScreenPos) == false ||
                    BuYuUtils.CheckLauncherAngle(fish, startScrPoint, startViewPoint) == false)
                {
                    m_LockedFishID = 0;
                }
            }
            else if (m_bAutoLocked)
            {
                //if(Utility.GetTickCount() - m_LockInterval > 0)
                {
                    Vector3 startScrPoint  = SceneRuntime.GetLauncherScrStartPos(MyClientSeat);
                    Vector3 startViewPoint = SceneRuntime.GetLauncherViewStartPos(MyClientSeat);
                    m_LockInterval = Utility.GetTickCount();
                    m_LockedFishID = SceneRuntime.FishMgr.GetFishBySortGold(startScrPoint, startViewPoint);
                }
            }

            //SceneRuntime.LogicUI.UpdateLockedUI();

            for (int i = 0; i < ConstValue.PLAYER_MAX_NUM; ++i)
            {
                if (m_PlayerList[i] == null)
                {
                    continue;
                }
                ScenePlayer sp = m_PlayerList[i];
                sp.Launcher.Update(delta);
                if (sp.ComboEft != null && sp.ComboEft.m_BaseWndObject != null)
                {
                    if (sp.ComboEft.m_BaseWndObject.activeSelf != true)
                    {
                        continue;
                    }
                    if (sp.ComboEft.Updata(delta) == false)
                    {
                        sp.ComboEft.m_BaseWndObject.SetActive(false);
                    }
                }
            }
        }