Esempio n. 1
0
        protected RendererBase(
            DebugRendererAsset asset,
            MeshRenderer meshRenderer,
            MeshFilter meshFilter,
            int capacity = DefaultTriangleCapacity)
        {
            textShader        = asset.TextShader;
            texturedShader    = asset.TexturedShader;
            font              = asset.Font;
            this.meshRenderer = meshRenderer;
            this.meshFilter   = meshFilter;
            Color             = new Color32(255, 255, 255, 255);

            mesh = new Mesh();
            mesh.MarkDynamic();
            this.meshFilter.mesh = mesh;

            textMaterial          = new Material(textShader);
            texturedMaterial      = new Material(texturedShader);
            materialPropertyBlock = new MaterialPropertyBlock();

            textureShaderPropertyId = Shader.PropertyToID("_MainTex");

            Font.textureRebuilt += OnFontTextureRebuilt;
            font.RequestCharactersInTexture(whiteString);

            SetCapacity(capacity);

            // 初回は手動
            OnFontTextureRebuilt(font);
        }
Esempio n. 2
0
 public Renderer2D(
     DebugRendererAsset asset,
     MeshRenderer meshRenderer,
     MeshFilter meshFilter,
     int capacity = DefaultTriangleCapacity) : base(asset, meshRenderer, meshFilter, capacity)
 {
 }
Esempio n. 3
0
 public Renderer3D(
     DebugRendererAsset asset,
     Camera camera,
     MeshRenderer meshRenderer,
     MeshFilter meshFilter,
     int capacity = DefaultTriangleCapacity) : base(asset, meshRenderer, meshFilter, capacity)
 {
     this.camera = camera;
 }