Esempio n. 1
0
        public override void OnUseModule(WeaponBase weapon)
        {
            base.OnUseModule(weapon);

            if (!_shotAnchor)
            {
                return;
            }

            if (!_bullet)
            {
                Debug.LogWarning("not seted Bullet.");
                return;
            }

            //var b = Instantiate(_bullet, _shotAnchor.position, _shotAnchor.rotation);
            //b.ModuleData = _moduleData;
            manager.CallSyncEvent("ShotModule_Shot" + _myID, new object[] { _shotAnchor.position, _shotAnchor.rotation });
        }
        public override void OnUseModule(WeaponBase weapon)
        {
            base.OnUseModule(weapon);

            if (!_throwAnchor)
            {
                return;
            }

            if (!_bomb)
            {
                Debug.LogWarning("not seted Bullet.");
                return;
            }

            var throwVector = CalcThrowVector() * _throwPower;

            Debug.Log("throwVec :" + throwVector);
            _throwAnchor.forward = throwVector;
            Debug.DrawLine(_throwAnchor.position, _throwAnchor.position + throwVector, Color.red, 1);

            manager.CallSyncEvent("ThrowModule_Throw" + _myID, new object[] { _throwAnchor.position, _throwAnchor.rotation, throwVector });
        }