Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Sirenix.OdinInspector;
  5. using System.Linq;
  6.  
  7. public class GameObjectsFinder : MonoBehaviour
  8. {
  9. [ShowInInspector][OnValueChanged("FindObjects")]
  10. public Dictionary<string,GameObject> objDict = new Dictionary<string, GameObject>();
  11. void FindObjects(){
  12. List<string>dKeys = new List<string>(objDict.Keys);
  13. objDict = dKeys.ToDictionary(key=>key,key=>GameObject.Find(key));
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement