Пример #1
0
 public void LoadOBJ()
 {
     AddressableManager.LoadInstantiateAsyncGameObject("Huadian", (obj) =>
     {
         Debug.Log(obj);
         temp = obj;
     });
 }
Пример #2
0
    private void Awake()
    {
        #region Instance
        // Ensure that there's exactly ONE instance of GameManager.
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(this.gameObject);
        }

        DontDestroyOnLoad(this.gameObject);
        #endregion
    }
Пример #3
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            AddressableManager.LoadSprite("button1", SpriteCallBack);
            Debug.Log("加载图片");
            //Test1();
        }

        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            //AddressableManager.UnLoadGameObejct(temp);
            Task.Run(() =>
            {
                Task <List <string> > task = AddressableManager.DestinationLableAddress(new List <object> {
                    "CoffeeShop"
                });

                Debug.Log(task.Result);

                for (int i = 0; i < task.Result.Count; i++)
                {
                    Debug.Log(task.Result[i]);
                }

                Debug.Log("按键2");
            });
        }

        if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            //ClawMachineVariant1
            Task tempTask = AddressableManager.LoadInstantiateAsyncGameObject("Huadian", (obj) =>
            {
                Debug.Log(obj);
                temp = obj;
            });

            Debug.Log("完事了");
        }

        if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            Addressables.InstantiateAsync("GroupPrefab");
            Debug.Log("按键4");
        }
    }
Пример #4
0
 public void LoadState(string id, Action <IState> onStateLoad)
 {
     if (cachedStates.ContainsKey(id))
     {
         onStateLoad?.Invoke(cachedStates[id]);
     }
     else
     {
         AddressableManager.Get(id, container.transform, obj =>
         {
             IState state = obj.GetComponent <IState>();
             cachedStates.Add(state.GetType().Name, state);
             state.Init(this);
             onStateLoad?.Invoke(state);
         });
     }
 }
Пример #5
0
 public void UnLoadObj()
 {
     AddressableManager.UnLoadGameObejct(temp);
 }
 void Awake()
 {
     Instance = this;
 }
Пример #7
0
 public override void StartLoad()
 {
     AddressableManager.Get().QueueLoader(this);
 }