public void SetContext(Object target) { GameObj = ((Transform)target).gameObject; if (GameObjectSetting == null) { GameObjectSetting = GetStoredGameObjectSetting(); } }
private MAGOSetting GetStoredGameObjectSetting() { MAGOSetting setting; if (PersistentSettings.ContainsKey(GameObj)) { setting = PersistentSettings[GameObj]; } else { setting = new MAGOSetting(GameObj); PersistentSettings.Add(GameObj, setting); } return setting; }
private MAGOSetting GetStoredGameObjectSetting() { MAGOSetting setting; if (PersistentSettings.ContainsKey(GameObj)) { setting = PersistentSettings[GameObj]; } else { setting = new MAGOSetting(GameObj); PersistentSettings.Add(GameObj, setting); } return(setting); }