コード例 #1
0
 private void OnUploadNewTree(ref System.Windows.Forms.Message msg)
 {
     if (this.m_behaviorTreeCollection != null)
     {
         MyBehaviorTree       outBehaviorTree = null;
         MyBehaviorDefinition definition      = null;
         if (MyBehaviorTreeCollection.LoadUploadedBehaviorTree(out definition) && this.m_behaviorTreeCollection.HasBehavior(definition.Id.SubtypeId))
         {
             this.m_botCollection.ResetBots(definition.Id.SubtypeName);
             this.m_behaviorTreeCollection.RebuildBehaviorTree(definition, out outBehaviorTree);
             this.m_botCollection.CheckCompatibilityWithBots(outBehaviorTree);
         }
         IntPtr zero = IntPtr.Zero;
         if (this.m_behaviorTreeCollection.TryGetValidToolWindow(out zero))
         {
             WinApi.PostMessage(zero, 0x404, IntPtr.Zero, IntPtr.Zero);
         }
     }
 }
コード例 #2
0
        private void OnUploadNewTree(ref Message msg)
        {
            if (m_behaviorTreeCollection != null)
            {
                MyBehaviorTree behaviorTree = null;
                MyBehaviorDefinition behaviorDefinition = null;
                bool success = MyBehaviorTreeCollection.LoadUploadedBehaviorTree(out behaviorDefinition);
                if (success && m_behaviorTreeCollection.HasBehavior(behaviorDefinition.Id.SubtypeId))
                {
                    m_botCollection.ResetBots(behaviorDefinition.Id.SubtypeName);
                    m_behaviorTreeCollection.RebuildBehaviorTree(behaviorDefinition, out behaviorTree);
                    m_botCollection.CheckCompatibilityWithBots(behaviorTree);
                }
                IntPtr toolWindowHandle = IntPtr.Zero;
#if !XB1
                if (m_behaviorTreeCollection.TryGetValidToolWindow(out toolWindowHandle))
                    WinApi.PostMessage(toolWindowHandle, MyWMCodes.BEHAVIOR_TOOL_TREE_UPLOAD_SUCCESS, IntPtr.Zero, IntPtr.Zero);
#endif // !XB1
            }
        }