BulletMLLib.BulletMLBullet.GetAimDir C# (CSharp) Метод

GetAimDir() публичный Метод

public GetAimDir ( ) : float
Результат float
        public float GetAimDir()
        {
            float val = (float)Math.Atan2((BulletMLManager.GetPlayerPositionX() - X), -(BulletMLManager.GetPlayerPositionY() - Y));
            ////Debug.WriteLine("SetAimDir : {0}" , val / Math.PI * 180);
            return val;
        }

Usage Example

Пример #1
0
        public override BLRunStatus Run(BulletMLBullet bullet)
        {
            BLType blType = node.Type;
            float  value  = (float)(node.GetValue(this) * Math.PI / 180);

            if (blType == BLType.Sequence)
            {
                bullet.Direction = bullet.GetFireData().SourceDirection + value;
            }
            else if (blType == BLType.Absolute)
            {
                bullet.Direction = value;
            }
            else if (blType == BLType.Relative)
            {
                bullet.Direction = bullet.Direction + value;
            }
            else //if (blType == BLType.Aim || blType == BLType.None)
            {
                bullet.Direction = bullet.GetAimDir() + value;
            }

            //Debug.WriteLine(String.Format("SetDirecton:{0},  (type:{1} val:{2})", bullet.Direction / Math.PI * 180, node.type, value / Math.PI * 180));
            End = true;

            return(BLRunStatus.End);
        }
All Usage Examples Of BulletMLLib.BulletMLBullet::GetAimDir