private void Handle_OnLoadFinish() { try { Debug.Log("Wow! Finished loading"); playerOneSprites = StreamingAssets.GetInstance().GetPlayerOneSpriteArray(); playerTwoSprites = StreamingAssets.GetInstance().GetPlayerTwoSpritesArray(); if (playerOneSprites != null && playerOneSprites.Length != 0) { playerOneButton.interactable = true; } if (playerTwoSprites != null && playerTwoSprites.Length != 0) { playerTwoButton.interactable = true; } } catch (System.Exception e) { Debug.LogException(e); } }
private void OnDisable() { StreamingAssets.GetInstance().OnLoadFinish -= Handle_OnLoadFinish; }
// Use this for initialization void Awake() { StreamingAssets.GetInstance().OnLoadFinish += Handle_OnLoadFinish; }