상속: MonoBehaviour
예제 #1
0
	// Update is called once per frame
    void Update()
    {
        RaycastHit hit;
        
        Vector3 fwr = this.transform.forward;
        Debug.DrawRay(this.transform.position,fwr, Color.green);

        if (Physics.Raycast(this.transform.position, fwr, out hit, DistanceCheck))
        {
            if (hit.transform.GetComponent<bl_Hud>() != null)
            {
                if (hit.transform.GetComponent<bl_Hud>().HudInfo.ShowDynamically)
                {
                    cacheHud = hit.transform.GetComponent<bl_Hud>();
                    cacheHud.Show();
                }
            }
        }
        else
        {
            if (cacheHud != null)
            {
                cacheHud.Hide();
                cacheHud = null;
            }
        }
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        RaycastHit hit;

        Vector3 fwr = this.transform.forward;

        Debug.DrawRay(this.transform.position, fwr, Color.green);

        if (Physics.Raycast(this.transform.position, fwr, out hit, DistanceCheck))
        {
            if (hit.transform.GetComponent <bl_Hud>() != null)
            {
                if (hit.transform.GetComponent <bl_Hud>().HudInfo.ShowDynamically)
                {
                    cacheHud = hit.transform.GetComponent <bl_Hud>();
                    cacheHud.Show();
                }
            }
        }
        else
        {
            if (cacheHud != null)
            {
                cacheHud.Hide();
                cacheHud = null;
            }
        }
    }