Пример #1
0
    protected override void Process(SIGProcessingContext context)
    {
#if UNITY_EDITOR
        var inputs = PullInputs();
        PushOutputs(SIGPython.Services.ProcessNode(PythonNodeClass, inputs.ToPyDict()));
#else
        context.Error();
        throw new PlatformNotSupportedException("SIGPython is only available in the Unity editor");
#endif
    }
Пример #2
0
    protected override void Process(SIGProcessingContext context)
    {
        base.Process(context);

        if (resolution.x < 1 || resolution.y < 1 || resolution.x % 1f != 0f || resolution.y % 1f != 0f)
        {
            AddMessage("Invalid resolution", NodeMessageType.Error);
            context.Error();
            return;
        }

        if (!camera.IsEmpty)
        {
            var cam = camera.GetComponent <Camera>();
            Assert(cam != null, "Camera input does not contain a camera component");
            Target.SetCamera(cam);
        }

        image = Render();
    }