public void Render(IMeshRenderer renderer, int rectangleCount,
                               Material material, UnityEngine.Color additionalColor)
            {
                if (parent != null)
                {
                    parent.Render(renderer, rectangleCount, material, additionalColor);
                    return;
                }

                if (currentMeshComponent == null)
                {
                    meshComponentNo      = 0;
                    currentMeshComponent = meshComponents[meshComponentNo];
                    currentMeshComponent.SetMaterial(material, additionalColor);
                }
                else
                {
                    Material componentMaterial =
                        currentMeshComponent.canvasRenderer.GetMaterial();
                    if (componentMaterial != material ||
                        (currentMeshComponent.property != null &&
                         currentMeshComponent.additionalColor != additionalColor))
                    {
                        int no = ++meshComponentNo;
                        if (no >= meshComponents.Count)
                        {
                            AddMeshComponent();
                        }
                        currentMeshComponent = meshComponents[no];
                        currentMeshComponent.SetMaterial(material, additionalColor);
                    }
                }

                currentMeshComponent.AddRenderer(renderer, rectangleCount, updateCount);
            }
Пример #2
0
            public override void BeginRender(LWF lwf)
            {
                base.BeginRender(lwf);

                parent = null;
                var lwfParent = lwf.GetParent();

                if (lwfParent != null)
                {
                    parent = lwfParent.rendererFactory as Factory;
                }
                if (parent != null)
                {
                    return;
                }

                needsUpdate = false;
                if (updateCount != lwf.updateCount)
                {
                    needsUpdate          = true;
                    updateCount          = lwf.updateCount;
                    meshComponentNo      = -1;
                    currentMeshComponent = null;
                }
            }
            private UIVertexComponent AddMeshComponent()
            {
                GameObject gobj = new GameObject(
                    "LWF/" + data.name + "/Mesh/" + meshComponents.Count);

                gobj.SetActive(false);
                gobj.transform.parent        = gameObject.transform;
                gobj.transform.localPosition = Vector3.zero;
                gobj.transform.localScale    = Vector3.one;
                gobj.transform.localRotation = Quaternion.identity;
                UIVertexComponent meshComponent =
                    gobj.AddComponent <UIVertexComponent>();

                meshComponent.Init(this);
                meshComponents.Add(meshComponent);
                return(meshComponent);
            }
Пример #4
0
	public void Render(IMeshRenderer renderer, int rectangleCount,
		Material material, UnityEngine.Color additionalColor)
	{
		if (parent != null) {
			parent.Render(renderer, rectangleCount, material, additionalColor);
			return;
		}

		if (currentMeshComponent == null) {
			meshComponentNo = 0;
			currentMeshComponent = meshComponents[meshComponentNo];
			currentMeshComponent.SetMaterial(material, additionalColor);
		} else {
			Material componentMaterial =
				currentMeshComponent.material;
			if (componentMaterial != material ||
					(currentMeshComponent.property != null &&
					currentMeshComponent.additionalColor != additionalColor)) {
				int no = ++meshComponentNo;
				if (no >= meshComponents.Count)
					AddMeshComponent();
				currentMeshComponent = meshComponents[no];
				currentMeshComponent.SetMaterial(material, additionalColor);
			}
		}

		currentMeshComponent.AddRenderer(renderer, rectangleCount, updateCount);
	}
Пример #5
0
	public override void BeginRender(LWF lwf)
	{
		base.BeginRender(lwf);

		parent = null;
		var lwfParent = lwf.GetParent();
		if (lwfParent != null)
			parent = lwfParent.rendererFactory as Factory;
		if (parent != null)
			return;

		updateCount = lwf.updateCount;
		meshComponentNo = -1;
		currentMeshComponent = null;
	}