Giter Site home page Giter Site logo

Comments (4)

JasonXuDeveloper avatar JasonXuDeveloper commented on May 21, 2024

收到,会改JBehaviour,如果gameObject.active==false那就会等待到true,然后再进行Init

from jengine.

qn9663 avatar qn9663 commented on May 21, 2024

加油,绑定这块我认为可以再改进一下.我刚刚尝试把他改成自动绑定.大概思路是对需要绑定的gameobject后面加上@符号,然后收集,根据自定义的优先级和名字前缀取到优先的组件.根据排除表去除不用收集的组件.用来收集到AssemblyQualifiedName也就是xx.GetType().AssemblyQualifiedName;最后通过Type t = Type.GetType(field.AssemblyQualifiedName);数组和变量我项目里基本没有,所以不处理.
//判断变量的值是在热层还是引擎层
if (isHotScript)
{
string tName = varField.FieldType.Name;
var classBind = targetGo.GetComponent(); //变量指向了HotLayer中的类时,对其进行初始化

                        if (classBind)
                        {
                            classBind.Bind();
                            varField.SetValue(ilInstance, classBind.mIlInstance);
                        }

                        _class.BoundData = true;
                    }
                    else
                    {
                        //将Unity对象赋值给热层的脚本变量
                        Type t = Type.GetType(field.AssemblyQualifiedName);
                        if (t == null)
                        {
                            Debug.LogError($"gameobject : {field.gameObject} 无法找到 {hTypeFullName}变量名为:{field.fieldName}的dll路径为空");
                            continue;
                        }

                        Component component = targetGo.GetComponent(t);
                        _class.BoundData = true;
                        varField.SetValue(ilInstance, component);
                    }
                }

from jengine.

JasonXuDeveloper avatar JasonXuDeveloper commented on May 21, 2024

自动绑定的话,绑定组件没什么问题吧,对UnityComponent进行赋值,有判断类型在哪里的操作
iShot2020-11-10 17 34 26

from jengine.

JasonXuDeveloper avatar JasonXuDeveloper commented on May 21, 2024

JBehaviour生命周期的地方已经修复,等提交
iShot2020-11-10 17 37 31
ClassBind这块,没什么问题,会判断热更类和本地类

from jengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.