Пример #1
0
        private void AddChildToParentEntriesFor([NotNull] AnimatorStateMachineScriptUsage usage)
        {
            var stateMachineAnchor = usage.Location.LocalDocumentAnchor;

            AddChildStateToParentEntries(usage, stateMachineAnchor);
            AddChildStateMachineToParentEntries(usage, stateMachineAnchor);
        }
Пример #2
0
        private void AddScriptToStateMachineUsagesFor([NotNull] AnimatorStateMachineScriptUsage usage)
        {
            var scriptToStateMachineUsages = ScriptAnchorToStateMachineUsages;

            foreach (var anchor in usage.ScriptsAnchors)
            {
                scriptToStateMachineUsages.Add(anchor, usage);
            }
        }
Пример #3
0
 private void AddChildStateToParentEntries([NotNull] AnimatorStateMachineScriptUsage usage,
                                           long stateMachineAnchor)
 {
     foreach (var childStateAnchor in usage.ChildStatesAnchors)
     {
         if (ChildToParent.ContainsKey(childStateAnchor))
         {
             continue;
         }
         ChildToParent[childStateAnchor] = stateMachineAnchor;
     }
 }
Пример #4
0
        private static IDictionary <long, AnimatorStateMachineScriptUsage> ReadStateMachineAnchorToUsageMap(
            [NotNull] UnsafeReader reader)
        {
            var count = reader.ReadInt32();
            var stateMachineAnchorToUsage = new Dictionary <long, AnimatorStateMachineScriptUsage>(count);

            for (var i = 0; i < count; i++)
            {
                var anchor = reader.ReadLong();
                var usage  = AnimatorStateMachineScriptUsage.ReadFrom(reader);
                stateMachineAnchorToUsage.Add(anchor, usage);
            }

            return(stateMachineAnchorToUsage);
        }
Пример #5
0
 private void AddStateMachineUsageInfosFor([NotNull] AnimatorStateMachineScriptUsage usage)
 {
     StateMachineAnchorToUsage[usage.Location.LocalDocumentAnchor] = usage;
     AddScriptToStateMachineUsagesFor(usage);
     AddChildToParentEntriesFor(usage);
 }