コード例 #1
0
        private void CacheScriptReferenceData(SerializedProperty property)
        {
            scriptReference = (ScriptReference_Base)SerializedPropertyHelper.GetTargetObjectOfProperty(property);

            requiredReferenceType = GetGenericScriptRestriction(scriptReference.GetType());

            script     = scriptReference.script;
            monoScript = null;
            if (script != null && script.SystemType != null)
            {
                typeToScript.TryGetValue(script.SystemType, out monoScript);
            }

            scriptreferenceCached = true;
        }
        private void FetchScriptReferenceData(SerializedProperty property)
        {
            scriptReference = (ScriptReference_Base)SerializedPropertyHelper.GetTargetObjectOfProperty(property);
            if (scriptReference == null)
            {
                return; //Happens when you first set an array or list's size to larger than 0.
            }
            requiredReferenceType = GetGenericScriptRestriction(scriptReference.GetType());

            script     = scriptReference.script;
            monoScript = null;
            if (script != null && script.SystemType != null)
            {
                typeToScript.TryGetValue(script.SystemType, out monoScript);
            }
        }