示例#1
0
        private void DrawGameObjects(IGameObject rootGameObject)
        {
            foreach (IComponent component in rootGameObject.GetComponents())
            {
                ISpriteRenderer sr = component as ISpriteRenderer;
                if (sr != null)
                {
                    RenderSpriteHandler?.Invoke(sr);
                }

                ITextRenderer tr = component as ITextRenderer;
                if (tr != null)
                {
                    RenderTextHandler?.Invoke(tr.Font, tr.Text, tr.Transform.Position + tr.Offset, tr.Color, 0.5f, tr.Transform.Rotation, tr.Size, 0.5f);
                }

                ILineRenderer lr = component as ILineRenderer;
                if (lr != null)
                {
                    RenderLineHandler?.Invoke(lr.Start, lr.End, lr.Color, lr.Size);
                }
            }
        }
示例#2
0
 void IRenderManagerInternal.RenderSprite(ISpriteRenderer sr)
 {
     RenderSpriteHandler?.Invoke(sr);
 }