Skip to content

Commit

Permalink
修改struct的布局为自动
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiang Yin committed Dec 17, 2020
1 parent 0bf4501 commit 7ffd513
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Assets/GameMain/Scripts/Definition/DataStruct/ImpactData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
// Feedback: mailto:[email protected]
//------------------------------------------------------------

using System.Runtime.InteropServices;

namespace StarForce
{
[StructLayout(LayoutKind.Auto)]
public struct ImpactData
{
private readonly CampType m_Camp;
Expand Down
2 changes: 2 additions & 0 deletions Assets/GameMain/Scripts/Utility/AIUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityGameFramework.Runtime;

Expand Down Expand Up @@ -185,6 +186,7 @@ private static int CalcDamageHP(int attack, int defense)
return attack * attack / (attack + defense);
}

[StructLayout(LayoutKind.Auto)]
private struct CampPair
{
private readonly CampType m_First;
Expand Down

0 comments on commit 7ffd513

Please sign in to comment.