private NFTShapeHQImageHandler(NFTShapeHQImageConfig config) { this.config = config; this.asset = config.asset; camera = Camera.main; nftControllerT = config.controller.transform; CommonScriptableObjects.playerUnityPosition.OnChange += OnPlayerPositionChanged; OnPlayerPositionChanged(CommonScriptableObjects.playerUnityPosition, Vector3.zero); }
protected void SetUp() { isHQAsset = false; camera = new GameObject("Camera") { tag = "MainCamera" }.AddComponent <Camera>(); asset = Substitute.For <INFTAsset>(); asset.When(a => a.RestorePreviewAsset()) .Do(i => { isHQAsset = false; asset.isHQ.Returns(false); }); asset.WhenForAnyArgs(a => a.FetchAndSetHQAsset(null, null, null)) .Do(i => { isHQAsset = true; asset.isHQ.Returns(true); }); nftGO = new GameObject(); var nftController = NFTShapeFactory.InstantiateLoaderController(0).GetComponent <NFTShapeLoaderController>(); nftController.transform.SetParent(nftGO.transform); nftController.transform.ResetLocalTRS(); nftGO.transform.position = new Vector3(10, 0, 10); nftShapeConfig = nftController.config; var config = new NFTShapeHQImageConfig() { asset = asset, controller = nftController, nftConfig = nftShapeConfig }; imageHandler = NFTShapeHQImageHandler.Create(config); }