Esempio n. 1
0
    void FixedUpdate()
    {
        CQ_Content updatecontent = CQ_ObjPool.PopContent();

        updatecontent.CallType = cclass;
        updatecontent.CallThis = inst;
        if (m_fixedpdate != null)
        {
            m_fixedpdate.ComputeValue(updatecontent);
        }
        CQ_ObjPool.PushContent(updatecontent);
    }
Esempio n. 2
0
 protected override void Initialize()
 {
     BuildBlock("Awake", m_Awake);
     BuildBlock("OnEnable", m_OnEnable);
     BuildBlock("OnDisable", m_OnDisable);
     BuildBlock("Start", m_Start);
     BuildBlock("Update", m_Update);
     BuildBlock("FixedUpdate", m_FixedUpdate);
     BuildBlock("OnDestroy", m_OnDestroy);
     content = CQ_ObjPool.PopContent();        //创建上下文,并设置变量给脚本访问
     DefineAndSet("gameObject", typeof(GameObject), this.gameObject);
     DefineAndSet("transform", typeof(Transform), this.transform);
 }
Esempio n. 3
0
    protected override void Initialize()
    {
        switch (m_codeType)
        {
        case ECodeType.FileName:
            break;

        case ECodeType.TextAsset:
            CQ_Compiler.CompileOneFile(m_className, m_ta.text);
            break;

        case ECodeType.Text:
            CQ_Compiler.CompileOneFile(m_className, m_codeText);
            break;
        }

        type = CQuark.AppDomain.GetTypeByKeywordQuiet(m_className);
        if (type == null)
        {
            Debug.LogError("Type:" + m_className + "不存在与脚本项目中");
            return;
        }
        cclass  = type._class as Class_CQuark;
        content = CQ_ObjPool.PopContent();

        //TODO 最好在编译的时候就做,不要在实例化的时候做
        RegisterMember("gameObject", typeof(GameObject));
        RegisterMember("transform", typeof(Transform));

        inst = type._class.New(content, new CQuark.CQ_Value[0]).GetObject() as CQuark.CQ_ClassInstance;

        SetMember("gameObject", typeof(GameObject), this.gameObject);
        SetMember("transform", typeof(Transform), this.transform);


        if (cclass.functions.ContainsKey("Update"))
        {
            m_update = cclass.functions["Update"].expr_runtime;
        }
        if (cclass.functions.ContainsKey("FixedUpdate"))
        {
            m_fixedpdate = cclass.functions["FixedUpdate"].expr_runtime;
        }
    }
Esempio n. 4
0
    CQ_Content content;// = new CQ_Content();

    public CQuarkParagraph()
    {
        content = CQ_ObjPool.PopContent();
    }