public override void OnPickupUseDown()
    {
        if (bulletNum <= 0)
        {
            return;
        }
        bullet.Shot();
        ShotSE();

        bulletNum--;
        if (bulletNum <= 0)
        {
            delayTimer.StartTimer(0, this, "Reload", 1);
        }
    }
Пример #2
0
        public override void OnGetInCard(ISFSObject data)
        {
            IsGetInBuZhangFinish = true;
            CurrSeat             = data.GetInt(RequestKey.KeySeat);
            GetInMahJong(data);
            OnOperate(data);
            LeaveMahjongCnt--;

            //抓牌用户 听牌的 并且 当前无菜单提示 自动打牌
            if (CurrSeat == PlayerSeat && IsTing[CurrSeat] && _switchGameOpreateMenu.IsForbiddenAll())
            {
                OutCardDelayTimeIndex = DelayTimer.StartTimer(
                    GameConfig.GetInCardRoteTime + GameConfig.GetInCardWaitTime + GameConfig.TingPaiWaitTime,
                    () => EventDispatch.Dispatch((int)NetEventId.OnOutMahjong, new EventData(GetInMahjong)));
            }

            //自动打牌,抓啥打啥,仅测试用
            if (CurrSeat == PlayerSeat && ziDongDaPai)
            {
                OutCardDelayTimeIndex = DelayTimer.StartTimer(
                    GameConfig.GetInCardRoteTime + GameConfig.GetInCardWaitTime + GameConfig.TingPaiWaitTime,
                    () => EventDispatch.Dispatch((int)NetEventId.OnOutMahjong, new EventData(GetInMahjong)));
            }
            //---------------------------*/


            BuZhangGetInSeat = UtilDef.NullSeat;
        }
Пример #3
0
        public void OnClickChangeActiveMap()
        {
            isActiveMap = !isActiveMap;
            EnableButton.ChangeState();
            if (isActiveMap)
            {
                if (!useUserMapImage)
                {
                    SnapshotCamera.gameObject.SetActive(true);
                    Timer.StartTimer(0, this, nameof(DisableSnapshotCamera), 0.1f);
                }

                MinimapObject.SetActive(true);
                AutoButton.gameObject.SetActive(true);
                ManualButton.gameObject.SetActive(true);
                PlayerTrackerRoot.gameObject.SetActive(true);
                LandmarkTrackerRoot.gameObject.SetActive(true);
            }
            else
            {
                MinimapObject.SetActive(false);
                AutoButton.gameObject.SetActive(false);
                ManualButton.gameObject.SetActive(false);
                PlayerTrackerRoot.gameObject.SetActive(false);
                LandmarkTrackerRoot.gameObject.SetActive(false);
            }
        }
Пример #4
0
        public List <MahjongItem> GetInMahjongWithRoat(int[] value)
        {
            List <MahjongItem> list = MahjongManager.Instance.GetMahjongList(value);
            var pos = Vector3.zero;

            if (MahjongList.Count > 0)
            {
                pos = MahjongList[MahjongList.Count - 1].transform.localPosition;
            }
            AddMahjong(list);
            foreach (MahjongItem item in list)
            {
                pos += new Vector3(MahjongManager.MagjongSize.x, 0, 0);
                item.transform.localPosition = pos;

                item.RotaTo(new Vector3(-90, 0, 0), Vector3.zero, GameConfig.GetInCardRoteTime, GameConfig.GetInCardWaitTime, ()
                            =>
                {
                    YxDebug.Log("补张的转动动画 完成");
                });
            }

            DelayTimer.StartTimer(GameConfig.GetInCardRoteTime + GameConfig.GetInCardWaitTime, () =>
            {
                SortMahjongForHand();

                SetMahjongPos();

                YxDebug.Log("补张动画接受后排序");
            });

            return(list);
        }
Пример #5
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.GetComponent <WeaponAttack>())
     {
         if (thisCollider.enabled == true)
         {
             thisCollider.enabled      = false;
             thisMeshRenderer.material = hitMaterial;
             thisTimer.StartTimer(0, this, "FinishInvisibleTime", 0.25f);
         }
     }
 }
Пример #6
0
        public override void OnSendOverSortMahjong(float time, float wait, int laizi)
        {
            foreach (MahjongItem item in MahjongList)
            {
                item.RotaTo(new Vector3(-90, 0, 0), time);
            }

            DelayTimer.StartTimer(wait, () =>
            {
                SetLaizi(laizi);

                foreach (MahjongItem item in MahjongList)
                {
                    item.RotaTo(new Vector3(0, 0, 0), time);
                }
            });
        }
Пример #7
0
        public virtual void OnSendOverSortMahjong(float time, float wait, int laizi)
        {
            foreach (MahjongItem item in MahjongList)
            {
                item.RotaTo(new Vector3(-90, 0, 0), time);
            }

            DelayTimer.StartTimer(wait, () =>
            {
                SortMahjongForHand();
                SetMahjongPos();

                foreach (MahjongItem item in MahjongList)
                {
                    item.RotaTo(new Vector3(0, 0, 0), time);
                }
            });
        }
Пример #8
0
    public void SetNameLateSync(VRCPlayerApi player, int playerID, string name)
    {
        if (CheckOutOfRange(playerID))
        {
            return;
        }

        if (!Networking.IsOwner(player, nameData[playerID].gameObject))
        {
            Networking.SetOwner(player, nameData[playerID].gameObject);
            tPlayer = player;
            tID     = playerID;
            tName   = name;
            delayTimer.StartTimer(0, this, "SetNameLateSync", 0.5f);
        }
        else
        {
            nameData[playerID].SetValue(name);
            tPlayer = null;
            tID     = -1;
            tName   = "";
        }
    }
Пример #9
0
        public void SetContent(GameObject obj)
        {
            gameObject.SetActive(true);
            if (_content != null)
            {
                Destroy(_content);
                DelayTimer.StopTimer(_timerIndex);
            }
            _content = obj;

            RectTransform rTf = obj.GetComponent <RectTransform>();

            rTf.parent = Content.transform;
            ResetSize(rTf.rect);

            rTf.localPosition = Vector3.zero;//new Vector3(-rTf.rect.size.x / 2 - Interval / 2, rTf.rect.size.y / 2 + Interval/2);
            rTf.localScale    = Vector3.one;

            _timerIndex = DelayTimer.StartTimer(GameConfig.ChatShowTime, () =>
            {
                Reset();
            });
        }
Пример #10
0
 public void BreakTarget()
 {
     breakEffect.Play();
     DisableTarget();
     delayTimer.StartTimer(0, this, "RespownTarget", respownIntervalTime);
 }
Пример #11
0
 public override void OnPlayerLeft(VRCPlayerApi player)
 {
     timer.StartTimer(0, this, nameof(UpdatePlayerList), 1f);
 }