using UnityEngine.InputSystem.Controls;

using UnityEngine.InputSystem.Layouts;

using UnityEngine.InputSystem.LowLevel;

using UnityEngine.Scripting;




namespace UnityEngine.InputSystem

{

    [InputControlLayout(stateType = typeof(PointerState), isGenericTypeOfDevice = true)]

    [Preserve]

    public class Pointer : InputDevice, IInputStateCallbackReceiver

    {


        public Pointer();

        public static Pointer current { get; }

        public Vector2Control position { get; }

        public Vector2Control delta { get; }

        public Vector2Control radius { get; }

        public AxisControl pressure { get; }

        public ButtonControl press { get; }


        public override void MakeCurrent();

        protected override void FinishSetup();

        protected void OnNextUpdate();

        protected override void OnRemoved();

        protected void OnStateEvent(InputEventPtr eventPtr);


    }


}


public class CubeController : InteractiveObjectController

{

public Transform mainCube;

public Transform lidCube;



#region instance

static CubeController instance = null;


public static CubeController Instance

{

get

{

if (instance == null)

{

instance = FindObjectOfType<CubeController>();

}

return instance;

}

}

#endregion



public override void InteractiveAction()

{

lidCube.DORotate(new Vector3(-90, 0, 0), 1).OnComplete(() => CanvasManager.Instance.ShowItemInBox());

}

}


public class TestClass{

public void OpenCube() {

CubeController.Instance.mainCube.position = Pointer.current.position.ReadValue();

CubeController.Instance.InteractiveAction();

}

}


TestClass에서 Pointer.currnt는 정적변수고 Cubecontroller에서 instance불러오는건 인스턴스화 맞나요??