コード例 #1
0
ファイル: WorldDictionary.cs プロジェクト: xiebac/DebugWatch
 public WorldDictionary(IWatchContext parent, string relativePath, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(WorldDictionary)))
            )
 {
 }
コード例 #2
0
 public GameObjectComponentDictionary(IWatchContext parent, string relativePath, GameObject go, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(GameObjectContext)))
            )
 {
     GO = go;
 }
コード例 #3
0
ファイル: SceneContext.cs プロジェクト: xiebac/DebugWatch
 public GameObjectDictionary(IWatchContext parent, string relativePath, UnityEngine.SceneManagement.Scene scene, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(GameObjectDictionary)))
            )
 {
     Scene = scene;
 }
コード例 #4
0
ファイル: EntityDictionary.cs プロジェクト: xiebac/DebugWatch
 public EntityDictionary(IWatchContext parent, string relativePath, Entities.World world, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(EntityDictionary)))
            )
 {
     World = world;
 }
コード例 #5
0
 public GameObjectContext(IWatchContext parent, string relativePath, GameObject go, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(GameObjectContext)))
            )
 {
     GO = go;
     this.Variables.Add("Components", new GameObjectComponentDictionary(this, ".Components", go, ContextFieldInfo.Make("Components")));
 }
コード例 #6
0
ファイル: SceneContext.cs プロジェクト: xiebac/DebugWatch
 public SceneContext(IWatchContext parent, string relativePath, UnityEngine.SceneManagement.Scene scene, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(SceneContext)))
            )
 {
     Scene = scene;
     Variables.Add("GameObject", new GameObjectDictionary(this, ParserUtils.MakePathRelative("GameObject"), Scene, ContextFieldInfo.Make("GameObject")));
 }
コード例 #7
0
ファイル: EntityDictionary.cs プロジェクト: xiebac/DebugWatch
 public EntityContext(IWatchContext parent, string relativePath, Entity entity, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(WorldContext)))
            )
 {
     this.entity = entity;
     //Variables.Add("Components", new EntityDictionary(this, ".Entity", World, ContextFieldInfo.Make("Entity")));
 }
コード例 #8
0
 // propPath
 public PropertyPathContext(IWatchContext parent, IWatchContext rootPathContext, string relativePath, TContainer container, PropertyPath propPath, ContextFieldInfo fieldInfo)
     : base(parent
            , relativePath
            , new ContextMemberInfo(fieldInfo, ContextTypeInfo.Make(typeof(TPropertyType)))
            )
 {
     Container       = container;
     PropPath        = propPath;
     RootPathContext = rootPathContext;
 }
コード例 #9
0
ファイル: PropertyUtils.cs プロジェクト: xiebac/DebugWatch
 VisitStatus IPropertyVisitor.VisitProperty <TProperty2, TContainer2, TValue2>(TProperty2 property, ref TContainer2 container, ref ChangeTracker changeTracker)
 {
     if (Result)
     {
         var info = new ContextMemberInfo(
             ContextFieldInfo.Make(property.GetName()),
             ContextTypeInfo.MakeProperty(property)
             );
         Result = Visitor(info);
     }
     return(VisitStatus.Handled);
 }
コード例 #10
0
        public override bool VisitAllMembers(Func <ContextMemberInfo, bool> visitor)
        {
            var comps = GO.GetComponents <Component>();

            for (int i = 0; i != comps.Length; ++i)
            {
                var info = new ContextMemberInfo(
                    ContextFieldInfo.MakeOperator($"[{i}]"),
                    ContextTypeInfo.Make(comps[i].GetType())
                    );
                if (!visitor(info))
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #11
0
 protected ContextMemberInfo MakeMemberInfo <TMemberType>(string index)
 {
     return(new ContextMemberInfo(ContextFieldInfo.MakeOperator($"[{index}]"), ContextTypeInfo.Make(typeof(TMemberType))));
 }
コード例 #12
0
ファイル: EntityDictionary.cs プロジェクト: xiebac/DebugWatch
 public override bool VisitAllMembers(Func <ContextMemberInfo, bool> visitor)
 {
     foreach (var e in World.EntityManager.GetAllEntities())
     {
         var info = new ContextMemberInfo(ContextFieldInfo.MakeOperator($"[{e.Index}]"), ContextTypeInfo.Make(typeof(PropertyPathContext <EntityContainer, EntityContainer>)));
         if (!visitor(info))
         {
             return(false);
         }
     }
     return(true);
 }