Exemple #1
0
    void CreateFigures()
    {
        int    ind             = UnityEngine.Random.Range(0, items.name.Count);
        string AssetBundlePath = Application.streamingAssetsPath + "/AssetBundles/";

        AssetBundle.LoadFromFileAsync(AssetBundlePath + items.name[ind]).AsAsyncOperationObservable()
        .Subscribe(xs =>
        {
            GameObject[] allObjectsBundle1Prefabs = xs.assetBundle.LoadAllAssets <GameObject>();
            //  Debug.Log(ind);

            GameObject obj = Instantiate(allObjectsBundle1Prefabs[0]);
            xs.assetBundle.Unload(false);

            RandomColor randomColor = obj.GetComponent <RandomColor>();
            randomColor.StartUpdate(gameData.observableTime, geometryObjectData.clicksData[ind].color, ind);
            OnClickFigure();
        });
    }