本文整理汇总了C#中Eye.SetColor方法的典型用法代码示例。如果您正苦于以下问题:C# Eye.SetColor方法的具体用法?C# Eye.SetColor怎么用?C# Eye.SetColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eye
的用法示例。
在下文中一共展示了Eye.SetColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
}
}