private void InitAttachmentPlacing(NodeAttachment attachmentPrefab) { ClearOnHandObjects(); _State.AttachmentInHand = (NodeAttachment)Instantiate(attachmentPrefab, HandlePoint.position, Quaternion.identity); _State.Phase = Phases.AttachingObject; }
public void RemoveAttachment(NodeAttachment attachment) { if (SimulationSettings.LayerNames.Contains(attachment.UpdateLayer) == false) { Debug.Log("Tried to Remove update func by layer name " + attachment.UpdateLayer + " which des not exist, GameObject: " + attachment.name); return; } AllAttachments.Remove(attachment); Attachments[attachment.UpdateLayer].Remove(attachment); }
private void CompareAttachment(NodeAttachment a, NodeAttachment b) { Assert.AreEqual(a.Type, b.Type); switch (a.Type) { case NodeAttachmentType.Invalid: case NodeAttachmentType.Model: case NodeAttachmentType.Unknown: throw new InvalidDataException(); case NodeAttachmentType.Node: CompareNodes(a.GetValue <Node>(), b.GetValue <Node>()); break; case NodeAttachmentType.Mesh: CompareGeometries(a.GetValue <Mesh>(), b.GetValue <Mesh>()); break; case NodeAttachmentType.Camera: CompareCameras(a.GetValue <Camera>(), b.GetValue <Camera>()); break; case NodeAttachmentType.Light: CompareLights(a.GetValue <Light>(), b.GetValue <Light>()); break; case NodeAttachmentType.Epl: CompareEpls(a.GetValue <Epl>(), b.GetValue <Epl>()); break; case NodeAttachmentType.EplLeaf: CompareEplLeafs(a.GetValue <EplLeaf>(), b.GetValue <EplLeaf>()); break; case NodeAttachmentType.Morph: CompareMorphs(a.GetValue <Morph>(), b.GetValue <Morph>()); break; default: break; } }
private void WriteNodeAttachment(uint version, NodeAttachment attachment) { WriteInt(( int )attachment.Type); switch (attachment.Type) { case NodeAttachmentType.Invalid: case NodeAttachmentType.Scene: break; case NodeAttachmentType.Node: WriteNode(version, attachment.GetValue <Node>()); break; case NodeAttachmentType.Geometry: WriteGeometry(version, attachment.GetValue <Geometry>()); break; case NodeAttachmentType.Camera: WriteCamera(version, attachment.GetValue <Camera>()); break; case NodeAttachmentType.Light: WriteLight(version, attachment.GetValue <Light>()); break; case NodeAttachmentType.Epl: WriteEpl(version, attachment.GetValue <Epl>()); break; //case NodeAttachmentType.EplLeaf: // WriteEplLeafs version, attachment.GetValue<EplLeaf>() ); // break; case NodeAttachmentType.Morph: WriteMorph(version, attachment.GetValue <Morph>()); break; default: throw new Exception($"Unknown node attachment: {attachment.Type}"); } }
private void InitAttachmentPlacing(NodeAttachment attachmentPrefab) { ClearOnHandObjects(); _State.AttachmentInHand = (NodeAttachment)Instantiate(attachmentPrefab, HandlePoint.position, Quaternion.identity); _State.Phase = Phases.AttachingObject; }
public void SetUpdateAttachment(NodeAttachment attachment) { if (SimulationSettings.LayerNames.Contains(attachment.UpdateLayer) == false) { Debug.Log("Tried to add update func by layer name " + attachment.UpdateLayer + " which des not exist, GameObject: " + attachment.name); return; } AllAttachments.Add(attachment); Attachments[attachment.UpdateLayer].Add(attachment); }