Exemplo n.º 1
0
    private void Awake()
    {
        try
        {
            if (DllManager.appdomain == null)
            {
                Debug.LogError("Please init appdomain first !");
                return;
            }

            if (GenClass == null)
            {
                GenClass = DllManager.appdomain.Instantiate <DllGenerateBase>(ScriptClassName);
            }

            if (GenClass != null)
            {
                GenClass.BaseMono = this;

                if (!bInit)
                {
                    GenClass.Init();

                    bInit = true;
                }

                GenClass.Awake();
            }
        }
        catch (Exception e)
        {
            Debug.LogError(e.ToString());
        }
    }
Exemplo n.º 2
0
    private void Awake()
    {
        try
        {
            if (DllManager.appdomain == null)
            {
                Debug.LogError("Please init appdomain first !");
                return;
            }

            var adapter = transform.GetComponent <GeneralDllBehaviorAdapter>();

            if (adapter != null)
            {
                ScriptClassName = adapter.ScriptClassName;
                OtherData       = adapter.OtherData;
                ExtralDatas     = adapter.ExtralDatas;
                ExtralDataObjs  = adapter.ExtralDataObjs;
            }

            if (GenClass == null && !string.IsNullOrEmpty(ScriptClassName))
            {
                GenClass = DllManager.appdomain.Instantiate <DllGenerateBase>(ScriptClassName);
            }

            if (GenClass != null)
            {
                GenClass.BaseMono = this;

                if (!bInit)
                {
                    GenClass.Init();

                    bInit = true;
                }

                GenClass.Awake();
            }
        }
        catch (Exception e)
        {
            Debug.LogError(e.ToString());
        }
    }