public override void OnRemovedFromScene() { _skeletonComponent = null; CloseNodesAndEdges(); Graph = null; base.OnRemovedFromScene(); }
public Node(BendyLayer s, Vector3D pos, Vector3D up) { Position = pos; Up = UpBias = Vector3.Normalize((Vector3)up); Tangent = Vector3.Normalize(Vector3.CalculatePerpendicularVector(Up)); Graph = s; TangentPins = 0; EnsureInScene(); }
public override void OnAddedToScene() { base.OnAddedToScene(); Graph = MySession.Static.Components.Get <BendyController>().GetOrCreateLayer(Definition.Layer); _skeletonComponent = Entity.Components.Get <MySkeletonComponent>(); ReloadNodesAndEdges(); if (_skeletonComponent != null) { _skeletonComponent.OnReloadBones += OnBonesReloaded; } }
internal Edge(BendyComponent owner, Node from, Node to, CurveMode mode, Vector3?ctl0 = null, Vector3?ctl1 = null) { Owner = owner; Graph = from.Graph; From = from; To = to; Mode = mode; _ctl0 = ctl0; _ctl1 = ctl1; EnsureInScene(); }
public BendyLayer GetOrCreateLayer(string id) { BendyLayer res; if (!_layers.TryGetValue(id, out res)) { var fixedId = id.ToUpperInvariant(); _layers.Add(id, res = new BendyLayer(this, fixedId)); LayerAdded?.Invoke(fixedId, res); } return(res); }