Пример #1
0
        public override void OnAttachedToNode(Node node)
        {
            CursorNode      = node.CreateChild("SpatialCursor");
            CursorModelNode = CursorNode.CreateChild("SpatialCursorModel");
            CursorModelNode.SetScale(0.05f);
            var staticModel = CursorModelNode.CreateComponent <StaticModel>();

            staticModel.Model = CoreAssets.Models.Torus;
            Material mat = new Material();

            mat.SetTechnique(0, CoreAssets.Techniques.NoTextureOverlay, 1, 1);
            mat.SetShaderParameter("MatDiffColor", Color.Cyan);
            CursorModelNode.RunActions(new RepeatForever(new ScaleTo(0.3f, 0.06f), new ScaleTo(0.3f, 0.04f)));
            staticModel.SetMaterial(mat);
            staticModel.ViewMask = 0x80000000;             //hide from raycasts

            base.OnAttachedToNode(node);
            ReceiveSceneUpdates = true;

            // find Octree and Camera components:

            octree = Scene.GetComponent <Octree>(true);
            //camera = Scene.GetComponent<Camera>(true); -- doesn't work! :(( ugly workaround:
            camera = Scene.GetChildrenWithComponent <Camera>(true)[0].GetComponent <Camera>();
        }
Пример #2
0
 public void RunIdleAnimation()
 {
     CursorModelNode.RemoveAllActions();
     CursorModelNode.RunActions(new RepeatForever(new ScaleTo(0.3f, 0.05f), new ScaleTo(0.3f, 0.03f)));
 }