void OnDestroy() { BlockMapper thisBlockMap = DrawMap.instance.blocksMapper.Find(x => x.blockObject == this.gameObject); DrawMap.instance.blocksMapper.Remove(thisBlockMap); AutoSetBlock AutoSetBlock = GetComponent <AutoSetBlock>(); AutoStickWall AutoStickWall = GetComponent <AutoStickWall>(); if (AutoSetBlock != null) { AutoSetBlock.UpdateOthers(); } }
void RotateWallStickers() { Vector3 touchpoint = CommonMethods.GetTouchPoint(); Vector3 snappedTouchPoint = CommonMethods.GetSnappedPoint(touchpoint); BlockMapper block = CheckListForPosition(snappedTouchPoint); if (block != null && mapAssets[selectedBlock].prefab != null) { if (block.blockObject.GetComponent <BlockTypeManager>().blockType == mapAssets[selectedBlock].prefab.GetComponent <BlockTypeManager>().blockType) { AutoStickWall autoStickWall = block.blockObject.GetComponent <AutoStickWall>(); if (autoStickWall != null) { autoStickWall.SetSprites(); } } } }