With ZOffsetFromCenter as first feature so render traits don't have to use it from WithTurret(Overlay)
24 lines
596 B
C#
24 lines
596 B
C#
#region Copyright & License Information
|
|
/*
|
|
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
|
* This file is part of OpenRA, which is free software. It is made
|
|
* available to you under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation. For more information,
|
|
* see COPYING.
|
|
*/
|
|
#endregion
|
|
|
|
using OpenRA.Traits;
|
|
|
|
namespace OpenRA.Mods.Common.Traits
|
|
{
|
|
public class RenderUtils
|
|
{
|
|
public static int ZOffsetFromCenter(Actor self, WPos pos, int offset)
|
|
{
|
|
var delta = self.CenterPosition - pos;
|
|
return delta.Y + delta.Z + offset;
|
|
}
|
|
}
|
|
}
|