示例#1
0
    void FixedUpdate()
    {
        if (_inventory._slots.Count == 0)
        {
            return;
        }
        _item = _inventory._availableItems [_inventory._slots [_inventory._currentSlot]];
        if (isLocalPlayer)
        {
            if (_fire1 && _item.Fire1())
            {
                BulletScript bulletScript = _item.PrepareBullet();

                if (hasAuthority)
                {
                    UpdateHistory(_shotID, bulletScript);
                    Rpc_Shoot();
                }
                else
                {
                    Cmd_Fire1(_shotID);
                }
                _item.Shoot(true, _shotID, bulletScript);
                _shotID++;
                if (_shotID == 255)
                {
                    _shotID = 0;
                }
            }
        }
    }
示例#2
0
 void Cmd_Fire1(byte shotID)
 {
     if (_item.Fire1())
     {
         BulletScript bulletScript = _item.PrepareBullet();
         _item.Shoot(false, _shotID, bulletScript);
         UpdateHistory(shotID, bulletScript);
         Rpc_Shoot();
     }
 }
	void FixedUpdate () {
		if ( _inventory._slots.Count == 0) {
			return;
		}
		_item = _inventory._availableItems [_inventory._slots [_inventory._currentSlot]];
		if (isLocalPlayer) {
			if(_fire1 && _item.Fire1()){
				BulletScript bulletScript = _item.PrepareBullet();

				if(hasAuthority){
					UpdateHistory(_shotID,bulletScript);
					Rpc_Shoot();
				}else{
					Cmd_Fire1(_shotID);
				}
				_item.Shoot(true,_shotID,bulletScript);
				_shotID++;
				if(_shotID==255){
					_shotID = 0;
				}
			}
		} 
	}