Example #1
0
        protected override void DisconnectBoth(AttachObject obj1, AttachObject obj2)
        {
            LineObjectState state = (LineObjectState)obj1.state;

            Destroy(state.lineState.lineRenderer);
            state.lineState.lineRenderer = null;
        }
Example #2
0
        protected override void DisconnectLeaf(AttachObject root, AttachObject leaf)
        {
            LineObjectState state = (LineObjectState)leaf.state;

            DestroyImmediate(state.lineState.lineRenderer);
            state.lineState.lineRenderer = null;
            leaf.state = null;
        }
Example #3
0
        protected override void ConnectLeaf(AttachObject root, AttachObject leaf)
        {
            LineObjectState state = new LineObjectState();

            state.lineState.lineRenderer = leaf.seedObject.AddComponent <LineRenderer>();
            state.objects = new AttachObject[2];
            leaf.state    = state;
        }
Example #4
0
        protected override void ConnectBoth(AttachObject obj1, AttachObject obj2)
        {
            LineObjectState state = new LineObjectState();

            state.lineState.lineRenderer = obj1.seedObject.AddComponent <LineRenderer>();
            state.objects = new AttachObject[2] {
                obj1, obj2
            };
            obj1.state = state;
        }
Example #5
0
        void RefreshLineRenderer(Attachment attachment)
        {
            if (!IsConnected(attachment))
            {
                return;
            }
            LineObjectState state = (LineObjectState)GetObject1(attachment).state;

            ClingyLines.LineAttachStrategyUtility.RefreshLineRenderer(lineRendererDescription, state.lineState,
                                                                      state.objects, null, hideLineRendererInInspector);
        }
Example #6
0
        void RefreshLineRenderer(Attachment attachment)
        {
            AttachObject root = GetRoot(attachment);

            if (root == null || !root.isConnected)
            {
                return;
            }
            AttachObjectList.Enumerator e = attachment.objects.GetEnumerator((int)Categories.Leaves,
                                                                             phase: AttachObjectPhase.Connected);
            while (e.MoveNext())
            {
                AttachObject    leaf  = e.Current;
                LineObjectState state = (LineObjectState)leaf.state;
                state.objects[0] = root;
                state.objects[1] = leaf;
                ClingyLines.LineAttachStrategyUtility.RefreshLineRenderer(lineRendererDescription, state.lineState,
                                                                          state.objects, leaf, hideLineRenderersInInspector);
            }
        }