public void OnSourceNodeUpdate(Base_Node node) { source = node; bgColor = ActiveConfig.targetColor; OnShaderParametersChanged(); SetDirty(); }
private void UpdateVisibility(Base_Node node, NodeCircleController previous = null) { if (node == null) { return; } bool editingOrGotParent = (Shortcuts.editingNodes || ((node.parentNode != null && node.Conditions_isVisible()) || !Application.isPlaying)); var current = Shortcuts.CurrentNode; bool currentNodeContains = (current != null && (node == current || current.Contains(node))); var shouldBeVisible = editingOrGotParent && currentNodeContains; if (node.visualRepresentation == null) { if (shouldBeVisible) { MakeVisible(node, previous); } } else if (!shouldBeVisible) { MakeHidden(node, previous); } if (node.visualRepresentation != null) { (node.visualRepresentation as NodeCircleController).SetDirty(); } }
public void LinkTo(Base_Node node) { myLastLinkedNode = node; source = node; Decode(source.LinkTo(this)); NameForPEGI = source.name; isFading = false; gameObject.SetActive(true); if (circleCollider) { circleCollider.enabled = true; } _latestParent = null; if (node.parentNode != null) { var vis = node.parentNode.visualRepresentation as NodeCircleController; if (vis != null) { _latestParent = vis; } } }
public void Reset(Base_Node node) { source = node; gameObject.hideFlags = HideFlags.DontSave; /* if (!_meshFilter) * _meshFilter = gameObject.AddComponent<MeshFilter>(); * * if (!_meshRenderer) * _meshRenderer = gameObject.AddComponent<MeshRenderer>(); * * if (!_painter) * { * _painter = gameObject.AddComponent<PlaytimePainter.PlaytimePainter>(); * _painter.Reset(); * meshes.Add(this); * _painter.SharedMesh = Shortcuts.Instance.GetMesh(""); * _painter.UpdateMeshCollider(_painter.SharedMesh); * * }*/ foreach (var obj in objects) { Reinstantiate(obj); } }
private void MakeVisible(Base_Node node, NodeCircleController centerNode = null) { NodeCircleController nnp = null; if (!centerNode) { centerNode = node.parentNode?.visualRepresentation as NodeCircleController; } var reusing = false; if (node.previousVisualRepresentation != null) { var tmp = node.previousVisualRepresentation as NodeCircleController; if (tmp && tmp.isFading && node == tmp.myLastLinkedNode) { nnp = tmp; if (tmp.gameObject.activeSelf) { reusing = true; } } } if (!nnp) { while (_firstFree < NodesPool.Count) { var np = NodesPool[_firstFree]; if (!np.gameObject.activeSelf) { nnp = np; break; } _firstFree++; } } if (!nnp) { if (!circlePrefab) { return; } nnp = Instantiate(circlePrefab); nnp.IndexForPEGI = NodesPool.Count; NodesPool.Add(nnp); } nnp.LinkTo(node); if (!reusing) { nnp.SetStartPositionOn(centerNode); } }
private void MakeHidden(Base_Node node, NodeCircleController previous = null) { var ncc = node.visualRepresentation as NodeCircleController; if (!ncc) { return; } ncc.Unlink(); if (!Application.isPlaying) { Delete(ncc); } else { ncc.SetFadeAwayRelation(previous); } }
public void Unlink() { if (source != null) { source.Unlink(Encode()); source = null; } isFading = true; if (LevelArea) { LevelArea.FadeAway(); LevelArea = null; } if (circleCollider) { circleCollider.enabled = false; } }
public abstract void MakeHidden(Base_Node node);
public abstract void MakeVisible(Base_Node node);
public void OnSourceNodeUpdate(Base_Node node) { }
public void OnSourceNodeUpdate(Base_Node node) { currentNode = node.AsNode; }
public override void MakeHidden(Base_Node node) { }
public override void MakeVisible(Base_Node node) { }