コード例 #1
0
    /// <summary>
    ///
    /// </summary>
    /// <returns></returns>
    protected virtual IGraphicsGenerator instanceGfxGenerator()
    {
        IGraphicsGenerator generator = null;

        if (FastMode)
        {
            generator = new FastGraphicsDrawMeshGenerator();
        }
        else
        {
            generator = new GraphicsMeshGenerator();
        }

        return(generator);
    }
コード例 #2
0
    /// <summary>
    ///
    /// </summary>
    void Awake()
    {
        stage      = new DisplayObjectContainer();
        meshFilter = gameObject.GetComponent <MeshFilter>();
        if (meshFilter == null)
        {
            meshFilter = (MeshFilter)gameObject.AddComponent(typeof(MeshFilter));
        }
        meshRenderer = gameObject.GetComponent <MeshRenderer>();
        if (meshRenderer == null)
        {
            meshRenderer = (MeshRenderer)gameObject.AddComponent(typeof(MeshRenderer));
        }

        meshRenderer.castShadows    = false;
        meshRenderer.receiveShadows = false;

        gfxGenerator = instanceGfxGenerator();
        if (drawScale == Vector2.zero)
        {
            drawScale = defaultDrawScale;
        }
    }