public void InitWithComponentClassType()
        {
            var componentSystem = new GKComponentSystem <MySubcomponent> ();

            Assert.NotNull(componentSystem, "GKComponentSystem type ctor must not be null");
            Assert.AreEqual(typeof(MySubcomponent), componentSystem.ComponentType);
        }
Example #2
0
        public override void DidMoveToView(SKView view)
        {
                        #if TARGET_OS_MAC
            var fontName = NSFont.SystemFontOfSize(65).FontName;
            var label    = SKLabelNode.FromFont(fontName);
            label.Text     = SceneName;
            label.FontSize = 65;
            label.HorizontalAlignmentMode = SKLabelHorizontalAlignmentMode.Left;
            label.VerticalAlignmentMode   = SKLabelVerticalAlignmentMode.Top;
            label.Position = new CGPoint(Frame.GetMinX() + 10, Frame.GetMaxY() - 46);
            AddChild(label);
                        #endif

            AgentSystem            = new GKComponentSystem <GKAgent2D> ();
            TrackingAgent          = new GKAgent2D();
            TrackingAgent.Position = new Vector2((float)Frame.GetMidX(), (float)Frame.GetMidY());
        }
        public void IndexerTest()
        {
            var componentSystem = new GKComponentSystem <MySubcomponent> ();

            Assert.NotNull(componentSystem, "GKComponentSystem type ctor must not be null");
            Assert.AreEqual(typeof(MySubcomponent), componentSystem.ComponentType);

            componentSystem.AddComponent(new MySubcomponent(0));
            componentSystem.AddComponent(new MySubcomponent(1));
            componentSystem.AddComponent(new MySubcomponent(2));

            Assert.IsTrue(componentSystem.Components.Length == 3, "componentSystem.Components must be 3");
            var secondComponent = componentSystem [1] as MySubcomponent;

            Assert.NotNull(secondComponent, "secondComponent must not be null");
            Assert.IsTrue(secondComponent.Id == 1, "secondComponent.Id must be 1");
        }
Example #4
0
        public override void DidMoveToView(SKView view)
        {
            #if TARGET_OS_MAC
            var fontName = NSFont.SystemFontOfSize (65).FontName;
            var label = SKLabelNode.FromFont (fontName);
            label.Text = SceneName;
            label.FontSize = 65;
            label.HorizontalAlignmentMode = SKLabelHorizontalAlignmentMode.Left;
            label.VerticalAlignmentMode = SKLabelVerticalAlignmentMode.Top;
            label.Position = new CGPoint (Frame.GetMinX () + 10, Frame.GetMaxY () - 46);
            AddChild (label);
            #endif

            AgentSystem = new GKComponentSystem (typeof(GKAgent2D));
            TrackingAgent = new GKAgent2D ();
            TrackingAgent.Position = new Vector2 ((float)Frame.GetMidX (), (float)Frame.GetMidY ());
        }