该项目的目的是同时测试和演示来自 Unity DOTS 技术堆栈的多个新包。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

70 行
1.9 KiB

using System.Collections;
using System.Collections.Generic;
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.NetCode;
public class Player
{
public struct OwnerPlayerId : IComponentData
{
public static OwnerPlayerId Default => new OwnerPlayerId {Value = -1};
[GhostDefaultField]
public int Value;
}
public struct State : IComponentData
{
[GhostDefaultField]
public int playerId;
[GhostDefaultField]
public NativeString64 playerName;
[GhostDefaultField]
public int teamIndex;
[GhostDefaultField]
public int score;
//[ReplicatedField]
public Entity controlledEntity;
[GhostDefaultField]
public bool gameModeSystemInitialized;
// These are only sync'hed to owning client
[GhostDefaultField]
public bool displayCountDown;
[GhostDefaultField]
public int countDown;
[GhostDefaultField]
public bool displayScoreBoard;
[GhostDefaultField]
public bool displayGameScore;
[GhostDefaultField]
public bool displayGameResult;
[GhostDefaultField]
public NativeString64 gameResult;
[GhostDefaultField]
public bool displayGoal;
[GhostDefaultField(100)]
public float3 goalPosition;
[GhostDefaultField]
public uint goalDefendersColor;
[GhostDefaultField]
public uint goalAttackersColor;
[GhostDefaultField]
public uint goalAttackers;
[GhostDefaultField]
public uint goalDefenders;
[GhostDefaultField]
public NativeString64 goalString;
[GhostDefaultField]
public NativeString64 actionString;
[GhostDefaultField(100)]
public float goalCompletion;
// Non synchronized
public bool enableCharacterSwitch;
}
}