public override bool OnSceneCreate()
    {
        switch (createState)
        {
        case CreateState.ResourceRequest:
            resourceRequestSet.Add("cube", ResourceType.AssetBundle);
            ResourceManager.Instance.RegisterRequestSet(
                RequestResourceLabel, resourceRequestSet);
            createState = CreateState.ResourceRequestWait;
            break;

        case CreateState.ResourceRequestWait:
            if (resourceRequestSet.IsComplete() == true)
            {
                Object prefab = ResourceManager.Instance.GetAssetBundle("cube");
                Debug.Log(prefab);
                instance = Object.Instantiate(prefab) as GameObject;
                instance.transform.SetParent(transform.parent);
                createState = CreateState.Complete;
            }
            break;

        case CreateState.Complete:
            createState = CreateState.ResourceRequest;
            return(true);

        default:
            break;
        }
        return(false);
    }
Exemple #2
0
    public override bool OnSceneCreate()
    {
        switch (createState)
        {
        case CreateState.ResourceRequest:
            resourceRequestSet.Add("ExampleTexture", ResourceType.Asset);
            ResourceManager.Instance.RegisterRequestSet(
                RequestResourceLabel, resourceRequestSet);
            createState = CreateState.ResourceRequestWait;
            break;

        case CreateState.ResourceRequestWait:
            if (resourceRequestSet.IsComplete() == true)
            {
                createState = CreateState.Complete;
            }
            break;

        case CreateState.Complete:
            createState = CreateState.ResourceRequest;
            return(true);

        default:
            break;
        }
        return(false);
    }
Exemple #3
0
 public override void OnSceneVisible()
 {
     Debug.Log("OnSceneVisible_B");
     resourceRequestSet = new ResourceRequestSet();
     for (var i = 0; i < 100; i++)
     {
         resourceRequestSet.Add(
             string.Format("http://pictogram-free.com/thumbnail/s_{0}.png", (i + 1).ToString("000")),
             ResourceType.Texture);
     }
     ResourceManager.Instance.RegisterRequestSet(
         RequestResourceLabel,
         resourceRequestSet);
 }