示例#1
0
        public static void Init(ICharacter currentCharacter)
        {
            Reset();

            isInitialized = true;

            if (currentCharacter is null)
            {
                return;
            }

            ClientCurrentCharacterHelper.Init(currentCharacter);
            InitCallback?.Invoke(currentCharacter);

            if (currentCharacter.ProtoCharacter == Api.GetProtoEntity <PlayerCharacter>() ||
                currentCharacter.ProtoCharacter == Api.GetProtoEntity <PlayerCharacterSpectator>() ||
                currentCharacter.ProtoCharacter == Api.GetProtoEntity <PlayerCharacterMob>())
            {
                InitGameplayMode(currentCharacter);
            }

            CreativeModeSystem.ClientRequestCurrentUserIsInCreativeMode();
            ServerOperatorSystem.ClientRequestCurrentUserIsOperator();

            InitEndCallback?.Invoke(currentCharacter);
        }