示例#1
0
 protected override void OnProjectileLaunch(AbstractProjectileLauncher.ProjectileLaunchEvent eventInfo)
 {
     if (null != m_Body)
     {
         //-- Apply launch velocity
         m_Body.velocity = eventInfo.launchDirection * eventInfo.launchForce;
     }
 }
 protected override void OnProjectileLaunch(AbstractProjectileLauncher.ProjectileLaunchEvent eventInfo)
 {
     if (null != m_Body)
     {
         //-- Apply initial velocity according to launch parameters
         m_Body.velocity = eventInfo.launchDirection * eventInfo.launchForce;
     }
 }
示例#3
0
    protected override void OnProjectileLaunch(AbstractProjectileLauncher.ProjectileLaunchEvent eventInfo)
    {
        if (null != m_Body)
        {
            //-- Push the projectile from its current position in the launch direction
            m_Body.AddForce(eventInfo.launchDirection * eventInfo.launchForce
                            , ForceMode2D.Impulse);

            //-- Incorporate the launcher's gravity scale
            m_Body.gravityScale *= eventInfo.gravityScale;
        }
    }
示例#4
0
 /** Message-based callback informing the projectile of its launch context. */
 protected abstract void OnProjectileLaunch(AbstractProjectileLauncher.ProjectileLaunchEvent eventInfo);