LoginSignup
2
3

More than 5 years have passed since last update.

Unity内でアセットが利用されてるか調べる方法

Last updated at Posted at 2019-01-15

このシーンが不要になったから削除したいが、ひょっとしたらこの画像は他シーンで使われてるかも....不安! 
ってときに役立つかも。

まず、検索したい場所のディレクトリまで移動する。

cd /UnityProject/Assets

検索したいファイルのmetaファイルを開き、guidを確認する。

sample.meta
fileFormatVersion: 2
guid: 7b8ce8844f5e146b78746508f3beb9ba  // このguidを知りたい!!
timeCreated: 1427529950
licenseType: Pro
TextureImporter:
  fileIDToRecycleName: {}
  serializedVersion: 2
  mipmaps:
    mipMapMode: 0
    enableMipMap: 0
    linearTexture: 0
    correctGamma: 0
    fadeOut: 0
    borderMipMap: 0
    mipMapFadeDistanceStart: 1
    mipMapFadeDistanceEnd: 3
  bumpmap:
    convertToNormalMap: 0
    externalNormalMap: 0
    heightScale: 0.25
    normalMapFilter: 0
  isReadable: 0
  grayScaleToAlpha: 0
  generateCubemap: 0
  cubemapConvolution: 0
  cubemapConvolutionSteps: 8
  cubemapConvolutionExponent: 1.5
  seamlessCubemap: 0
  textureFormat: -2
  maxTextureSize: 2048
  textureSettings:
    filterMode: 1
    aniso: 0
    mipBias: -1
    wrapMode: 1
  nPOTScale: 0
  lightmap: 0
  rGBM: 0
  compressionQuality: 50
  allowsAlphaSplitting: 0
  spriteMode: 1
  spriteExtrude: 1
  spriteMeshType: 1
  alignment: 0
  spritePivot: {x: 0.5, y: 0.5}
  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
  spritePixelsToUnits: 1
  alphaIsTransparency: 1
  textureType: 5
  buildTargetSettings: []
  spriteSheet:
    sprites: []
    outline: []
  spritePackingTag: 
  userData: 
  assetBundleName: login-bonus.dat
  assetBundleVariant: 

terminalで以下の通りコマンドをうつ。検索。

$find . -type f -print0 | xargs -0 grep -n "7b8ce8844f5e146b78746508f3beb9ba"
  • type f オプション: ファイルのみを対象とし検索する。
  • print0オプション
  • grep -n:行番号付きでマッチ結果を表示。

アトラス画像から特定の画像のみ検索したい場合、 | grep ファイルID と追記する。

$find . -type f -print0 | xargs -0 grep -n "xxxx"| grep yyyy
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3