/// <summary> /// /// </summary> /// <returns></returns> protected virtual IGraphicsGenerator instanceGfxGenerator() { IGraphicsGenerator generator = null; if (FastMode) { generator = new FastGraphicsDrawMeshGenerator(); } else { generator = new GraphicsMeshGenerator(); } return(generator); }
/// <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; } }