Example #1
0
    protected Vector3 RotateByCamera(Vector2 move)
    {
        var     rot   = ManagerCameras.GetMainCameraTransform().rotation;
        Vector3 forw  = rot * Vector3.forward;
        Vector3 right = rot * Vector3.right;
        Vector3 dir;

        dir.x = forw.x * move.y + right.x * move.x;
        dir.y = 0f;
        dir.z = forw.z * move.y + right.z * move.x;
        return(dir);
    }
Example #2
0
 protected override void ExternInit()
 {
     base.ExternInit();
     ManagerCameras.GetMainCamera().GetComponent <Tracker>().SetTarget(m_Unit.TF);
 }
 Vector3 WorldToScreenPoint(Vector3 position)
 {
     return(ManagerCameras.GetMainCamera().WorldToScreenPoint(position));
 }