public void BeginSitLock(bool bLock) { if (m_nSrvSit >= CGame_Fishing.PlayerNum) { return; } m_eLockState = bLock ? LockFishState.LFS_Begin : LockFishState.LFS_End; }
void UpdateLockState() { if (m_eLockState == LockFishState.LFS_Begin) { if (IsLocal()) { if (LockFish == null) { ChangeLockFish(GameBase.FishMgr.LockNextFish(m_nIndex)); } } if (LockFish != null) { m_eLockState = LockFishState.LFS_Locking; LockUI.gameObject.SetActive(true); } } if (m_eLockState == LockFishState.LFS_End) { OnLockFishLost(); LockUI.gameObject.SetActive(false); m_eLockState = LockFishState.LFS_None; } if (m_eLockState == LockFishState.LFS_Locking) { if (IsLocal()) { if (LockFish == null || !LockFish.IsLockBySit(m_nIndex, -100f)) { //DebugLog.Log("locking->begin curfish:" + (LockFish == null ? 0 : LockFish.m_nOnlyId)); LockUI.gameObject.SetActive(false); m_eLockState = LockFishState.LFS_Begin; OnLockFishLost(); } } if (LockFish != null) { Canvas cv = GameBase.GameCanvas; LockUI.localPosition = GameFunction.WorldToLocalPointInRectangle(LockFish.GetLockPoint().position, Camera.main, cv, cv.worldCamera); } } }
public void LeaveSit() { if (m_nSrvSit >= CGame_Fishing.PlayerNum) { return; } OnLockFishLost(); LockUI.gameObject.SetActive(false); m_eLockState = LockFishState.LFS_None; Transform tfm = m_InfoUI.Find("Middle/Anime"); foreach (Transform child in tfm) { GameMain.Destroy(child.gameObject); } GameObject.Destroy(m_Cannon.gameObject); ShowPlayerInfo(false); m_nSrvSit = RoomInfo.NoSit; m_nTotalCoin = 0; }