Esempio n. 1
0
 /* Call the rotate function of Ship Components and pass the position of the enemy */
 void turretRot()
 {
     if (targetEnemy != null)
     {
         shComps.turretRot(targetEnemy.transform.position);
     }
 }
Esempio n. 2
0
    /* Call the rotate function of Ship Components and pass the position of the mouse in world space  */
    void turretRot()
    {
        Ray        mouse = mouseCamera.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(mouse, out hit) && hit.collider.gameObject != this.gameObject)
        {
            shCmps.turretRot(hit.point);
        }
    }