コード例 #1
0
    public virtual void Launch(IElementAttackable target, AWeapon weapon, Topography topography) {
        PrepareForLaunch(target, weapon);
        D.Assert((Layers)gameObject.layer == Layers.Projectiles, "{0} is not on Layer {1}.".Inject(Name, Layers.Projectiles.GetValueName()));
        _launchPosition = transform.position;

        _rigidbody.drag = OpenSpaceDrag * topography.GetRelativeDensity();
        _rigidbody.mass = Mass;
        AssessShowMuzzleEffects();
        _hasWeaponFired = true;
        weapon.HandleFiringComplete(this);

        _displayMgr = InitializeDisplayMgr();
    }
コード例 #2
0
    public virtual void Launch(IElementAttackable target, AWeapon weapon, Topography topography) {
        if (_displayMgr == null) {
            // 8.9.16 moved from Awake() as PoolMgr spawns ordnance as soon as it wakes. In scene change from Lobby, this occurs 
            // way before OnLevelIsLoaded() is called which is when GameMgr refreshes static References - aka TrackingWidgetFactory
            _displayMgr = InitializeDisplayMgr();
        }
        _displayMgr.IsDisplayEnabled = true;

        PrepareForLaunch(target, weapon);
        D.AssertEqual(Layers.Projectiles, (Layers)gameObject.layer, ((Layers)gameObject.layer).GetValueName());
        _launchPosition = transform.position;

        _rigidbody.drag = OpenSpaceDrag * topography.GetRelativeDensity();
        _rigidbody.mass = Mass;
        AssessShowMuzzleEffects();
        _hasWeaponFired = true;
        weapon.HandleFiringComplete(this);
    }
コード例 #3
0
 public void HandleTopographyChanged(Topography newTopography) {
     //D.Log("{0}.HandleTopographyChanged({1}).", FullName, newTopography.GetValueName());
     _rigidbody.drag = OpenSpaceDrag * newTopography.GetRelativeDensity();
 }
コード例 #4
0
 public void ChangeTopographyTo(Topography newTopography) {
     D.Log(ShowDebugLog, "{0}.ChangeTopographyTo({1}).", DebugName, newTopography.GetValueName());
     _rigidbody.drag = OpenSpaceDrag * newTopography.GetRelativeDensity();
 }