Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (targetHighlight != null)
     {
         targetHighlight.MouseOver();
     }
 }
Ejemplo n.º 2
0
    void addHighLight(GameObject g)
    {
        HL = g.GetComponent <HighlighterController>();
        if (HL == null)
        {
            HL = g.AddComponent <HighlighterController>();
        }
        HL.MouseOver();

        //mHL.on(Color.red);
    }
Ejemplo n.º 3
0
 private void OnTriggerStay(Collider other)
 {
     if (hc = other.GetComponent <HighlighterController>())
     {
         hc.MouseOver();
         isb = true;
     }
     if (PlayerManager.Instance.rig && PlayerManager.Instance.rig.velocity.y < -20f)
     {
         //PlayerManager.Instance.playerInfo.OnHurt(100);
         return;
     }
 }
 static int MouseOver(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         HighlighterController obj = (HighlighterController)ToLua.CheckObject(L, 1, typeof(HighlighterController));
         obj.MouseOver();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 5
0
    //
    public void TargetingRaycast()
    {
        // Current target object transform component
        Transform targetTransform = null;

        // If camera component is available
        if (cam != null)
        {
            RaycastHit hitInfo;

            // Create a ray from mouse coords
            Ray ray = cam.ScreenPointToRay(Input.mousePosition);

            // Targeting raycast
            if (Physics.Raycast(ray, out hitInfo, targetingRayLength, targetingLayerMask.value))
            {
                // Cache what we've hit
                targetTransform = hitInfo.collider.transform;
            }
        }

        // If we've hit an object during raycast
        if (targetTransform != null)
        {
            // And this object has HighlighterController component
            //HighlighterController hc = targetTransform.GetComponentInParent<HighlighterController>();
            HighlighterController hc = targetTransform.parent.GetComponent <HighlighterController>();
            if (hc != null)
            {
                // Transfer input information to the found HighlighterController
                if (Input.GetButtonDown("Fire1"))
                {
                    hc.Fire1();
                }
                if (Input.GetButtonUp("Fire2"))
                {
                    hc.Fire2();
                }
                hc.MouseOver();
            }
        }
    }
Ejemplo n.º 6
0
    private void Update()
    {
        switch (PlayerMode.Instance.playerMode)
        {
        case PlayerMode.ePlayerMode.vive:
            _collider = Physics.OverlapSphere(transform.position, range);
            break;

        case PlayerMode.ePlayerMode.pc:
            _collider = Physics.OverlapSphere(go.transform.position, range);
            break;

        default:
            break;
        }
        for (int i = 0; i < _collider.Length; i++)
        {
            if (hc = _collider[i].GetComponent <HighlighterController>())
            {
                hc.MouseOver();
            }
        }
    }