Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
        GameObject Crosshair_GO = Instantiate(CrossHair, transform.position, transform.rotation);

        cross_hair = Crosshair_GO.AddComponent <focus_control>();
        cross_hair.starting_setup(transform);
        my_camera = Camera.main.GetComponent <CameraControl>();
        my_camera.Link(transform, cross_hair.transform);
    }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
        GameObject Crosshair_GO = GameObject.CreatePrimitive(PrimitiveType.Sphere);

        cross_hair = Crosshair_GO.AddComponent <focus_control>();
        cross_hair.starting_setup(transform);
        my_camera = Camera.main.GetComponent <CameraControl>();
        my_camera.Link(transform, cross_hair.transform);
    }