本文整理汇总了C#中AttachmentPoint类的典型用法代码示例。如果您正苦于以下问题:C# AttachmentPoint类的具体用法?C# AttachmentPoint怎么用?C# AttachmentPoint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AttachmentPoint类属于命名空间,在下文中一共展示了AttachmentPoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MyText
public MyText(Point3d pt3, string cont, double th, Database db, AttachmentPoint ap)
{
this.SetDatabaseDefaults();
this.Location = pt3;
this.Contents = cont;
this.TextStyleId = db.Textstyle;
this.TextHeight = th;
this.Attachment = ap;
}
示例2: Attachment
public Attachment(AttachmentPoint attachmentPoint, PixelFormat pixelFormat, PixelInternalFormat pixelInternalFormat, PixelType pixelType, int index = 0, bool mipmaps = false)
{
AttachmentPoint = attachmentPoint;
PixelFormat = pixelFormat;
PixelInternalFormat = pixelInternalFormat;
PixelType = pixelType;
Index = index;
MipMaps = mipmaps;
}
示例3: MText
public static MText MText(Point3d pt3, string cont, double th, Database db, AttachmentPoint ap)
{
MText mt = new MText();
mt.SetDatabaseDefaults();
mt.Location = pt3;
mt.Contents = cont;
mt.TextStyleId = db.Textstyle;
mt.TextHeight = th;
mt.Attachment = ap;
return mt;
}
示例4: GetInternalReports
public ReportList GetInternalReports(AttachmentPoint point, Visibility visibility)
{
List<Report> reports = new List<Report>();
foreach (Report report in Reports)
{
if (!report.HasFlag(Flag.Internal)) continue;
if (report.AttachmentPoint != point) continue;
bool visible = report.Visibility == visibility;
visible = visible || Visibility.All == report.Visibility;
if (!visible) continue;
reports.Add(report);
}
return reports;
}
示例5: InitPrintButton
private void InitPrintButton(AttachmentPoint attachmentPoint, PrintButton button)
{
button.AttachmentPoint = attachmentPoint;
Visibility visibility;
switch (_oClientType)
{
case OClientTypes.Person:
visibility = Visibility.Individual;
break;
case OClientTypes.Group:
visibility = Visibility.Group;
break;
case OClientTypes.Corporate:
visibility = Visibility.Corporate;
break;
default:
visibility = Visibility.All;
break;
}
button.Visibility = visibility;
button.ReportInitializer =
report =>
{
report.SetParamValue("user_id", User.CurrentUser.Id);
if (_credit != null) report.SetParamValue("contract_id", _credit.Id);
if (_saving != null) report.SetParamValue("saving_id", _saving.Id);
if (_guarantee != null) report.SetParamValue("guarantee_id", _guarantee.Id);
};
button.LoadReports();
//from extension
foreach (var item in PrintButtonContextMenuStrips)
{
var menuItems = item.GetContextMenuStrip(_client, _credit, _guarantee, _saving, attachmentPoint.ToString());
if (menuItems == null) continue;
foreach (var menuItem in menuItems)
{
button.Menu.Items.Add(menuItem);
}
}
}
示例6: AttachmentAt
public InventoryItem AttachmentAt(AttachmentPoint point)
{
lock (attachments)
{
foreach (KeyValuePair<UUID, AttachmentInfo> att in attachments)
{
if (att.Value.Point == point)
{
return att.Value.Item;
}
}
}
return null;
}
示例7: Attach
/// <summary>
/// Attach an item to our agent specifying attachment details
/// </summary>
/// <param name="itemID">The <seealso cref="OpenMetaverse.UUID"/> of the item to attach</param>
/// <param name="ownerID">The <seealso cref="OpenMetaverse.UUID"/> attachments owner</param>
/// <param name="name">The name of the attachment</param>
/// <param name="description">The description of the attahment</param>
/// <param name="perms">The <seealso cref="OpenMetaverse.Permissions"/> to apply when attached</param>
/// <param name="itemFlags">The <seealso cref="OpenMetaverse.InventoryItemFlags"/> of the attachment</param>
/// <param name="attachPoint">The <seealso cref="OpenMetaverse.AttachmentPoint"/> on the agent
/// to attach the item to</param>
public void Attach(UUID itemID, UUID ownerID, string name, string description,
Permissions perms, uint itemFlags, AttachmentPoint attachPoint)
{
Attach(itemID, ownerID, name, description, perms, itemFlags, attachPoint, true);
}
示例8: Unattach
public void Unattach(AttachmentPoint parentJoint, AttachmentPoint childJoint)
{
// First remove all children of limb from skeleton...
foreach (RobotComponent limb in childJoint.owner.getDirectChildren())
{
childJoint.owner.Unattach(limb.parentAttachmentPoint, limb.parentAttachmentPoint.child);
}
AttachmentSlot slot = parentJoint.slot;
Bone bone = Skeleton.GetBoneForSlot(slot);
// Unparent from lower joint bone if it exists (for limbs)
if (bone && bone.LowerJoint)
{
bone = bone.LowerJoint;
}
AttachmentType attachmentType = childJoint.owner.parentAttachmentPoint.attachmentType;
RobotComponent child = childJoint.owner;
child.Skeleton = null;
if (LevelMusic.Instance)
{
LevelMusic.Instance.DetachLimb(childJoint.owner.limbType, childJoint.owner.Slot);
}
parentJoint.child = null;
childJoint.parent = null;
childJoint.owner.parentComponent = null;
childJoint.owner.parentAttachmentPoint= null;
if (parentJoint.connectsGround)
{
groundConnections.Remove(childJoint.owner);
}
parentJoint.childTransform = parentJoint.transform;
// parent child to null
bone.Detach(child.transform);
child.transform.parent = null;
child.parentComponent = null;
child.Skeleton = null;
// Unparent all child joints from bones
foreach (AttachmentPoint joint in childJoint.owner.allJoints)
{
Bone jointBone = Skeleton.GetBoneForSlot(joint.slot);
jointBone.Detach(joint.transform);
joint.transform.parent = joint.owner.transform;
}
child.transform.localScale = Vector3.one;
childJoint.owner.OnRemove();
OnLimbRemoved(childJoint.owner, slot, attachmentType);
// stop listening to childs' add/removeArm event
childJoint.owner.LimbAdded -= OnLimbAdded;
childJoint.owner.LimbRemoved -= OnLimbRemoved;
// Restore rigid body to unattached childJoint part
childJoint.owner.ResetPhysics();
}
示例9: AttachToLevelObject
public void AttachToLevelObject(AttachmentPoint levelAttachment)
{
joint = PlayerBehavior.Player.gameObject.AddComponent<DistanceJoint2D>();
joint.anchor = transform.position - PlayerBehavior.Player.transform.position;
joint.connectedBody = levelAttachment.collider2D.attachedRigidbody;
joint.connectedAnchor = levelAttachment.transform.position
- levelAttachment.collider2D.attachedRigidbody.transform.position;
child = levelAttachment;
}
示例10: Attach
/// <summary>
/// Attach an item to an avatar at a specific attach point
/// </summary>
/// <param name="item">A <seealso cref="OpenMetaverse.InventoryItem"/> to attach</param>
/// <param name="attachPoint">the <seealso cref="OpenMetaverse.AttachmentPoint"/> on the avatar
/// to attach the item to</param>
public void Attach(InventoryItem item, AttachmentPoint attachPoint)
{
Attach(item.Guid, item.OwnerID, item.Name, item.Description, item.Permissions, item.Flags,
attachPoint);
}
示例11: SetSelectedParent
void SetSelectedParent(AttachmentPoint point)
{
if (selectedParentJoint != point)
{
if (selectedParentJoint != null)
{
selectedParentJoint.selected = false;
if (selectedParentJoint.owner != null)
{
selectedParentJoint.owner.OnDestroy -= OnParentDestroyed;
}
}
if (point != null)
{
point.selected = true;
if (point.owner != null)
{
point.owner.OnDestroy += OnParentDestroyed;
}
AudioSource.PlayClipAtPoint(jointHoverClip, transform.position);
}
}
selectedParentJoint = point;
}
示例12: SetSelectedChild
void SetSelectedChild(AttachmentPoint point)
{
if (selectedChildJoint != point)
{
if (selectedChildJoint != null)
{
selectedChildJoint.selected = false;
if (selectedChildJoint.owner != null)
{
selectedChildJoint.owner.OnDestroy -= OnChildDestroyed;
selectedChildJoint.owner.GetComponent<PulsingSprite>().Disable();
}
}
if (point != null)
{
point.selected = true;
if (point.owner != null)
{
point.owner.OnDestroy += OnChildDestroyed;
point.owner.GetComponent<PulsingSprite>().Enable();
}
AudioSource.PlayClipAtPoint(jointHoverClip, transform.position);
}
}
selectedChildJoint = point;
}
示例13: Attach
/// <summary>
/// Attach an inventory item
/// </summary>
/// <param name="item">Item to be attached</param>
/// <param name="point">Attachment point</param>
/// <param name="replace">Replace existing attachment at that point first?</param>
public void Attach(InventoryItem item, AttachmentPoint point, bool replace)
{
Client.Appearance.Attach(item, point, replace);
AddLink(item);
}
示例14: Attach
public void Attach(AttachmentPoint parentJoint, AttachmentPoint childJoint)
{
AttachmentSlot slot = parentJoint.slot;
Bone bone = Skeleton.GetBoneForSlot(slot);
RobotComponent child = childJoint.owner;
// Parent to lower joint bone if it exists (for limbs)
if (bone.LowerJoint)
{
bone = bone.LowerJoint;
}
child.currentBone = bone;
child.Skeleton = Skeleton;
// parent child to player object
child.transform.parent = transform.rootParent();
// attach child to bone
bone.Attach(child.transform);
if (childJoint.rigidbody2D)
{
// If we don't set body to kinematic, it will get will physics update that will
// move component after attaching...
child.rigidbody2D.isKinematic = true;
}
if (childJoint.owner.rigidbody2D)
{
Destroy(childJoint.owner.rigidbody2D);
}
// Parent all child joints to the bones themselves (for torso)
foreach (AttachmentPoint joint in childJoint.owner.allJoints)
{
Bone jointBone = Skeleton.GetBoneForSlot(joint.slot);
joint.bone = jointBone;
joint.transform.parent = transform.rootParent();
jointBone.Attach(joint.transform);
}
parentJoint.child = childJoint;
childJoint.parent = parentJoint;
childJoint.owner.parentComponent = parentJoint.owner;
childJoint.owner.parentAttachmentPoint = parentJoint;
if (parentJoint.connectsGround)
{
groundConnections.Add(childJoint.owner);
}
// listen to childs' add/removelimb event
childJoint.owner.LimbAdded += OnLimbAdded;
childJoint.owner.LimbRemoved += OnLimbRemoved;
foreach (RobotComponent limb in child.getAllChildren())
{
AttachmentType type = limb.parentAttachmentPoint.attachmentType;
if (LevelMusic.Instance)
{
LevelMusic.Instance.AttachLimb(limb.limbType, limb.Slot);
}
OnLimbAdded(limb, slot, type);
}
parentJoint.childTransform = childJoint.transform;
child.OnAttach();
child.ResetColliders();
getRootComponent().ResetSpriteOrders();
getRootComponent().ResetPhysics();
}
示例15: SetMText
/// <summary>
/// Установка параметров MText.
/// </summary>
/// <param name="mt">Объект MText</param>
/// <param name="pt3">Местоположение</param>
/// <param name="cont">Содержимое</param>
/// <param name="th">Высота текста</param>
/// <param name="db">База данных документа</param>
/// <param name="ap">Точка выравнивания</param>
/// <param name="ang">Угол поворота текста (в градусах)</param>
public static void SetMText(MText mt, Point3d pt3, string cont, double th, Database db, AttachmentPoint ap, double ang)
{
mt.SetDatabaseDefaults();
mt.Location = pt3;
mt.Contents = cont;
mt.TextStyleId = db.Textstyle;
mt.TextHeight = th;
mt.Attachment = ap;
mt.Rotation = ang * Math.PI / 180;
}