本文为实现类似《原神》在世界中与物品、NPC等的交互功能,在此抛砖引玉讲讲自己的实现方案。


实现思路:

   简单版:

      1.射线检测范围内可交互对象(可优化降低性能);

      2.存在交互对象时显示交互界面;

      3.点击交互界面选项进入该选项下一级UI可选交互选项;

      4.点击交互选项实现其对应效果功能。


   升级版:

      射线检测范围内可交互对象(可优化降低性能)

         1.角色设计射线检测方法
         2.设计可交互对象类与对应数据表
      存在交互对象时显示交互界面
         1.显示交互UI,并获取射线检测存储的可交互对象数据
         2.刷新UI的选项信息(图片、文字等)
      点击交互界面选项进入该选项下一级UI可选交互选项,点击可选交互选项实现其对应效果功能
         1.判定当前焦点状态机状态,若为非交互状态,则进入交互状态,并根据当前选项与数据表数据匹配寻找下一级(子级)的可选交互选项,然后刷新显示这些选项。如果为交互状态,则根据当前选项,调用其对应的事件方法。


      再加上亿点点细节
         1.创建数据库表并获取表数据(表文件、对应存储类),组合数据(交互选项与子级选项数据组合绑定一起,方便后续查找、使用);
         2.角色射线检测与滚轮功能(通过“滚轮+按键”来选择当前选项);
         3.设计状态机(可选);
         4.设计互动UI与其具体UI管理类(UI初始化、选项事件注册等);
         5.设计互动选项的事件管理类(管理选项的点击事件);
         6.(难)设计互动UI管理类的具体实现功能(选项信息匹配、显示、滚轮功能的GUI焦点切换等);
         7.在互动选项的事件管理类中对选项功能进行实现;
         8.组合起来然后修bug。


   实现效果

   


交互功能实现:类《原神》



   由于整个代码部分比较复杂,以下展示关键代码,仅供学习参考


   射线检测

/// <summary>
    /// 每隔一段时间进行检测(几帧)
    /// </summary>
    private void RayCheck() {
        if (!isCanRayCheck) {
            return;
        }
        radiusClock += Time.deltaTime;
        if(radiusClock > timeRadiusCheck) {
            radiusClock = 0;
            //检测
            //重置数据
            ListGoInteractive.Clear();
            ListGoInteractiveId.Clear();
            //射线检测--非常近的距离进行检测
            //PS:需要对想要检测的对象设置好层级layout-FantasySpace
            Collider[] cols = Physics.OverlapSphere(tf.position, radiusCheck,1<< LayerMask.NameToLayer("FantasySpace"));
            //如果存在互动对象
            if (cols.Length > 0) {
                //如果焦点状态机不是Interactive,则显示最外层的互动UI
                if (StateMgr.Instance.GetCurrentState(Machine.FocusMachine)!=State.Interactive)
                {
                    for (int i = 0; i < cols.Length; i++)
                    {
                        //Debug.Log("检测到物体" + cols[i].name);
                        //将范围内所有可互动的对象(继承IInteractive接口)存入List中
                        if (cols[i].gameObject.GetComponent<IInteractive>() != null)
                        {
                            ListGoInteractive.Add(cols[i].gameObject.GetComponent<IInteractive>());
                        }
                    }
                    //如果List存在数据并且不处于具体焦点交互状态,则开启UI(显示最外层交互UI)
                    if (ListGoInteractive.Count > 0)
                    {
                        //初始化保存Id,便于后续UI的访问信息
                        GetListGoInteractiveId();
                        Send.SendMsg(SendType.AppearInteractiveUI, true);
                    }
                }
            }
            else
            {
                //如果没有交互对象,且处于Interactive状态,则重置
                if (StateMgr.Instance.GetCurrentState(Machine.FocusMachine) == State.Interactive) {
                    //没有互动对象,设置焦点状态机为isCtrl
                    StateMgr.Instance.GotoState(StateMgr.Machine.FocusMachine, StateMgr.State.Ctrl);
                }
            }
            //没有检测到可交互对象则隐藏互动UI
            if(cols.Length <= 0)
            {
                //如果List没有数据,则关闭互动UI
                Send.SendMsg(SendType.AppearInteractiveUI, false);
            }
        }
    }//RayCheck_end

   滚轮功能

/// <summary>
    /// 滚轮控制交互选择上下移动
    /// </summary>
    private void MouseScrollCtrl() {
        //滚轮上下滑动
        if (Input.GetAxis("Mouse ScrollWheel") < 0) {
            mouseScroll -= GlobalPropertyMgr.FLO_OPOINT5;
            if (mouseScroll <= -1 * GlobalPropertyMgr.FLO_MOUSESCROLLSPEED) {
                Send.SendMsg(SendType.MouseScrollInteractiveUI, true);
                mouseScroll = 0;
            }
        }
        else if (Input.GetAxis("Mouse ScrollWheel") > 0) {
            mouseScroll += GlobalPropertyMgr.FLO_OPOINT5;
            if (mouseScroll >= GlobalPropertyMgr.FLO_MOUSESCROLLSPEED) {
                Send.SendMsg(SendType.MouseScrollInteractiveUI, false);
                mouseScroll = 0;
            }
        }
    }


    /// <summary>
    /// 根据鼠标滚轮来进行互动选项的上下选择
    /// </summary>
    /// <param name="_objs"></param>
    private void EventMouseScrollInteractiveUI(object[] _objs) {
        print("触发");
        if (_objs[0] == null) {
            Debug.LogError("Wrong");
            return;
        }
        //如果为true,则向上移动,否则向下
        bool isUp = (bool)_objs[0];
        //隐藏上一个显示的UI效果
        goListInteractiveItem[index].focusIcon.gameObject.SetActive(false);
        if (!isUp) {
            //向上移动,如果到达0,则无响应(或者当前选项刷新一下)
            //window需要保存一个下标值index
            index = index > 0 ? index - 1 : 0;
            //显示List对应Index的效果
            goListInteractiveItem[index].focusIcon.gameObject.SetActive(true);
            //设置GUI焦点
            GUI.FocusControl(goListInteractiveItem[index].obj.name);
        }
        else {
            //向下移动,如果到达最高,则无响应(或者当前选项刷新一下)
            //window需要保存一个下标值index
            index = index < goListInteractiveItem.Count - 1 ? index + 1 : goListInteractiveItem.Count - 1;
            //显示List对应Index的效果
            goListInteractiveItem[index].focusIcon.gameObject.SetActive(true);
            //设置GUI焦点
            GUI.FocusControl(goListInteractiveItem[index].obj.name);
        }
    }
    
    /// <summary>
    /// 调用当前选中的对象点击事件
    /// </summary>
    /// <param name="_objs"></param>
    private void OnTriggerCurInteractiveItemClick(object[] _objs) {
        //当玩家按下互动键,会对当前获得焦点的对象进行事件调用
        ExecuteEvents.Execute(goListInteractiveItem[index].obj,
            new PointerEventData(EventSystem.current), ExecuteEvents.pointerClickHandler);
    }

   状态机

   学习链接:


   互动具UI管理类

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using static GlobalPropertyMgr;
using static StateMgr;

public class FantasySpaceWindow : BaseWindowWrapper<FantasySpaceWindow> {

    private GameObject goMiddle;
    //内容(选项)
    private GameObject goMiddleContent;
    //选项List
    private List<InteractiveItem> goListInteractiveItem;
    //滑动条
    private Scrollbar scrollBar;

    private GameObject goFantasySpacePanel;
    //当前选中选项的下标(自上到下)
    private int index;
    //当前选项
    private InteractiveModle outOptionID;
    private int curSelectOptionID;

    protected override void InitCtrl() {
        
        goMiddle = gameObject.GetChildControl<Transform>("Middle").gameObject;
        goMiddleContent = gameObject.GetChildControl<Transform>("Middle/Content").gameObject;
        scrollBar = gameObject.GetChildControl<Scrollbar>("Middle/Scrollbar");
        goFantasySpacePanel = gameObject.GetChildControl<Transform>("Others/WinFantasySpacePanel").gameObject;
        goListInteractiveItem = new List<InteractiveItem>();
        //初始化
        foreach (Transform item in goMiddleContent.transform) {
            item.gameObject.SetActive(false);
            InteractiveItem iitem = new InteractiveItem();
            iitem.obj = item.gameObject;
            iitem.focusIcon = item.gameObject.GetChildControl<Image>("icon");
            iitem.info = item.gameObject.GetChildControl<Transform>("Info").gameObject;
            iitem.infoIcon = item.gameObject.GetChildControl<Image>("Info/infoIcon");
            iitem.infoText = item.gameObject.GetChildControl<Text>("Info/infoText");
            iitem.focusIcon.gameObject.SetActive(false);
            goListInteractiveItem.Add(iitem);
        }
        index = 0;
        //显示第一个的目标并设置GUI焦点为它
        goListInteractiveItem[0].focusIcon.gameObject.SetActive(true);
        GUI.FocusControl(goListInteractiveItem[0].obj.name);
    }

    protected override void OnPreOpen() {
        goMiddle.SetActive(false);
    }

    protected override void OnOpen() {
    }

    protected override void InitMsg() { 
        //事件注册
        Send.RegisterMsg(SendType.AppearInteractiveUI, EventAppearInteractiveUI);
        Send.RegisterMsg(SendType.MouseScrollInteractiveUI, EventMouseScrollInteractiveUI);
        Send.RegisterMsg(SendType.AddSmallThing, OnTriggerCurInteractiveItemClick);
        Send.RegisterMsg(SendType.BackRefreshInteractiveUI, EventBackRefreshInteractiveUI);
        //数据初始化
        foreach (Transform tf in goMiddleContent.transform) {
            Button btn = tf.GetComponent<Button>();
            //事件注册
            btn.onClick.AddListener(delegate { OnClickInteractiveBtn(btn.gameObject); } );
        }
    }

    protected override void ClearMsg() {
        //事件注销
        Send.UnregisterMsg(SendType.AppearInteractiveUI, EventAppearInteractiveUI);
        Send.UnregisterMsg(SendType.MouseScrollInteractiveUI, EventMouseScrollInteractiveUI);
        Send.UnregisterMsg(SendType.AddSmallThing, OnTriggerCurInteractiveItemClick);
        Send.UnregisterMsg(SendType.BackRefreshInteractiveUI, EventBackRefreshInteractiveUI);
        foreach (Transform tf in goMiddleContent.transform) {
            Button btn = tf.GetComponent<Button>();
            //事件注销
            btn.onClick.RemoveListener(delegate { OnClickInteractiveBtn(btn.gameObject); });
        }
    }

    /// <summary>
    /// "返回"选项刷新互动UI到上一级
    /// </summary>
    /// <param name="_objs"></param>
    private void EventBackRefreshInteractiveUI(object[] _objs)
    {
        //鲁棒性检测
        //...
        //实际效果:返回的最外一级(就2层),后续优化:根据第一个参数step确定返回第几步,或者curOption使用类似指针来获取?
        SortAppearInteractiveUI(0);
    }

    /// <summary>
    /// 根据鼠标滚轮来进行互动选项的上下选择
    /// </summary>
    /// <param name="_objs"></param>
    private void EventMouseScrollInteractiveUI(object[] _objs) {
        print("触发");
        if (_objs[0] == null) {
            Debug.LogError("Wrong");
            return;
        }
        //如果为true,则向上移动,否则向下
        bool isUp = (bool)_objs[0];
        //隐藏上一个显示的UI效果
        goListInteractiveItem[index].focusIcon.gameObject.SetActive(false);
        if (!isUp) {
            //向上移动,如果到达0,则无响应(或者当前选项刷新一下)
            //window需要保存一个下标值index
            index = index > 0 ? index - 1 : 0;
            //显示List对应Index的效果
            goListInteractiveItem[index].focusIcon.gameObject.SetActive(true);
            //设置GUI焦点
            GUI.FocusControl(goListInteractiveItem[index].obj.name);
        }
        else {
            //向下移动,如果到达最高,则无响应(或者当前选项刷新一下)
            //window需要保存一个下标值index
            index = index < goListInteractiveItem.Count - 1 ? index + 1 : goListInteractiveItem.Count - 1;
            //显示List对应Index的效果
            goListInteractiveItem[index].focusIcon.gameObject.SetActive(true);
            //设置GUI焦点
            GUI.FocusControl(goListInteractiveItem[index].obj.name);
        }
    }
    
    /// <summary>
    /// 调用当前选中的对象点击事件
    /// </summary>
    /// <param name="_objs"></param>
    private void OnTriggerCurInteractiveItemClick(object[] _objs) {
        //当玩家按下互动键,会对当前获得焦点的对象进行事件调用
        ExecuteEvents.Execute(goListInteractiveItem[index].obj,
            new PointerEventData(EventSystem.current), ExecuteEvents.pointerClickHandler);
    }

    /// <summary>
    /// 从表中根据名字找对应的id
    /// </summary>
    /// <param name="name">id选项的名字(选项的Text为string类型,所以使用name而不是id来辨别,待改进)</param>
    /// <returns></returns>
    private int SearchForID(string name) {
        int findId = -1;
        //遍历寻找含有Name属性的表
        //FantasySpaceObjs表
        foreach (FantasySpaceObjsItemInfo item in FantasySpaceObjsMgr.Instance.itemInfoList)
        {
            if (item.refObjs.Name == name)
            {
                findId = item.refObjs.Id;
                return findId;
            }
        }
        //InteractiveCustomOptions表
        foreach (RefInteractiveCustomOptionsItemInfo item in RefInteractiveCustomOptionsMgr.Instance.itemInfoList) {
            if(item.refObjs.Name == name) {
                findId = item.refObjs.Id;
                return findId;
            }
        }
        //InteractiveOptions表
        foreach (RefInteractiveOptionsItemInfo item in RefInteractiveOptionsMgr.Instance.itemInfoList) {
            if (item.refObjs.Name == name) {
                findId = item.refObjs.Id;
                return findId;
            }
        }
        Debug.LogError("No Find"+ findId);
        return findId;
    }

    /// <summary>
    /// 点击可交互对象事件
    /// </summary>
    private void OnClickInteractiveBtn(GameObject curBtn) {
        //判定id来打开不同的UIPanel
        //获取该选项的名字(方便后面通过名字Name来寻找Id)
        int key = 0;
        //寻找当前按下的选项,并记录下标key值
        foreach (InteractiveItem item in goListInteractiveItem) {
            if(curBtn == item.obj) {
                break;
            }
            else {
                key++;
            }
        }
        //获取该选项的Text内容(选项名字)
        String name = goListInteractiveItem[key].infoText.text;
        //初始化id
        InteractiveModle id = InteractiveModle.None;
        //获取当前的Name,根据Name获取id,然后switch比较id进行不同操作
        //在FantasySpaceObjs.txt中找对应数据,后续待优化(区别在哪个空间找)
        //如果是最外层查询,则为FantasySpaceObjsMgr(当前场景空间查询)
        //如果是里一层,则为当前对象保存的集合中查询
        State curState = StateMgr.Instance.GetCurrentState(Machine.FocusMachine);
        //这样效率不是特别高,增加一个默认参数在SearchForID()策略模式进行筛选?如在FantasySpace场景中只搜寻该场景使用到的表
        int findId = SearchForID(name);
        id = (InteractiveModle)findId;
        //当前焦点状态机状态不是Interactive,则说明还在最外层选项:获取子级选项并刷新选项UI
        if (curState != State.Interactive) {
            //尝试对id2获取
            //id2 = 1;
            //更新最外层保存的
            outOptionID = id;
            //焦点状态机-进入交互状态
            StateMgr.Instance.GotoState(Machine.FocusMachine, State.Interactive);
            //获取当前选中选项(从PlayerItemView中)
            //如果存在数据选项不对应bug,可能需要先排序下或者是index错乱
            switch (id) {
                case InteractiveModle.Kernal:
                    //根据当前id,获取第二层id集合,根据id集(包含自定义交互选项)进行校验显示对应UI数据
                    //将goListInteractiveItem进行UI赋值
                    //获取Text(第二层id)对应id拥有的模块,根据Text的属性即可
                    //更新显示的ListUI项目
                    //Send.SendMsg(SendType.SetRayCheck, false);
                    //幻想空间
                    SortAppearInteractiveUI(1, curBtn);
                    break;
                case InteractiveModle.Prop:
                    //道具空间
                    SortAppearInteractiveUI(1, curBtn);
                    break;
                default:
                    //匹配id失败,重置状态为None
                    StateMgr.Instance.GotoState(Machine.FocusMachine, State.None);
                    Debug.LogError("错误的id");
                    break;
            }
        }
        else {
            //如果id2获取过,则对选择的选项进行事件响应
            TellCurInteractiveOptions(id);
        }


    }//OnClickInteractiveBtn_end

    /// <summary>
    /// 判定当前可交互对象有哪些选项,显示并执行
    /// </summary>
    private void TellCurInteractiveOptions(InteractiveModle id) {
        //第二层switch
        //通用:指2个及以上的对象使用
        //自定义:只供该对象使用
        Debug.Log(id);
        switch (id) {
            //根据需求设置id2?
            case GlobalPropertyMgr.InteractiveModle.Interactive:
                //交互
                Send.SendMsg(SendType.InteractiveOption, outOptionID);

                break;
            case GlobalPropertyMgr.InteractiveModle.Get:
                //获取
                Send.SendMsg(SendType.GetOption);
                break;
            case GlobalPropertyMgr.InteractiveModle.Discard:
                //丢弃
                Send.SendMsg(SendType.DiscardOption);
                break;
            case GlobalPropertyMgr.InteractiveModle.Continue:
                //继续
                Send.SendMsg(SendType.ContinueOption);
                break;

            case GlobalPropertyMgr.InteractiveModle.Back:
                //返回上一级
                Send.SendMsg(SendType.BackOption,outOptionID);
                //重置UI
                break;
            case GlobalPropertyMgr.InteractiveModle.End:
                //结束
                Send.SendMsg(SendType.EndOption);
                break;
            case GlobalPropertyMgr.InteractiveModle.Talk:
                //交流
                Send.SendMsg(SendType.TalkOption);
                break;
            case GlobalPropertyMgr.InteractiveModle.Ues:
                //使用
                Send.SendMsg(SendType.UseOption);
                break;
            case GlobalPropertyMgr.InteractiveModle.Trade:
                Send.SendMsg(SendType.TradeOption);
                break;
            case GlobalPropertyMgr.InteractiveModle.Accept:
                Send.SendMsg(SendType.AcceptOption);
                break;
            case GlobalPropertyMgr.InteractiveModle.Refuse:
                Send.SendMsg(SendType.RefuseOption);
                break;
            case GlobalPropertyMgr.InteractiveModle.AcceptTask:
                Send.SendMsg(SendType.AcceptOption);
                break;
            case GlobalPropertyMgr.InteractiveModle.RefuseTask:
                Send.SendMsg(SendType.RefuseTaskOption);
                break;
            //自定义选项
            case GlobalPropertyMgr.InteractiveModle.MysteriousWorld:
                //未知神秘世界
                Send.SendMsg(SendType.MysteriousWorldOption);
                break;

            default:
                Debug.LogError("Wrong TellCurInteractiveOptions");
                break;
        }
        //执行对应选项后状态重置
        //状态重置为Ctrl:需要放在具体方法中执行
        //StateMgr.Instance.GotoState(StateMgr.Machine.FocusMachine, StateMgr.State.Ctrl);

    }//TellCurInteractiveOptions_end

    /// <summary>
    /// 重置可交互UI
    /// </summary>
    private void ResetRefresh() {

    }

    /// <summary>
    /// 显示可交互UI
    /// </summary>
    /// <param name="_objs"></param>
    private void EventAppearInteractiveUI(object[] _objs) {
        //显示信息初始化
        if (_objs[0]!=null) {
            bool active = (bool)_objs[0];
            //如果需要显示互动UI,则需要根据获取的互动对象进行排版然后进行显示
            if (active) {
                SortAppearInteractiveUI(0,null);
            }
            //显示
            //当不处于激活状态
            if (goMiddle.activeInHierarchy != active) {
                goMiddle.SetActive(active);
            }
        }
    }//EventAppearInteractiveUI_end

    /// <summary>
    /// 需要根据获取的互动对象进行排版
    /// </summary>
    /// <param name="step">交互级别(0为最外层:玩家附近的对象;1为对象可供选择选项)</param>
    private void SortAppearInteractiveUI(int step,GameObject curBtn = null) {
        int index = 0;
        foreach (InteractiveItem item in goListInteractiveItem) {
            item.obj.SetActive(false);
        }
        List<int> goIds = new List<int>();
        if (step == 0)
        {
            //获取玩家附件可交互对象id集合
            goIds = PlayerMgr.Instance.ItemView.ListGoInteractiveId;
            
        }
        else if (step == 1)
        {
            if (curBtn) {
                int key = 0;
                foreach (InteractiveItem item in goListInteractiveItem) {
                    if (curBtn == item.obj) {
                        break;
                    }
                    else {
                        key++;
                    }

                }
                String name = goListInteractiveItem[key].infoText.text;
                int findId = SearchForID(name);
                foreach (IInteractive item in PlayerMgr.Instance.ItemView.ListGoInteractive) {
                    if(item.GetID()== findId) {
                        goIds = item.GetOptionsID();
                    }

                }
                
            }
            else {
                //获取当前锁定选项的次级选项id集合---混轮+F
                goIds = PlayerMgr.Instance.ItemView.ListGoInteractive[index].GetOptionsID();
            }
            
        }
        //Debug.Log(step);
        float width = goMiddleContent.GetComponent<RectTransform>().rect.width;
        goMiddleContent.GetComponent<RectTransform>().sizeDelta = new Vector2(width, goIds.Count * 60);

        //排版
        if (goIds.Count < 6)
        {
            goMiddle.GetComponent<ScrollRect>().verticalScrollbar = null;
            scrollBar.gameObject.SetActive(false);
        }
        else
        {
            goMiddle.GetComponent<ScrollRect>().verticalScrollbar = scrollBar;
            scrollBar.gameObject.SetActive(true);
        }

        foreach (int item in goIds)
        {
            if (step == 0) {
                foreach (FantasySpaceObjsItemInfo item2 in FantasySpaceObjsMgr.Instance.itemInfoList)
                {
                    if (item2.refObjs.Id == item)
                    {
                        //修改Text文本
                        if (String.IsNullOrEmpty(item2.refObjs.Name))
                        {
                            Debug.LogError("item2.refObjs.Name:" + item2.refObjs.Name);
                            return;
                        }
                        goListInteractiveItem[index].infoText.text = item2.refObjs.Name;
                        //更新图标icon
                        if (String.IsNullOrEmpty(item2.refObjs.IconPath))
                        {
                            Debug.LogError("item2.refObjs.Name:" + item2.refObjs.IconPath);
                            return;
                        }
                        goListInteractiveItem[index].infoIcon.sprite = Resources.Load<Sprite>(item2.refObjs.IconPath);
                        goListInteractiveItem[index].obj.SetActive(true);
                        index++;
                    }
                }//foreach_end
            }else if (step == 1)
            {
                bool isFind = false;
                //根据id集合,先遍历寻找基础选项表,再寻找自定义表
                foreach (RefInteractiveOptionsItemInfo item2 in RefInteractiveOptionsMgr.Instance.itemInfoList)
                {
                    if (item2.refObjs.Id == item)
                    {
                        //修改Text文本
                        if (String.IsNullOrEmpty(item2.refObjs.Name))
                        {
                            Debug.LogError("item2.refObjs.Name:" + item2.refObjs.Name);
                            return;
                        }
                        goListInteractiveItem[index].infoText.text = item2.refObjs.Name;
                        //更新图标icon
                        if (String.IsNullOrEmpty(item2.refObjs.IconPath))
                        {
                            Debug.LogError("item2.refObjs.Name:" + item2.refObjs.IconPath);
                            return;
                        }
                        goListInteractiveItem[index].infoIcon.sprite = Resources.Load<Sprite>(item2.refObjs.IconPath);
                        goListInteractiveItem[index].obj.SetActive(true);
                        index++;
                        isFind = true;
                        break;
                    }
                }//foreach_end
                if (!isFind)
                {
                    foreach (RefInteractiveCustomOptionsItemInfo item2 in RefInteractiveCustomOptionsMgr.Instance.itemInfoList)
                    {
                        if (item2.refObjs.Id == item)
                        {
                            //修改Text文本
                            if (String.IsNullOrEmpty(item2.refObjs.Name))
                            {
                                Debug.LogError("item2.refObjs.Name:" + item2.refObjs.Name);
                                return;
                            }
                            goListInteractiveItem[index].infoText.text = item2.refObjs.Name;
                            //更新图标icon
                            if (String.IsNullOrEmpty(item2.refObjs.IconPath))
                            {
                                Debug.LogError("item2.refObjs.Name:" + item2.refObjs.IconPath);
                                return;
                            }
                            goListInteractiveItem[index].infoIcon.sprite = Resources.Load<Sprite>(item2.refObjs.IconPath);
                            goListInteractiveItem[index].obj.SetActive(true);
                            index++;
                            break;
                        }
                    }//foreach_end
                }//if_end


            }//else_if(step==1)_end

        }//foreach_end

    }//SortAppearInteractiveUI_end


}//class_end