Unity之查詢物件的幾種方法
阿新 • • 發佈:2018-12-22
- GameObject.FindObjectsOfType(typeof(型別)) as 型別[];
- GameObject.FindObjectsOfType<型別>();
- GameObject.FindObjectsOfTypeAll(typeof(型別[]))as 型別[];此方法在新版本已過時
- GameObject.FindObjectsOfTypeIncludingAssets(typeof(型別[]))as 型別[];此方法在新版本已過時
- GameObject.FindSceneObjectsOfType(typeof(型別[]))as 型別[];此方法在新版本已過時
- Transform.FindObjectsOfType(typeof(型別)) as 型別[];
- Transform.FindObjectsOfType<型別>();
- Transform.FindObjectsOfTypeAll(typeof(型別[]))as 型別[];此方法在新版本已過時
- Transform.FindObjectsOfTypeIncludingAssets(typeof(型別[]))as 型別[];此方法在新版本已過時
- Transform.FindSceneObjectsOfType(typeof(型別[]))as 型別[];此方法在新版本已過時
- Object..FindObjectsOfType(typeof(型別)) as 型別[];
- Object.FindObjectsOfType<型別>();
- Object.FindObjectsOfTypeAll(typeof(型別[]))as 型別[];此方法在新版本已過時
- Object.FindObjectsOfTypeIncludingAssets(typeof(型別[])) as 型別[];此方法在新版本已過時
- Object.FindSceneObjectsOfType(typeof(型別[])) as 型別[];此方法在新版本已過時
- Resources.FindObjectsOfTypeAll(typeof(型別[])) as 型別[];
- Resources.FindObjectsOfTypeAll<型別>();