示例#1
0
        private new void OnEnable()
        {
            registry = new PortRegistry <Type>(this);

            registry.RegisterPorts(Type.Quaternion, (typeof(Quaternion), "rotation", true));
            registry.RegisterActions(Type.Quaternion,
                                     ports => SetShape(CopyInputShape().Rotate(ports[0].GetInputValue <Quaternion>())));

            registry.RegisterPorts(Type.Axis, (typeof(float), "angle", true),
                                   (typeof(Vector3), "axis", true));
            registry.RegisterActions(Type.Axis,
                                     ports =>
            {
                SetShape(CopyInputShape().Rotate(ports[0].GetInputValue <float>(),
                                                 ports[1].GetInputValue <Vector3>()));
            });

            registry.RegisterPorts(Type.Euler, (typeof(Vector3), "euler", true));
            registry.RegisterActions(Type.Euler,
                                     ports => SetShape(CopyInputShape().Rotate(ports[0].GetInputValue <Vector3>())));

            registry.Activate(type);

            base.OnEnable();
        }