Example #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);
    }
Example #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 = new CQ_Content();        //创建上下文,并设置变量给脚本访问
     content.DefineAndSet("gameObject", typeof(GameObject), this.gameObject);
     content.DefineAndSet("transform", typeof(Transform), this.transform);
 }
Example #3
0
    protected override void Initialize()
    {
        switch (m_codeType)
        {
        case ECodeType.FileName:
            break;

        case ECodeType.TextAsset:
            AppDomain.BuildFile(m_className, m_ta.text);
            break;

        case ECodeType.Text:
            AppDomain.BuildFile(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 = new CQ_Content();

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

        inst = type._class.New(content, null).value as CQuark.CQClassInstance;

        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;
        }
        _updateContent          = new CQ_Content();
        _updateContent.CallType = cclass;
        _updateContent.CallThis = inst;
    }
Example #4
0
    public void Initialize()
    {
        m_script.Reset();
        m_script.RegTypes();
        m_script.env.RegFunction((eDelay)Wait);

        if (m_codeType != ECodeType.FunctionsText)
        {
            switch (m_codeType)
            {
            case ECodeType.FileName:
                if (!s_projectBuilded)
                {
                    Script.Instance.BuildProject(Application.streamingAssetsPath + m_folderPath, m_pattern);
                    s_projectBuilded = true;
                }
                break;

            case ECodeType.TextAsset:
                Script.Instance.BuildFile(m_className, m_ta.text);
                break;

            case ECodeType.Text:
                Script.Instance.BuildFile(m_className, m_codeText);
                break;
            }
            inst            = new ScriptInstanceHelper(m_className);
            inst.gameObject = this.gameObject;
        }
        else
        {
            BuildBlock("Start", m_Start);
            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 = m_script.env.CreateContent();             //创建上下文,并设置变量给脚本访问
            content.DefineAndSet("gameObject", typeof(GameObject), this.gameObject);
            content.DefineAndSet("transform", typeof(Transform), this.transform);
        }
    }
Example #5
0
 public void ClearValue()
 {
     content = new CQ_Content();
 }
Example #6
0
    CQ_Content content;// = new CQ_Content();

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