当前位置: 首页>>代码示例>>C#>>正文


C# Eye.SetColor方法代码示例

本文整理汇总了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();
            }
        }
    }
开发者ID:ZNCatlaw,项目名称:LD33,代码行数:51,代码来源:LogicalEye.cs


注:本文中的Eye.SetColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。