/// <summary>Initializes a new instance of the <seealso cref="ZLayerInformation"/> struct.</summary> /// <param name="zLayer">The <seealso cref="ZLayer"/> whose information to retrieve.</param> public ZLayerInformation(ZLayer zLayer) { Position = GetZLayerPosition(zLayer); Layer = (zLayer - ZLayer.B1) / 2; if (Position == ZLayerPosition.Bottom) { Layer++; } }
/// <summary>Gets the absolute layer of the <seealso cref="ZLayer"/>.</summary> /// <param name="zLayer">The <seealso cref="ZLayer"/> whose absolute layer to get.</param> public static int GetAbsoluteZLayer(ZLayer zLayer) { var position = GetZLayerPosition(zLayer); var layer = (zLayer - ZLayer.B1) / 2; if (position == ZLayerPosition.Bottom) { layer++; } return(layer); }
public Vector3 GetPos(Vector3 pivot) { Vector3 v1 = new Vector3(shape.pStart.x, Frame.HeightInPixel - shape.pEnd.y, 0); Vector3 v2 = new Vector3(shape.pEnd.x + 1, Frame.HeightInPixel - shape.pStart.y + 1, 0); ZLayer realLayer = (layer != ZLayer.UNIDENTIFIED) ? layer : (shape.bg ? SettingManager.Ins.Layer.DefLayer : ZLayer.L1); v1.z += SettingManager.Ins.Layer[realLayer].Offset + (sizeZ / 2f) * (SettingManager.Ins.Layer[realLayer].Coef - 1); v2.z += SettingManager.Ins.Layer[realLayer].Offset + (sizeZ / 2f) * (SettingManager.Ins.Layer[realLayer].Coef + 1); v1.Scale(Vector3.one - pivot); v2.Scale(pivot); return((v1 + v2) + offset); }
public void AssignFrom(Pattern3D pattern, bool fromShape2Pattern = false) { constraintSize = pattern.constraintSize; geo = pattern.geo; sizeZ = pattern.sizeZ; layer = pattern.layer; offset.content = pattern.offset; scale.content = pattern.scale; rot.content = pattern.rot; pivot.content = pattern.pivot; deltaAmp.content = pattern.deltaAmp; deltaOffset.target = pattern.deltaOffset; deltaSpeed.target = pattern.deltaSpeed; deltaPivot.content = pattern.deltaPivot; tex = pattern.tex; alpha = pattern.alpha; fn = pattern.fn; enable = pattern.enable; antiShadow = pattern.antiShadow; flip = pattern.flip; solid = pattern.solid; fullWarp = pattern.fullWarp; CastShadow = pattern.CastShadow; ReceiveShadow = pattern.ReceiveShadow; if (fromShape2Pattern) { TagStr = pattern.TagStr; sizeZ = Mathf.Min(pattern.sizeZ, MAX_ZSIZE); Build(); } else { refPattern3D = pattern; tagStr = pattern.tagStr; tags = pattern.tags; linkedScript = pattern.linkedScript; } }
public void Reset() { refPattern3D = this; geo = Geo3DType.CUBE; layer = ZLayer.UNIDENTIFIED; scale.content = Vector3.one; offset.content = Vector3.zero; rot.content = Vector3.zero; pivot.content = Vector3.one / 2; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { deltaSpeed[i, j] = DefaultSpeed; deltaOffset[i, j] = DefaultOffset; } } deltaAmp.content = Vector3.zero; deltaPivot.content = Vector3.one / 2f; alpha = 1; tex = null; fn = false; enable = true; antiShadow = false; flip = false; solid = false; fullWarp = false; CastShadow = true; ReceiveShadow = true; tagStr = string.Empty; linkedScript = null; tags = null; }
/// <summary>Gets the <seealso cref="ZLayerPosition"/> of the specified <seealso cref="ZLayer"/>.</summary> /// <param name="zLayer">The <seealso cref="ZLayer"/> whose <seealso cref="ZLayerPosition"/> to get.</param> public static ZLayerPosition GetZLayerPosition(ZLayer zLayer) => zLayer < ZLayer.T1 ? ZLayerPosition.Bottom : ZLayerPosition.Top;
/// <summary>Creates an instance of the <see cref="LevelObject"/> class with the specified Object ID, location, Color IDs, Group IDs, Editor Layers and glow attibute, Z Order and Z Layer.</summary> /// <param name="objID">The Object ID of the <see cref="LevelObject"/>.</param> /// <param name="x">The X position of the <see cref="LevelObject"/>.</param> /// <param name="y">The Y position of the <see cref="LevelObject"/>.</param> /// <param name="mainColor">The Main Color ID of the <see cref="LevelObject"/>.</param> /// <param name="detailColor">The Detail Color ID of the <see cref="LevelObject"/>.</param> /// <param name="groupIDs">The Group IDs of the <see cref="LevelObject"/>.</param> /// <param name="EL1">The Editor Layer 1 of the <see cref="LevelObject"/>.</param> /// <param name="EL2">The Editor Layer 2 of the <see cref="LevelObject"/>.</param> /// <param name="disableGlow">The Disable Glow value of the <see cref="LevelObject"/>.</param> /// <param name="ZOrder">The Z Order value of the <see cref="LevelObject"/>.</param> /// <param name="ZLayer">The Z Layer value of the <see cref="LevelObject"/>.</param> public LevelObject(int objID, double x, double y, int mainColor, int detailColor, int[] groupIDs, int EL1, int EL2, bool disableGlow, int ZOrder, ZLayer ZLayer) { this[ObjectParameter.ID] = objID; this[ObjectParameter.UnknownFeature36] = ObjectLists.TriggerList.Contains(objID); this[ObjectParameter.X] = x; this[ObjectParameter.Y] = y; this[ObjectParameter.Color1] = mainColor; this[ObjectParameter.Color2] = detailColor; this[ObjectParameter.GroupIDs] = groupIDs; this[ObjectParameter.EL1] = EL1; this[ObjectParameter.EL2] = EL2; this[ObjectParameter.DisableGlow] = disableGlow; this[ObjectParameter.ZOrder] = ZOrder; this[ObjectParameter.ZLayer] = (int)ZLayer; }
internal static void SetZ(GameObject go, ZLayer layer) { go.transform.position = new Vector3(go.transform.position.x, go.transform.position.y, 50 - (int)layer); }
internal static void SetZ(GameObject go, ZLayer layer ) { go.transform.position = new Vector3(go.transform.position.x, go.transform.position.y, 50-(int)layer); }