Beispiel #1
0
    // Require vars and full deserialize.
    // Will eventually call GetComponent via RefreshAll, so can't be called during OnAfterDeserialize
    // Triggered by Awake, also by FullInit in ArcadiaBehaviour
    public void Initialize()
    {
        if (fullyInitialized)
        {
            return;
        }

        // TODO: cache component access
        PlayModeInitialization.Initialize1();
        InitializeOwnVars();
        DeserializeState();
        DeserializeConversions();
        fullyInitialized = true;
    }
Beispiel #2
0
    public void RealizeVars()
    {
        if (varsRealized)
        {
            return;
        }
        // keyNames won't be there yet for fresh object
        // TODO: might want to clear them out after realizing vars

        PlayModeInitialization.Initialize1();

        if (keyNames != null)
        {
            ifnInfos = new IFnInfo[keyNames.Length];

            // create vars
            for (int i = 0; i < keyNames.Length; i++)
            {
                var     kn   = keyNames[i];
                var     vn   = varNames[i];
                Keyword k    = Keyword.intern(kn);
                Symbol  vsym = Symbol.intern(vn);
                Var     v    = RT.var(vsym.Namespace, vsym.Name);
                ifnInfos[i] = new IFnInfo(k, v);
            }

            varsRealized = true;

            // require namespaces for vars in a second pass
            for (int i = 0; i < ifnInfos.Length; i++)
            {
                Var v = (Var)ifnInfos[i].fn;
                Arcadia.Util.require(v.Namespace.getName());
            }

            return;
        }
        varsRealized = true;
    }