コード例 #1
0
 internal static GameObject FromMapObject(
     MapObject mapObject,
     AssetStore assetStore,
     GameObjectCollection gameObjects,
     HeightMap heightMap,
     bool useRotationAnchorOffset = true,
     in float?overwriteAngle      = 0.0f,
コード例 #2
0
ファイル: GameObject.cs プロジェクト: ybwsfl/OpenSAGE
        public GameObject(ObjectDefinition objectDefinition, ContentManager contentManager, Player owner, GameObjectCollection parent)
        {
            Definition = objectDefinition;
            Context    = contentManager.IniDataContext;
            Owner      = owner;
            Parent     = parent;

            SetLocomotor();
            Transform = Transform.CreateIdentity();

            var drawModules = new List <DrawModule>();

            foreach (var drawData in objectDefinition.Draws)
            {
                var drawModule = AddDisposable(drawData.CreateDrawModule(contentManager));
                if (drawModule != null)
                {
                    // TODO: This will never be null once we've implemented all the draw modules.
                    drawModules.Add(drawModule);
                }
            }
            DrawModules = drawModules;

            Collider = Collider.Create(objectDefinition, Transform);

            ModelConditionStates = drawModules
                                   .SelectMany(x => x.ModelConditionStates)
                                   .Distinct(new BitArrayEqualityComparer <ModelConditionFlag>())
                                   .OrderBy(x => x.NumBitsSet)
                                   .ToList();

            SetModelConditionFlags(new BitArray <ModelConditionFlag>());

            IsSelectable = Definition.KindOf?.Get(ObjectKinds.Selectable) ?? false;
        }
コード例 #3
0
ファイル: GameObject.cs プロジェクト: Avatarchik/OpenSAGE
 internal static GameObject FromMapObject(
     MapObject mapObject,
     AssetStore assetStore,
     GameObjectCollection gameObjects,
     HeightMap heightMap,
     in float?overwriteAngle    = 0.0f,
コード例 #4
0
 internal static GameObject FromMapObject(
     MapObject mapObject,
     IReadOnlyList <Team> teams,
     AssetStore assetStore,
     GameObjectCollection parent,
     in Vector3 position)