Camera World To Viewport Point#
Rendering / Camera / Camera World To Viewport Point Position, Eye
Description#
Compares the World To Viewport Point method of Camera component to another value
Parameters#
| Name | Description |
|---|---|
| Camera | |
| Position | |
| Eye | |
| Value |
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.Rendering;
namespace VisualScript.Runtime
{
[Title("Camera World To Viewport Point")]
[Category("Rendering/Camera/World To Viewport Point", "Position, Eye")]
[Description("Compares the World To Viewport Point method of Camera component to another value")]
[Image(typeof(IconCamera), ColorTheme.Type.Blue)]
[Parameter("Camera")]
[Parameter("Position")]
[Parameter("Eye")]
[Parameter("Value")]
[Serializable]
public class GenConditionVector3_Camera_CheckWorldToViewportPoint_2_Vector3Position_MonoOrStereoscopicEyeEye : Condition
{
[SerializeField] private GetGameObject m_Camera = new GetGameObject(
new GenTypeGameObject_Camera()
);
[SerializeField] private GetVector3 m_Value = new GetVector3();
[SerializeField] private GetVector3 m_Position = new GetVector3();
[SerializeField] private Camera.MonoOrStereoscopicEye m_Eye = default;
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("World To Viewport Point");
string parameters = $"({this.m_Position}, {this.m_Eye})";
return $"{this.m_Camera} {method} = {this.m_Value}";
}
protected override bool Run(Args args)
{
Camera component = this.m_Camera.Get<Camera>(args);
if (component == null) return false;
Vector3 value = component.WorldToViewportPoint(
(Vector3) this.m_Position.Get(args),
this.m_Eye
);
return value == (Vector3) this.m_Value.Get(args);
}
}
}