本文整理汇总了C#中Eye类的典型用法代码示例。如果您正苦于以下问题:C# Eye类的具体用法?C# Eye怎么用?C# Eye使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Eye类属于命名空间,在下文中一共展示了Eye类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
_t = transform;
crt = (Creature)_t.parent.parent.gameObject.GetComponent("Creature");
eye = crt.eye.GetComponent<Eye>();
lr = (LineRenderer)gameObject.AddComponent<LineRenderer>();
lr.material.color = Color.green;
lr.material.shader = Shader.Find("Sprites/Default");
lr.SetWidth(line_width, line_width);
lr.SetVertexCount(2);
lr.GetComponent<Renderer>().enabled = true;
}
示例2: Update
// Update is called once per frame
void Update()
{
float horizontal = Input.GetAxis(m_Horizontal);
float vertical = Input.GetAxis(m_Vertical);
bool trigger = (Input.GetAxis(m_Trigger) > 0.1f || Input.GetButton(m_AltTrigger));
//Check if the player is idle
if (vertical != 0 || trigger)
{
m_IdleTimeoutRemaining = m_IdleTimeout;
}
else
{
m_IdleTimeoutRemaining -= Time.deltaTime;
}
if(!m_TargetEye && m_IdleTimeoutRemaining > 0.0f)
{
// OPEN The player is not idle, find an eye to use
m_TargetEye = m_PlayerManager.GetEye();
m_TargetEye.transform.parent = transform;
m_TargetEye.SetColor(m_Colour);
m_TargetEye.Open();
}
else if (m_TargetEye && !m_TargetEye.isClosing && m_IdleTimeoutRemaining <= 0)
{
// START CLOSING The player is idle, close and release the eye
m_TargetEye.Close();
}
else if (m_TargetEye && m_TargetEye.isClosing && m_IdleTimeoutRemaining > 0.0f)
{
// INTERRUPT CLOSING if the eye is closing and the player provides input, cancel the close
m_TargetEye.Open();
}
else if (m_TargetEye && m_TargetEye.isClosed)
{
// REMOVE EYE if the eye is finished closing, clean it up
m_PlayerManager.ReturnEye( m_TargetEye );
m_TargetEye = null;
}
if (m_TargetEye)
{
m_TargetEye.SetInput(horizontal, vertical);
if (trigger)
{
m_TargetEye.Fire();
}
}
}
示例3: Awake
void Awake()
{
activator = GetComponentInChildren<Activator>();
eye = GetComponentInChildren<Eye>();
inventory = GetComponentInChildren<Inventory>();
lastPositionKeeper = GetComponentInChildren<LastPositionKeeper>();
head = GetComponentInChildren<Head>();
cameraPlace = GetComponentInChildren<CameraPlace>();
undo = GetComponentInChildren<Undo>();
characterController = GetComponentInChildren<CharacterController>();
rewind = GetComponentInChildren<Rewind>();
slowmo = GetComponentInChildren<Slowmo>();
gravity = GetComponentInChildren<Gravity>();
all.Add(this);
}
示例4: setEyes
public void setEyes(Eye eye, EyeStatus status)
{
switch (eye)
{
case Eye.Left:
this.setEye(this.leftEyePictureBox, status);
break;
case Eye.Right:
this.setEye(this.rightEyePictureBox, status);
break;
default:
this.setEye(this.leftEyePictureBox, EyeStatus.Closed);
this.setEye(this.rightEyePictureBox, EyeStatus.Closed);
break;
}
}
示例5: Start
#pragma warning restore 0414
void Start () {
settings = Settings.getInstance();
_t = transform;
gameObject.tag = "Genital";
crt = (Creature)_t.parent.parent.gameObject.GetComponent("Creature");
lg = Logger.getInstance();
co = CollisionMediator.getInstance();
eye = crt.eye.gameObject.GetComponent<Eye>();
_t = transform;
lr = (LineRenderer)gameObject.AddComponent<LineRenderer>();
lr.material.color = Color.white;
lr.material.shader = Shader.Find("Sprites/Default");
lr.SetWidth(line_width, line_width);
lr.SetVertexCount(2);
lr.GetComponent<Renderer>().enabled = true;
timeCreated = Time.time;
line_length = float.Parse( settings.contents["genitalia"]["line_length"].ToString() );
}
示例6: EyeEaten
//only used by eye
public void EyeEaten(Eye e)
{
bool eaten = false;
for(int i = 0; i < mEyes.Length; i++) {
if(mEyes[i] == e) {
e.transform.parent = mEyeParents[i];
e.transform.localPosition = Vector3.zero;
e.transform.localRotation = Quaternion.identity;
e.transform.localScale = Vector3.one;
mEyeParents[i].gameObject.SetActiveRecursively(false);
mNumActiveEyes--;
eaten = true;
break;
}
}
if(eaten) {
stats.ApplyDamage(1);
DoHurt();
}
}
示例7: GetProjectionMatrix
/// <summary>
/// Get the projection matrix for a specified eye.
/// </summary>
/// <param name="eye">The eye: left, right, or center.</param>
/// <returns>The projection matrix in Matrix4x4 format.</returns>
public Matrix4x4 GetProjectionMatrix(Eye eye)
{
return _projectionMatrices[(int)eye];
}
示例8: GetEyePosition
/// <summary>
/// Get the position of a specified eye.
/// </summary>
/// <param name="eye">The eye: left, right, or center.</param>
/// <returns>The position of the eye in Vector3 format.</returns>
public Vector3 GetEyePosition(Eye eye)
{
float[] positionData = new float[3];
zsup_getEyePosition((int)eye, positionData);
return this.ConvertToVector3(positionData);
}
示例9: UndistortedProjection
public Matrix4x4 UndistortedProjection(Eye eye)
{
return Projection(eye, Distortion.Undistorted);
}
示例10: EyeView
public Matrix4x4 EyeView(Eye eye)
{
return EyePose(eye).Matrix;
}
示例11: EyePose
/// The transformation from head to eye.
public Pose3D EyePose(Eye eye)
{
return device.GetEyePose(eye);
}
示例12: ovrHmd_GetEyeTimewarpMatrices
private static extern void ovrHmd_GetEyeTimewarpMatrices(
IntPtr hmd,
Eye eye,
Posef renderPose,
[MarshalAs(UnmanagedType.LPArray, SizeConst = 2)]
[Out] Matrix4f_Raw[] twnOut);
示例13: ovrp_GetEyePose
public static extern Posef ovrp_GetEyePose(Eye eyeId);
示例14: ovrp_GetEyeTextureSize
public static extern Sizei ovrp_GetEyeTextureSize(Eye eyeId);
示例15: ovrp_GetEyeFrustum
public static extern Frustumf ovrp_GetEyeFrustum(Eye eyeId);