public static void GenerateSpriteAssetFile(string assetFilePath, Dictionary <string, Sprite> assets) { SpriteAssets assetFile = ScriptableObject.CreateInstance <SpriteAssets>(); assetFile.AddAssets(assets); AssetDatabase.CreateAsset(assetFile, assetFilePath); AssetDatabase.Refresh(); }
void Awake() { if (spriteAssets == null) { DontDestroyOnLoad(gameObject); spriteAssets = this; allCardbacks = new List<Sprite>(); allCardbacks.Add(cardAppollo); allCardbacks.Add(cardAphorodite); allCardbacks.Add(cardArtemis); allCardbacks.Add(cardAthena); allCardbacks.Add(cardPoseidon); allCardbacks.Add(cardHades); allPlayerLeftHands = new List<Sprite>(); allPlayerLeftHands.Add (leftHandAppollo); allPlayerLeftHands.Add (leftHandAphorodite); allPlayerLeftHands.Add (leftHandArtemis); allPlayerLeftHands.Add (leftHandAthena); allPlayerLeftHands.Add (leftHandPoseidon); allPlayerLeftHands.Add (leftHandHades); allPlayerLeftThumbs = new List<Sprite>(); allPlayerLeftThumbs.Add (leftThumbAppollo); allPlayerLeftThumbs.Add (leftThumbAphorodite); allPlayerLeftThumbs.Add (leftThumbArtemis); allPlayerLeftThumbs.Add (leftThumbAthena); allPlayerLeftThumbs.Add (leftThumbPoseidon); allPlayerLeftThumbs.Add (leftThumbHades); allPlayerRightHands = new List<Sprite>(); allPlayerRightHands.Add (rightHandAppollo); allPlayerRightHands.Add (rightHandAphorodite); allPlayerRightHands.Add (rightHandArtemis); allPlayerRightHands.Add (rightHandAthena); allPlayerRightHands.Add (rightHandPoseidon); allPlayerRightHands.Add (rightHandHades); allPlayerRightThumbs = new List<Sprite>(); allPlayerRightThumbs.Add (rightThumbAppollo); allPlayerRightThumbs.Add (rightThumbAphorodite); allPlayerRightThumbs.Add (rightThumbArtemis); allPlayerRightThumbs.Add (rightThumbAthena); allPlayerRightThumbs.Add (rightThumbPoseidon); allPlayerRightThumbs.Add (rightThumbHades); } else if (spriteAssets != this) { Destroy(gameObject); } }