private static PropertyInfo GetSystemCopyBufferProperty()
 {
     if (m_systemCopyBufferProperty == null)
     {
         Type T = typeof(GUIUtility);
         m_systemCopyBufferProperty = RCall.GetPropertyInfo(T, "systemCopyBuffer", BindingFlags.Static | BindingFlags.NonPublic);
         if (m_systemCopyBufferProperty == null)
         {
             throw new Exception("Can't access internal member 'GUIUtility.systemCopyBuffer' it may have been removed / renamed");
         }
     }
     return(m_systemCopyBufferProperty);
 }
Beispiel #2
0
    private static PropertyInfo getPropertyInfo(string goName, string componentName, string propertyName)
    {
        if (propertyName == null || componentName == null)
        {
            Debug.LogWarning("Animator: Error parsing PropertyInfo or Component with null value");
            return(null);
        }
        string key = componentName + "." + propertyName;

        if (dictPropertyInfos.ContainsKey(key))
        {
            return(dictPropertyInfos[key]);
        }
        //Debug.Log(Type.GetType("UnityEngine.AudioSource"));
        //dictPropertyInfos.Add(key, Type.GetType(componentName).GetProperty(propertyName));
        dictPropertyInfos.Add(key, RCall.GetPropertyInfo(getCMP(goName, componentName).GetType(), propertyName));
        return(dictPropertyInfos[key]);
    }
Beispiel #3
0
    public override List <GameObject> updateDependencies(List <GameObject> newReferences, List <GameObject> oldReferences)
    {
        List <GameObject> lsFlagToKeep = new List <GameObject>();

        if (!obj)
        {
            return(lsFlagToKeep);
        }
        for (int i = 0; i < oldReferences.Count; i++)
        {
            if (oldReferences[i] == obj)
            {
                string    componentName = component.GetType().Name;
                Component _component    = newReferences[i].GetComponent(componentName);

                // missing component
                if (!_component)
                {
                    Debug.LogWarning("Animator: Property Track component '" + componentName + "' not found on new reference for GameObject '" + obj.name + "'. Duplicate not replaced.");
                    lsFlagToKeep.Add(oldReferences[i]);
                    return(lsFlagToKeep);
                }
                // missing property
                if (RCall.GetPropertyInfo(_component.GetType(), propertyName) == null)
                {
                    Debug.LogWarning("Animator: Property Track property '" + propertyName + "' not found on new reference for GameObject '" + obj.name + "'. Duplicate not replaced.");
                    lsFlagToKeep.Add(oldReferences[i]);
                    return(lsFlagToKeep);
                }

                obj       = newReferences[i];
                component = _component;
                break;
            }
        }
        return(lsFlagToKeep);
    }
Beispiel #4
0
    public static Rect GetMainGameViewPosition()
    {
        object gv = GetMainGameView();

        return((Rect)RCall.GetPropertyInfo(gv.GetType(), "position").GetValue(gv, null));
    }