Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

How to create and save Prefabs on device.

$
0
0
I am creating a gameobject and changings its property while playing. For example I have a doll and I am changing her skin tone , hair style , eye color on playing and then I am saving it. I want my gameobject to be saved. Whenever I quit my application and restart it , gameobject shouldnt lose its property. I was saving the prefab, created on run time. It runs on editor, but not on device. Please help. Following is the code I am using to save. (works only on Editor) ---------- ## Code ## public void SavePrefab () { GameObject doll = this.gameObject ; doll.name = "Barbie"; prefab = EditorUtility.CreateEmptyPrefab("Assets/Resources/" + Barbie + ".prefab"); //prefab = AssetDatabase.CreateAsset("Assets/Resources/" + Barbie + ".prefab"); EditorUtility.ReplacePrefab(Barbie, prefab); prefab.name = "Barbie" ; AssetDatabase.Refresh(); }

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>