void Update() { manager_ = KinectManager.Instance; if (!(manager_ && manager_.IsInitialized())) { return; } if (colorImage_ && (colorImage_.texture == null)) { colorImage_.texture = manager_.GetUsersClrTex(); } if (MAX_CREATE_NUM > createNumCount_) { CreateLandscapeMap(); createNumCount_++; } if (createNumCount_ >= MAX_CREATE_NUM) { Texture2D debugTexture1 = new Texture2D(LegoData.LANDSCAPE_MAP_WIDTH, LegoData.LANDSCAPE_MAP_HEIGHT, TextureFormat.RGBA32, false); Texture2D debugTexture2 = new Texture2D(LegoData.LANDSCAPE_MAP_WIDTH, LegoData.LANDSCAPE_MAP_HEIGHT, TextureFormat.RGBA32, false); currentLandscapeMap_ = CalcLandscapeMapMode(); legoCreateTex_.CreateTexture(currentLandscapeMap_); landscapeMapList_.Clear(); createNumCount_ = 0; } }
// Start is called before the first frame update void Start() { LegoBlockInfo[,] legoBlockMap = JsonHelper_TwodimensionalArray.LoadJson <LegoBlockInfo>("savedata2.json"); legoCreateTex_ = gameObject.GetComponent <LegoCreateTex>(); legoCreateTex_.CreateTexture(legoBlockMap); ConvertLegoBlockInfo2LandscapeInfo(legoBlockMap); UpdateLandscapeMap(); }