예제 #1
0
        protected override void AwakeTest()
        {
            var wires = new TranslatedWireSpace[this.TestModelWireSpaces.Length];

            for (int i = 0; i < wires.Length; ++i)
            {
                var testWireSpace = new TranslatedWireSpace.TestWireSpace(this, this.TestModelWireSpaces[i], i);
                wires[i] = testWireSpace;
                this.TestModelWireSpaces[i].WireCut += (sender, e) => this.WireCut?.Invoke(this, e);
            }
            this.Wires = Array.AsReadOnly(wires);
        }
예제 #2
0
        protected override void AwakeLive()
        {
#if (!DEBUG)
            using var wrapper = this.InstantiateComponent <WireSetComponent>();
            var eventConnector = new WireEventConnector();
            eventConnector.WireCut += (sender, e) => this.WireCut?.Invoke(this, e);
            var wires = new TranslatedWireSpace[wrapper.Component.wires.Count];
            for (int i = 0; i < wires.Length; ++i)
            {
                var liveWireSpace = new TranslatedWireSpace.LiveWireSpace(this, wrapper.Component.wires[i], i);
                wires[i] = liveWireSpace;
                eventConnector.Attach(wrapper.Component.wires[i]);
            }
            this.Wires = Array.AsReadOnly(wires);

            var model = wrapper.Component.transform.Find("Model");
            model.SetParent(this.transform, false);
            model.transform.localPosition = new Vector3(0.006f, 0, -0.018f);
            model.transform.localScale    = new Vector3(-1, 1, 0.83f);
#endif
        }