コード例 #1
0
        public override void OnBlockRemoved()
        {
            base.OnBlockRemoved();

            renderer?.Dispose();
            renderer = null;
        }
コード例 #2
0
ファイル: BECompass.cs プロジェクト: chriswa/vsmod-Compass
        public override void Initialize(ICoreAPI api)
        {
            base.Initialize(api);

            this.ownBlock = Api.World.BlockAccessor.GetBlock(Pos) as BlockCompass;

            if (api.Side == EnumAppSide.Client)
            {
                renderer          = new CompassNeedleRenderer(api as ICoreClientAPI, Pos, GenMesh("needle"));
                renderer.AngleRad = AngleRad;
                (api as ICoreClientAPI).Event.RegisterRenderer(renderer, EnumRenderStage.Opaque, "compass");
            }
        }
コード例 #3
0
        public override void Initialize(ICoreAPI api)
        {
            base.Initialize(api);

            if (api.Side == EnumAppSide.Client)
            {
                renderer          = new CompassNeedleRenderer(api as ICoreClientAPI, Pos, GenMesh("needle"));
                renderer.AngleRad = AngleRad;
                (api as ICoreClientAPI).Event.RegisterRenderer(renderer, EnumRenderStage.Opaque, "compass");
                if (compassBaseMesh == null)
                {
                    compassBaseMesh = GenMesh("base");
                }
            }
        }