ObjectInteraction.LookDescription C# (CSharp) Method

LookDescription() public method

public LookDescription ( ) : bool
return bool
    public bool LookDescription()
    {
        //Returns the description of this object.
                object_base item;
                item= this.GetComponent<object_base>();

                if(item!=null)
                {
                        return (item.LookAt());
                }
                else
                {
                        return false;
                }
    }

Usage Example

Ejemplo n.º 1
0
    public virtual void LookMode()
    {    //Look at the clicked item.
        Ray ray;

        if (MouseLookEnabled == true)
        {
            ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0f));
        }
        else
        {
            ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        }

        RaycastHit hit = new RaycastHit();

        if (Physics.Raycast(ray, out hit, lookRange))
        {
            //Debug.Log ("Hit made" + hit.transform.name);
            ObjectInteraction objInt = hit.transform.GetComponent <ObjectInteraction>();
            if (objInt != null)
            {
                objInt.LookDescription();
                return;
            }
        }
    }
All Usage Examples Of ObjectInteraction::LookDescription