Unity Addressables implements web folder update resources

Download the Addressables plugin
insert image description here
Open Addressables Groups group settings
insert image description here
Create groups
insert image description here

set path
insert image description here

Create a new cube test, drag it to the resource folder as a prefab, and then drag it into the RemoteGroup.
insert image description here
Set mode
insert image description here
Open the package
insert image description here
Find the following folder, the files in the folder are established files
insert image description here
Create a new script and add a code test.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;

public class DataTest1 : MonoBehaviour
{
    
    
    
    void Start()
    {
    
    
        Addressables.LoadAssetAsync<GameObject>("Assets/Prefabs/Cube.prefab").Completed += (handle) =>
        {
    
    
            GameObject prefabobj = handle.Result;
            GameObject cube = Instantiate(prefabobj);
        };
    }

    // Update is called once per frame
    void Update()
    {
    
    
        
    }
}

Note that the path "Assets/Prefabs/Cube.prefab" is the path of the prefab.
insert image description here

Open the network file server, here I use HFS, drag the file and parent folder just generated into
insert image description here

Back to unity, set the loading and creation path of RemoteGroup.
insert image description here
Delete the cube prefab and test it.
insert image description here

Guess you like

Origin blog.csdn.net/qq_14942529/article/details/127133051