コード例 #1
0
        public void OnAfterDeserialized(AnchorField anchorField)
        {
            Init(anchorField);

            //We load the link instances using link GUIDs
            LoadLinks();
        }
コード例 #2
0
        //called only once (when the anchor is created)
        public void Initialize(AnchorField anchorField)
        {
            GUID = System.Guid.NewGuid().ToString();
            Init(anchorField);

            //if we can have multiple anchors, we set the fieldIndex value
            if (anchorField.multiple)
            {
                fieldIndex = anchorField.anchors.Count;
            }
        }
コード例 #3
0
        void Init(AnchorField anchorField)
        {
            if (anchorField == null)
            {
                Debug.LogWarning("Null anchor field passed to Anchor at deserialization");
                return;
            }

            anchorFieldRef = anchorField;
            color          = anchorField.color;
            nodeRef        = anchorField.nodeRef;
            visibility     = anchorField.defaultVisibility;
        }
コード例 #4
0
        static void FindAnchors(AnchorField fromAnchorField, AnchorField toAnchorField, out Anchor fromAnchor, out Anchor toAnchor)
        {
            if (fromAnchorField.multiple)
            {
                fromAnchor = fromAnchorField.anchors.Find(a => a.linkCount == 0);
            }
            else
            {
                fromAnchor = fromAnchorField.anchors.First();
            }

            if (toAnchorField.multiple)
            {
                toAnchor = toAnchorField.anchors.Find(a => a.linkCount == 0);
            }
            else
            {
                toAnchor = toAnchorField.anchors.First();
            }
        }