本文整理汇总了C#中LWF类的典型用法代码示例。如果您正苦于以下问题:C# LWF类的具体用法?C# LWF怎么用?C# LWF使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LWF类属于命名空间,在下文中一共展示了LWF类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BitmapClip
public BitmapClip(LWF lwf, Movie parent, int objId)
: base(lwf, parent, objId)
{
var data = lwf.data.bitmaps[objId];
var fragment = lwf.data.textureFragments[data.textureFragmentId];
var texdata = lwf.data.textures[fragment.textureId];
width = fragment.w / texdata.scale;
height = fragment.h / texdata.scale;
offsetX = fragment.x;
offsetY = fragment.y;
originalWidth = fragment.ow;
originalHeight = fragment.oh;
depth = -1;
visible = true;
regX = 0;
regY = 0;
x = 0;
y = 0;
scaleX = 0;
scaleY = 0;
rotation = 0;
alpha = 1;
_scaleX = scaleX;
_scaleY = scaleY;
_rotation = rotation;
_cos = 1;
_sin = 0;
_matrix = new Matrix();
}
示例2: BitmapClip
public BitmapClip(LWF lwf, Movie parent, int objId)
: base(lwf, parent, objId)
{
m_dataMatrixId = lwf.data.bitmaps[objId].matrixId;
var data = lwf.data.bitmaps[objId];
var fragment = lwf.data.textureFragments[data.textureFragmentId];
var texdata = lwf.data.textures[fragment.textureId];
width = fragment.w / texdata.scale;
height = fragment.h / texdata.scale;
m_renderer = lwf.rendererFactory.ConstructBitmap(lwf, objId, this);
depth = -1;
visible = true;
regX = 0;
regY = 0;
x = 0;
y = 0;
scaleX = 0;
scaleY = 0;
rotation = 0;
alpha = 1;
_scaleX = scaleX;
_scaleY = scaleY;
_rotation = rotation;
_cos = 1;
_sin = 0;
_matrix = new Matrix();
}
示例3: Property
public Property(LWF lwf)
{
m_lwf = lwf;
m_matrix = new Matrix();
m_colorTransform = new ColorTransform();
ClearRenderingOffset();
}
示例4: Text
public Text(LWF lwf, Movie p, int objId, int instId = -1)
: base(lwf, p, Format.Object.Type.TEXT, objId)
{
Format.Text text = lwf.data.texts[objId];
m_dataMatrixId = text.matrixId;
if (text.nameStringId != -1) {
m_name = lwf.data.strings[text.nameStringId];
} else {
if (instId >= 0 && instId < lwf.data.instanceNames.Length) {
int stringId = lwf.GetInstanceNameStringId(instId);
if (stringId != -1)
m_name = lwf.data.strings[stringId];
}
}
TextRenderer textRenderer =
lwf.rendererFactory.ConstructText(lwf, objId, this);
string t = null;
if (text.stringId != -1)
t = lwf.data.strings[text.stringId];
if (text.nameStringId == -1 && string.IsNullOrEmpty(name)) {
if (text.stringId != -1)
textRenderer.SetText(t);
} else {
lwf.SetTextRenderer(p.GetFullName(), name, t, textRenderer);
}
m_renderer = textRenderer;
}
示例5: enterFrameCallback
void enterFrameCallback( LWF.Movie movie )
{
if (movie.currentFrame == movie.totalFrames
|| !movie.playing) {
message += movie.GetFullName() + " is done \n";
lwf.rootMovie.DetachMovie( movie );
}
}
示例6: TextMeshRenderer
public TextMeshRenderer(LWF lwf, TextContext context) : base(lwf, context)
{
m_mesh = new Mesh();
m_matrix = new Matrix4x4();
m_renderMatrix = new Matrix4x4();
m_colorMult = new UnityEngine.Color();
m_colorAdd = new UnityEngine.Color();
m_color = new Color32();
}
示例7: TextMeshRenderer
public TextMeshRenderer(LWF lwf, UnityRenderer.TextContext context)
: base(lwf, context)
{
m_matrix = new Matrix(0, 0, 0, 0, 0, 0);
m_matrixForRender = new Matrix4x4();
m_colorMult = new UnityEngine.Color();
m_colorAdd = new UnityEngine.Color();
m_color = new Color32();
m_z = -1;
}
示例8: ObjectContainer
public ObjectContainer(
LWFObject lo, LWF.Object o, int h, int d, int ri, int rc, int ro)
{
lwfObject = lo;
obj = o;
hierarchy = h;
depth = d;
renderingIndex = ri;
renderingCount = rc;
renderingOffset = ro;
objects = new Dictionary<int, ObjectContainer>();
}
示例9: DrawInfo
void DrawInfo(ObjectContainer container, LWF.Object obj)
{
LWF.Matrix m = obj.matrix;
EditorGUILayout.LabelField("Matrix", string.Format(
"(sx:{0}, sy:{1}, k0:{2}, k1:{3}, tx:{4}, ty:{5}) ri:{6} rc:{7}",
m.scaleX, m.scaleY, m.skew0, m.skew1, m.translateX, m.translateY,
container.renderingIndex, container.renderingCount));
LWF.ColorTransform c = obj.colorTransform;
EditorGUILayout.LabelField("ColorTransform",
string.Format("multi:(r:{0},g:{1},b:{2},a:{3}) " +
"add:(r:{4},g:{5},b:{6},a:{7})",
c.multi.red, c.multi.green, c.multi.blue, c.multi.alpha,
c.add.red, c.add.green, c.add.blue, c.add.alpha));
}
示例10: RendererFactoryArguments
public RendererFactoryArguments(LWF.Data d, GameObject gObj, float zOff,
float zR, int rQOff, bool uAC, Camera cam, string texturePrfx,
string fontPrfx, TextureLoader textureLdr, TextureUnloader textureUnldr)
{
data = d;
gameObject = gObj;
zOffset = zOff;
zRate = zR;
renderQueueOffset = rQOff;
useAdditionalColor = uAC;
camera = cam;
texturePrefix = texturePrfx;
fontPrefix = fontPrfx;
textureLoader = textureLdr;
textureUnloader = textureUnldr;
}
示例11: DrawButton
void DrawButton(LWF.Button button, Factory factory)
{
Matrix4x4 savedMatrix = GUI.matrix;
Color savedColor = GUI.color;
factory.ConvertMatrix(ref matrix, button.matrix, 0, button.height);
Factory.MultiplyMatrix(ref renderMatrix,
factory.gameObject.transform.localToWorldMatrix, matrix);
Camera camera = factory.camera;
Matrix4x4 m = renderMatrix;
Vector2 lt = GUIUtility.ScreenToGUIPoint(camera.WorldToScreenPoint(
m.MultiplyPoint(new Vector3(0, button.height))));
Vector2 rt = GUIUtility.ScreenToGUIPoint(camera.WorldToScreenPoint(
m.MultiplyPoint(new Vector3(button.width, button.height))));
Vector2 ld = GUIUtility.ScreenToGUIPoint(camera.WorldToScreenPoint(
m.MultiplyPoint(new Vector3(0, 0))));
float dx = rt.x - lt.x;
float dy = rt.y - lt.y;
float w = Mathf.Sqrt(dx * dx + dy * dy);
dx = ld.x - lt.x;
dy = ld.y - lt.y;
float h = Mathf.Sqrt(dx * dx + dy * dy);
float angle =
Mathf.Atan2(rt.x - lt.x, rt.y - lt.y) * Mathf.Rad2Deg - 90;
lt.y = Screen.height - lt.y;
GUIUtility.RotateAroundPivot(angle, lt);
GUI.color = button == button.lwf.focus ?
LWFObjectInspector.focusButtonColor :
LWFObjectInspector.buttonColor;
GUI.DrawTexture(new Rect(lt.x, lt.y, w, h), texture);
GUI.matrix = savedMatrix;
GUI.color = savedColor;
}
示例12: ConstructText
public override TextRenderer ConstructText(LWF lwf, int objectId, Text text)
{
return new TextMeshRenderer(lwf, m_textContexts[objectId]);
}
示例13: BitmapRenderer
public BitmapRenderer(LWF lwf, BitmapContext context)
: base(lwf)
{
m_context = context;
m_property = new MaterialPropertyBlock();
m_matrix = new Matrix4x4();
m_renderMatrix = new Matrix4x4();
m_colorMult = new UnityEngine.Color();
#if LWF_USE_ADDITIONALCOLOR
m_colorAdd = new UnityEngine.Color();
#endif
}
示例14: BeginRender
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;
}
示例15: EndRender
public override void EndRender(LWF lwf)
{
base.EndRender(lwf);
if (parent != null)
return;
if (currentMeshComponent == null) {
for (int i = 0; i <= usedMeshComponentNo; ++i)
meshComponents[i].Disable();
usedMeshComponentNo = -1;
return;
}
for (int i = 0; i <= meshComponentNo; ++i)
meshComponents[i].UpdateMesh();
for (int i = meshComponentNo + 1; i <= usedMeshComponentNo; ++i)
meshComponents[i].Disable();
usedMeshComponentNo = meshComponentNo;
}