Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
jyb-games
Commits
1c847220
Commit
1c847220
authored
Jun 28, 2021
by
jang dong hyeok
Browse files
.
parent
076f0c68
Changes
638
Show whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
638 of 638+
files are displayed.
Plain diff
Email patch
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/Assets/Styles/TabView.uss
0 → 100644
View file @
1c847220
.flex-container {
display: flex;
flex-direction: row;
}
Button {
padding-bottom: 2px;
margin-bottom: 0px;
border-width: 0px;
}
\ No newline at end of file
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/Assets/Styles/TeamEditionConfigurationWindow.uss
0 → 100644
View file @
1c847220
#configurationServerInfoSection {
margin-bottom: 40px;
}
#spinnerLabel {
margin-left: 2px;
}
#connectedLabel {
-unity-text-align: middle-right;
}
#credentialsOk {
-unity-text-align: middle-right;
}
#plasticConfigurationTitle {
font-size: 18px;
margin-bottom: 10px;
}
.container {
padding: 10px;
border-bottom-width: 1px;
border-bottom-color: #999999;
}
.container.last {
border-bottom-width: 0px;
}
.credentials {
width: 265px;
}
.display-none {
display: none;
}
.flex-container {
display: flex;
flex-direction: row;
}
.grow {
flex-grow: 1;
}
.sub-section {
margin-left: 10px;
}
.visibility-hidden {
visibility: hidden;
}
.error {
color: #FF0000;
}
Label {
white-space: normal;
}
TextField {
margin-left: 0px;
margin-top: 3px;
margin-right: 10px;
margin-bottom: 3px;
}
Toggle {
margin-left: 0px;
}
\ No newline at end of file
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/Assets/Styles/WaitingSignInPanel.uss
0 → 100644
View file @
1c847220
.wait {
margin-top: 20px;
}
.wait-text {
flex-grow: 1;
-unity-text-align: middle-left;
}
Button {
width: 70px;
height: 40px;
}
\ No newline at end of file
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/AssetsUtils/AssetsPath.cs
0 → 100644
View file @
1c847220
using
System.IO
;
using
System.Reflection
;
using
UnityEditor
;
using
UnityEngine
;
using
Codice.Client.Common
;
using
Codice.Utils
;
using
PlasticGui
;
namespace
Unity.PlasticSCM.Editor.AssetUtils
{
internal
static
class
AssetsPath
{
internal
static
string
GetLayoutsFolderRelativePath
()
{
return
string
.
Concat
(
mAssetsFolderLocation
,
"/Layouts"
);
}
internal
static
string
GetStylesFolderRelativePath
()
{
return
string
.
Concat
(
mAssetsFolderLocation
,
"/Styles"
);
}
internal
static
string
GetImagesFolderRelativePath
()
{
return
string
.
Concat
(
mAssetsFolderLocation
,
"/Images"
);
}
internal
static
string
GetRelativePath
(
string
fullPath
)
{
return
PathHelper
.
GetRelativePath
(
mProjectFullPath
,
fullPath
).
Substring
(
1
);
}
internal
static
string
GetFullPath
(
Object
obj
)
{
string
relativePath
=
AssetDatabase
.
GetAssetPath
(
obj
);
if
(
string
.
IsNullOrEmpty
(
relativePath
))
return
null
;
return
Path
.
GetFullPath
(
relativePath
);
}
static
AssetsPath
()
{
mAssetsFolderLocation
=
(
IsRunningAsUPMPackage
())
?
"Packages/com.unity.collab-proxy/Editor/PlasticSCM/Assets"
:
"Assets/Plugins/PlasticSCM/Editor/Assets"
;
}
static
bool
IsRunningAsUPMPackage
()
{
string
unityPlasticDllPath
=
Path
.
GetFullPath
(
AssemblyLocation
.
GetAssemblyDirectory
(
Assembly
.
GetAssembly
(
typeof
(
PlasticLocalization
))));
return
Directory
.
Exists
(
Path
.
GetFullPath
(
Path
.
Combine
(
unityPlasticDllPath
,
// assets relative path when running as a UPM package
"../../../Editor/PlasticSCM/Assets"
)));
}
static
string
mProjectFullPath
=
ProjectPath
.
FromApplicationDataPath
(
Application
.
dataPath
);
static
string
mAssetsFolderLocation
;
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/AssetsUtils/LoadAsset.cs
0 → 100644
View file @
1c847220
using
System
;
using
System.IO
;
using
UnityEditor
;
using
Codice.Client.BaseCommands
;
namespace
Unity.PlasticSCM.Editor.AssetUtils
{
internal
static
class
LoadAsset
{
internal
static
UnityEngine
.
Object
FromChangeInfo
(
ChangeInfo
changeInfo
)
{
string
changeFullPath
=
changeInfo
.
GetFullPath
();
if
(
MetaPath
.
IsMetaPath
(
changeFullPath
))
changeFullPath
=
MetaPath
.
GetPathFromMetaPath
(
changeFullPath
);
return
FromFullPath
(
changeFullPath
);
}
static
UnityEngine
.
Object
FromFullPath
(
string
fullPath
)
{
if
(!
IsPathUnderProject
(
fullPath
))
return
null
;
return
AssetDatabase
.
LoadMainAssetAtPath
(
AssetsPath
.
GetRelativePath
(
fullPath
));
}
static
bool
IsPathUnderProject
(
string
path
)
{
if
(
string
.
IsNullOrEmpty
(
path
))
return
false
;
var
fullPath
=
Path
.
GetFullPath
(
path
).
Replace
(
'\\'
,
'/'
);
return
fullPath
.
StartsWith
(
mProjectRelativePath
,
StringComparison
.
OrdinalIgnoreCase
);
}
static
string
mProjectRelativePath
=
Directory
.
GetCurrentDirectory
().
Replace
(
'\\'
,
'/'
)
+
'/'
;
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/AssetsUtils/Processor/AssetModificationProcessor.cs
0 → 100644
View file @
1c847220
using
System.IO
;
using
Unity.PlasticSCM.Editor.AssetsOverlays
;
using
Unity.PlasticSCM.Editor.AssetsOverlays.Cache
;
namespace
Unity.PlasticSCM.Editor.AssetUtils.Processor
{
class
AssetModificationProcessor
:
UnityEditor
.
AssetModificationProcessor
{
internal
static
bool
IsEnabled
{
get
;
set
;
}
internal
static
void
RegisterAssetStatusCache
(
IAssetStatusCache
assetStatusCache
)
{
mAssetStatusCache
=
assetStatusCache
;
}
static
string
[]
OnWillSaveAssets
(
string
[]
paths
)
{
if
(!
IsEnabled
)
return
paths
;
PlasticAssetsProcessor
.
CheckoutOnSourceControl
(
paths
);
return
paths
;
}
static
bool
IsOpenForEdit
(
string
assetPath
,
out
string
message
)
{
message
=
string
.
Empty
;
if
(!
IsEnabled
)
return
true
;
if
(
assetPath
.
StartsWith
(
"ProjectSettings/"
))
return
true
;
if
(
MetaPath
.
IsMetaPath
(
assetPath
))
assetPath
=
MetaPath
.
GetPathFromMetaPath
(
assetPath
);
AssetStatus
status
=
mAssetStatusCache
.
GetStatusForPath
(
Path
.
GetFullPath
(
assetPath
));
if
(
ClassifyAssetStatus
.
IsAdded
(
status
)
||
ClassifyAssetStatus
.
IsCheckedOut
(
status
))
return
true
;
return
!
ClassifyAssetStatus
.
IsControlled
(
status
);
}
static
IAssetStatusCache
mAssetStatusCache
;
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/AssetsUtils/Processor/AssetPostprocessor.cs
0 → 100644
View file @
1c847220
namespace
Unity.PlasticSCM.Editor.AssetUtils.Processor
{
class
AssetPostprocessor
:
UnityEditor
.
AssetPostprocessor
{
internal
static
bool
IsEnabled
{
get
;
set
;
}
static
void
OnPostprocessAllAssets
(
string
[]
importedAssets
,
string
[]
deletedAssets
,
string
[]
movedAssets
,
string
[]
movedFromAssetPaths
)
{
if
(!
IsEnabled
)
return
;
for
(
int
i
=
0
;
i
<
movedAssets
.
Length
;
i
++)
{
PlasticAssetsProcessor
.
MoveOnSourceControl
(
movedFromAssetPaths
[
i
],
movedAssets
[
i
]);
}
foreach
(
string
deletedAsset
in
deletedAssets
)
{
PlasticAssetsProcessor
.
DeleteFromSourceControl
(
deletedAsset
);
}
PlasticAssetsProcessor
.
AddToSourceControl
(
importedAssets
);
}
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/AssetsUtils/Processor/AssetsProcessor.cs
0 → 100644
View file @
1c847220
using
PlasticGui
;
using
Unity.PlasticSCM.Editor.AssetsOverlays.Cache
;
namespace
Unity.PlasticSCM.Editor.AssetUtils.Processor
{
internal
static
class
AssetsProcessors
{
internal
static
void
Enable
(
IPlasticAPI
plasticApi
,
IAssetStatusCache
assetStatusCache
)
{
PlasticAssetsProcessor
.
RegisterPlasticAPI
(
plasticApi
);
AssetModificationProcessor
.
RegisterAssetStatusCache
(
assetStatusCache
);
AssetPostprocessor
.
IsEnabled
=
true
;
AssetModificationProcessor
.
IsEnabled
=
true
;
}
internal
static
void
Disable
()
{
AssetPostprocessor
.
IsEnabled
=
false
;
AssetModificationProcessor
.
IsEnabled
=
false
;
}
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/AssetsUtils/Processor/PlasticAssetsProcessor.cs
0 → 100644
View file @
1c847220
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.IO
;
using
Codice.Client.BaseCommands
;
using
Codice.Client.BaseCommands.Config
;
using
Codice.Client.Commands
;
using
Codice.Client.Commands.WkTree
;
using
Codice.LogWrapper
;
using
PlasticGui
;
using
Unity.PlasticSCM.Editor.UI
;
using
Unity.PlasticSCM.Editor.Views.IncomingChanges
;
using
Unity.PlasticSCM.Editor.Views.PendingChanges
;
namespace
Unity.PlasticSCM.Editor.AssetUtils.Processor
{
internal
class
PlasticAssetsProcessor
{
internal
static
void
RegisterPlasticAPI
(
IPlasticAPI
plasticAPI
)
{
mPlasticAPI
=
plasticAPI
;
}
internal
static
void
RegisterPendingChangesView
(
PendingChangesTab
pendingChangesTab
)
{
mPendingChangesTab
=
pendingChangesTab
;
}
internal
static
void
RegisterIncomingChangesView
(
IIncomingChangesTab
incomingChangesTab
)
{
mIncomingChangesTab
=
incomingChangesTab
;
}
internal
static
void
UnRegisterViews
()
{
mPendingChangesTab
=
null
;
mIncomingChangesTab
=
null
;
}
internal
static
void
AddToSourceControl
(
string
[]
paths
)
{
foreach
(
string
path
in
paths
)
mLog
.
DebugFormat
(
"AddToSourceControl: {0}"
,
path
);
try
{
AddIfNotControlled
(
paths
,
mPlasticAPI
);
}
catch
(
Exception
ex
)
{
LogAddException
(
ex
);
}
finally
{
mCooldownAutorefreshAction
.
Ping
();
}
}
internal
static
void
DeleteFromSourceControl
(
string
path
)
{
mLog
.
DebugFormat
(
"DeleteFromSourceControl: {0}"
,
path
);
try
{
string
fullPath
=
Path
.
GetFullPath
(
path
);
DeleteIfControlled
(
fullPath
,
mPlasticAPI
);
DeleteIfControlled
(
MetaPath
.
GetMetaPath
(
fullPath
),
mPlasticAPI
);
}
catch
(
Exception
ex
)
{
LogDeleteException
(
path
,
ex
);
}
finally
{
mCooldownAutorefreshAction
.
Ping
();
}
}
internal
static
void
MoveOnSourceControl
(
string
srcPath
,
string
dstPath
)
{
mLog
.
DebugFormat
(
"MoveOnSourceControl: {0} to {1}"
,
srcPath
,
dstPath
);
try
{
string
srcFullPath
=
Path
.
GetFullPath
(
srcPath
);
string
dstFullPath
=
Path
.
GetFullPath
(
dstPath
);
MoveIfControlled
(
srcFullPath
,
dstFullPath
,
mPlasticAPI
);
MoveIfControlled
(
MetaPath
.
GetMetaPath
(
srcFullPath
),
MetaPath
.
GetMetaPath
(
dstFullPath
),
mPlasticAPI
);
}
catch
(
Exception
ex
)
{
LogMoveException
(
srcPath
,
dstPath
,
ex
);
}
finally
{
mCooldownAutorefreshAction
.
Ping
();
}
}
internal
static
void
CheckoutOnSourceControl
(
string
[]
paths
)
{
foreach
(
string
path
in
paths
)
mLog
.
DebugFormat
(
"CheckoutOnSourceControl: {0}"
,
path
);
try
{
CheckoutIfControlledAndChanged
(
paths
,
mPlasticAPI
);
}
catch
(
Exception
ex
)
{
LogCheckoutException
(
ex
);
}
finally
{
mCooldownAutorefreshAction
.
Ping
();
}
}
static
void
AddIfNotControlled
(
string
[]
paths
,
IPlasticAPI
api
)
{
List
<
string
>
fullPaths
=
new
List
<
string
>();
IgnoredFilesFilter
ignoredFilter
=
new
IgnoredFilesFilter
(
GlobalConfig
.
Instance
);
foreach
(
string
path
in
paths
)
{
string
fullPath
=
Path
.
GetFullPath
(
path
);
string
fullPathMeta
=
MetaPath
.
GetMetaPath
(
fullPath
);
if
(
api
.
GetWorkspaceFromPath
(
fullPath
)
==
null
)
return
;
if
(
api
.
GetWorkspaceTreeNode
(
fullPath
)
==
null
&&
!
ignoredFilter
.
IsIgnored
(
fullPath
))
fullPaths
.
Add
(
fullPath
);
if
(
File
.
Exists
(
fullPathMeta
)
&&
api
.
GetWorkspaceTreeNode
(
fullPathMeta
)
==
null
&&
!
ignoredFilter
.
IsIgnored
(
fullPath
))
fullPaths
.
Add
(
fullPathMeta
);
}
if
(
fullPaths
.
Count
==
0
)
return
;
IList
checkouts
;
api
.
Add
(
fullPaths
.
ToArray
(),
GetDefaultAddOptions
(),
out
checkouts
);
}
static
void
DeleteIfControlled
(
string
fullPath
,
IPlasticAPI
api
)
{
if
(
api
.
GetWorkspaceTreeNode
(
fullPath
)
==
null
)
return
;
api
.
DeleteControlled
(
fullPath
,
DeleteModifiers
.
None
);
}
static
void
MoveIfControlled
(
string
srcFullPath
,
string
dstFullPath
,
IPlasticAPI
api
)
{
if
(
api
.
GetWorkspaceTreeNode
(
srcFullPath
)
==
null
)
return
;
api
.
Move
(
srcFullPath
,
dstFullPath
,
MoveModifiers
.
None
);
}
static
void
CheckoutIfControlledAndChanged
(
string
[]
paths
,
IPlasticAPI
api
)
{
List
<
string
>
fullPaths
=
new
List
<
string
>();
foreach
(
string
path
in
paths
)
{
string
fullPath
=
Path
.
GetFullPath
(
path
);
string
fullPathMeta
=
MetaPath
.
GetMetaPath
(
fullPath
);
WorkspaceTreeNode
node
=
api
.
GetWorkspaceTreeNode
(
fullPath
);
WorkspaceTreeNode
nodeMeta
=
api
.
GetWorkspaceTreeNode
(
fullPathMeta
);
if
(
node
!=
null
&&
ChangedFileChecker
.
IsChanged
(
node
.
LocalInfo
,
fullPath
,
false
))
fullPaths
.
Add
(
fullPath
);
if
(
nodeMeta
!=
null
&&
ChangedFileChecker
.
IsChanged
(
nodeMeta
.
LocalInfo
,
fullPathMeta
,
false
))
fullPaths
.
Add
(
fullPathMeta
);
}
if
(
fullPaths
.
Count
==
0
)
return
;
api
.
Checkout
(
fullPaths
.
ToArray
(),
CheckoutModifiers
.
None
);
}
static
void
PerformAutoRefresh
()
{
AutoRefresh
.
PendingChangesView
(
mPendingChangesTab
);
AutoRefresh
.
IncomingChangesView
(
mIncomingChangesTab
);
}
static
void
LogAddException
(
Exception
ex
)
{
UnityEngine
.
Debug
.
LogWarning
(
string
.
Format
(
PlasticLocalization
.
GetString
(
PlasticLocalization
.
Name
.
CannotAddVersionControl
),
ex
.
Message
));
LogException
(
ex
);
}
static
void
LogDeleteException
(
string
path
,
Exception
ex
)
{
UnityEngine
.
Debug
.
LogWarning
(
string
.
Format
(
PlasticLocalization
.
GetString
(
PlasticLocalization
.
Name
.
CannotDeleteVersionControl
),
path
,
ex
.
Message
));
LogException
(
ex
);
}
static
void
LogMoveException
(
string
srcPath
,
string
dstPath
,
Exception
ex
)
{
UnityEngine
.
Debug
.
LogWarning
(
string
.
Format
(
PlasticLocalization
.
GetString
(
PlasticLocalization
.
Name
.
CannotMoveVersionControl
),
srcPath
,
dstPath
,
ex
.
Message
));
LogException
(
ex
);
}
static
void
LogCheckoutException
(
Exception
ex
)
{
UnityEngine
.
Debug
.
LogWarning
(
string
.
Format
(
PlasticLocalization
.
GetString
(
PlasticLocalization
.
Name
.
CannotCheckoutVersionControl
),
ex
.
Message
));
LogException
(
ex
);
}
static
void
LogException
(
Exception
ex
)
{
mLog
.
WarnFormat
(
"Message: {0}"
,
ex
.
Message
);
mLog
.
DebugFormat
(
"StackTrace:{0}{1}"
,
Environment
.
NewLine
,
ex
.
StackTrace
);
}
static
AddOptions
GetDefaultAddOptions
()
{
AddOptions
options
=
new
AddOptions
();
options
.
AddPrivateParents
=
true
;
options
.
NeedCheckPlatformPath
=
true
;
return
options
;
}
static
volatile
IPlasticAPI
mPlasticAPI
;
static
PendingChangesTab
mPendingChangesTab
;
static
IIncomingChangesTab
mIncomingChangesTab
;
static
CooldownWindowDelayer
mCooldownAutorefreshAction
=
new
CooldownWindowDelayer
(
PerformAutoRefresh
,
UnityConstants
.
AUTO_REFRESH_DELAYED_INTERVAL
);
static
readonly
ILog
mLog
=
LogManager
.
GetLogger
(
"PlasticAssetsProcessor"
);
}
}
\ No newline at end of file
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/AssetsUtils/ProjectPath.cs
0 → 100644
View file @
1c847220
using
System.IO
;
namespace
Unity.PlasticSCM.Editor.AssetUtils
{
internal
static
class
ProjectPath
{
internal
static
string
FromApplicationDataPath
(
string
dataPath
)
{
return
Path
.
GetDirectoryName
(
Path
.
GetFullPath
(
dataPath
));
}
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/AssetsUtils/RefreshAsset.cs
0 → 100644
View file @
1c847220
using
UnityEditor
;
using
UnityEngine
;
namespace
Unity.PlasticSCM.Editor.AssetUtils
{
internal
static
class
RefreshAsset
{
internal
static
void
UnityAssetDatabase
()
{
AssetDatabase
.
Refresh
(
ImportAssetOptions
.
Default
);
VersionControlCache
();
}
internal
static
void
VersionControlCache
()
{
UnityEditor
.
VersionControl
.
Provider
.
ClearCache
();
RepaintInspectors
();
}
internal
static
void
RepaintInspectors
()
{
UnityEditor
.
Editor
[]
editors
=
Resources
.
FindObjectsOfTypeAll
<
UnityEditor
.
Editor
>();
foreach
(
UnityEditor
.
Editor
editor
in
editors
)
editor
.
Repaint
();
}
}
}
\ No newline at end of file
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/AssetsUtils/SaveAssets.cs
0 → 100644
View file @
1c847220
using
System.IO
;
using
System.Collections.Generic
;
using
UnityEditor
;
using
UnityEditor.SceneManagement
;
using
UnityEngine.SceneManagement
;
using
Codice.Client.BaseCommands
;
using
Codice.Client.Common
;
namespace
Unity.PlasticSCM.Editor.AssetUtils
{
internal
static
class
SaveAssets
{
internal
static
void
ForChangesWithConfirmation
(
List
<
ChangeInfo
>
changes
,
out
bool
isCancelled
)
{
ForPaths
(
GetPaths
(
changes
),
true
,
out
isCancelled
);
}
internal
static
void
ForPathsWithConfirmation
(
List
<
string
>
paths
,
out
bool
isCancelled
)
{
ForPaths
(
paths
,
true
,
out
isCancelled
);
}
internal
static
void
ForChangesWithoutConfirmation
(
List
<
ChangeInfo
>
changes
)
{
bool
isCancelled
;
ForPaths
(
GetPaths
(
changes
),
false
,
out
isCancelled
);
}
internal
static
void
ForPathsWithoutConfirmation
(
List
<
string
>
paths
)
{
bool
isCancelled
;
ForPaths
(
paths
,
false
,
out
isCancelled
);
}
static
void
ForPaths
(
List
<
string
>
paths
,
bool
askForUserConfirmation
,
out
bool
isCancelled
)
{
SaveDirtyScenes
(
paths
,
askForUserConfirmation
,
out
isCancelled
);
if
(
isCancelled
)
return
;
AssetDatabase
.
SaveAssets
();
}
static
void
SaveDirtyScenes
(
List
<
string
>
paths
,
bool
askForUserConfirmation
,
out
bool
isCancelled
)
{
isCancelled
=
false
;
List
<
Scene
>
scenesToSave
=
new
List
<
Scene
>();
foreach
(
Scene
dirtyScene
in
GetDirtyScenes
())
{
if
(
Contains
(
paths
,
dirtyScene
))
scenesToSave
.
Add
(
dirtyScene
);
}
if
(
scenesToSave
.
Count
==
0
)
return
;
if
(
askForUserConfirmation
)
{
isCancelled
=
!
EditorSceneManager
.
SaveModifiedScenesIfUserWantsTo
(
scenesToSave
.
ToArray
());
return
;
}
EditorSceneManager
.
SaveScenes
(
scenesToSave
.
ToArray
());
}
static
List
<
Scene
>
GetDirtyScenes
()
{
List
<
Scene
>
dirtyScenes
=
new
List
<
Scene
>();
for
(
int
i
=
0
;
i
<
SceneManager
.
sceneCount
;
i
++)
{
Scene
scene
=
SceneManager
.
GetSceneAt
(
i
);
if
(!
scene
.
isDirty
)
continue
;
dirtyScenes
.
Add
(
scene
);
}
return
dirtyScenes
;
}
static
bool
Contains
(
List
<
string
>
paths
,
Scene
scene
)
{
foreach
(
string
path
in
paths
)
{
if
(
PathHelper
.
IsSamePath
(
path
,
Path
.
GetFullPath
(
scene
.
path
)))
return
true
;
}
return
false
;
}
static
List
<
string
>
GetPaths
(
List
<
ChangeInfo
>
changeInfos
)
{
List
<
string
>
result
=
new
List
<
string
>();
foreach
(
ChangeInfo
change
in
changeInfos
)
result
.
Add
(
change
.
GetFullPath
());
return
result
;
}
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/AutoRefresh.cs
0 → 100644
View file @
1c847220
using
Unity.PlasticSCM.Editor.Views.IncomingChanges
;
using
Unity.PlasticSCM.Editor.Views.PendingChanges
;
namespace
Unity.PlasticSCM.Editor
{
internal
static
class
AutoRefresh
{
internal
static
void
PendingChangesView
(
PendingChangesTab
pendingChangesTab
)
{
if
(
pendingChangesTab
==
null
)
return
;
pendingChangesTab
.
AutoRefresh
();
}
internal
static
void
IncomingChangesView
(
IIncomingChangesTab
incomingChangesTab
)
{
if
(
incomingChangesTab
==
null
)
return
;
if
(!
incomingChangesTab
.
IsVisible
)
return
;
incomingChangesTab
.
AutoRefresh
();
}
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/Beta/CalculateUserBetaProgramSetting.cs
0 → 100644
View file @
1c847220
using
System
;
using
UnityEditor
;
using
Codice.Client.Common.Threading
;
using
Codice.Client.Common.WebApi
;
using
Codice.LogWrapper
;
using
Unity.PlasticSCM.Editor.WebApi
;
namespace
Unity.PlasticSCM.Editor.Beta
{
[
InitializeOnLoad
]
internal
static
class
CalculateUserBetaProgramSetting
{
static
CalculateUserBetaProgramSetting
()
{
EditorApplication
.
update
+=
RunOnceWhenAccessTokenIsInitialized
;
}
static
void
RunOnceWhenAccessTokenIsInitialized
()
{
if
(
string
.
IsNullOrEmpty
(
CloudProjectSettings
.
accessToken
))
return
;
EditorApplication
.
update
-=
RunOnceWhenAccessTokenIsInitialized
;
if
(
CollabPlugin
.
IsEnabled
())
return
;
Execute
(
CloudProjectSettings
.
accessToken
);
}
static
void
Execute
(
string
unityAccessToken
)
{
if
(
SessionState
.
GetBool
(
IS_USER_BETA_PROGRAM_ALREADY_CALCULATED_KEY
,
false
))
{
return
;
}
SessionState
.
SetBool
(
IS_USER_BETA_PROGRAM_ALREADY_CALCULATED_KEY
,
true
);
PlasticApp
.
InitializeIfNeeded
();
EnableUserBetaProgramIfNeeded
(
unityAccessToken
);
}
static
void
EnableUserBetaProgramIfNeeded
(
string
unityAccessToken
)
{
int
ini
=
Environment
.
TickCount
;
UnityPackageBetaEnrollResponse
response
=
null
;
IThreadWaiter
waiter
=
ThreadWaiter
.
GetWaiter
(
10
);
waiter
.
Execute
(
/*threadOperationDelegate*/
delegate
{
response
=
PlasticScmRestApiClient
.
IsBetaEnabled
(
unityAccessToken
);
},
/*afterOperationDelegate*/
delegate
{
mLog
.
DebugFormat
(
"IsBetaEnabled time {0} ms"
,
Environment
.
TickCount
-
ini
);
if
(
waiter
.
Exception
!=
null
)
{
ExceptionsHandler
.
LogException
(
"CalculateUserBetaProgramSetting"
,
waiter
.
Exception
);
return
;
}
if
(
response
==
null
)
return
;
if
(
response
.
Error
!=
null
)
{
mLog
.
ErrorFormat
(
"Unable to retrieve is beta enabled: {0} [code {1}]"
,
response
.
Error
.
Message
,
response
.
Error
.
ErrorCode
);
return
;
}
if
(!
response
.
IsBetaEnabled
)
{
mLog
.
InfoFormat
(
"Beta is disabled for accessToken: {0}"
,
unityAccessToken
);
return
;
}
PlasticMenuItem
.
Add
();
});
}
const
string
IS_USER_BETA_PROGRAM_ALREADY_CALCULATED_KEY
=
"PlasticSCM.UserBetaProgram.IsAlreadyCalculated"
;
static
readonly
ILog
mLog
=
LogManager
.
GetLogger
(
"CalculateUserBetaProgramSetting"
);
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/CheckWorkspaceTreeNodeStatus.cs
0 → 100644
View file @
1c847220
using
Codice.Client.Commands.WkTree
;
using
Codice.CM.Common
;
namespace
Codice
{
internal
static
class
CheckWorkspaceTreeNodeStatus
{
internal
static
bool
IsPrivate
(
WorkspaceTreeNode
node
)
{
return
node
==
null
;
}
internal
static
bool
IsCheckedOut
(
WorkspaceTreeNode
node
)
{
if
(
node
==
null
)
return
false
;
return
node
.
RevInfo
.
CheckedOut
;
}
internal
static
bool
IsAdded
(
WorkspaceTreeNode
node
)
{
if
(
node
==
null
)
return
false
;
return
node
.
RevInfo
.
CheckedOut
&&
node
.
RevInfo
.
ParentId
==
-
1
;
}
internal
static
bool
IsDirectory
(
WorkspaceTreeNode
node
)
{
return
node
.
RevInfo
.
Type
==
EnumRevisionType
.
enDirectory
;
}
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/CloudProjectDownloader/AutoConfigClientConf.cs
0 → 100644
View file @
1c847220
using
Codice.Client.Common
;
using
Codice.Client.Common.WebApi
;
using
Codice.CM.Common
;
using
PlasticGui
;
using
Unity.PlasticSCM.Editor.WebApi
;
namespace
Unity.PlasticSCM.Editor.ProjectDownloader
{
internal
static
class
AutoConfigClientConf
{
internal
static
void
FromUnityAccessToken
(
string
unityAccessToken
,
RepositorySpec
repSpec
,
string
projectPath
)
{
CredentialsResponse
response
=
PlasticScmRestApiClient
.
GetCredentials
(
unityAccessToken
);
if
(
response
.
Error
!=
null
)
{
UnityEngine
.
Debug
.
LogErrorFormat
(
PlasticLocalization
.
GetString
(
PlasticLocalization
.
Name
.
ErrorGettingCredentialsCloudProject
),
response
.
Error
.
Message
,
response
.
Error
.
ErrorCode
);
return
;
}
ClientConfigData
configData
=
BuildClientConfigData
(
repSpec
,
projectPath
,
response
);
ClientConfig
.
Get
().
Save
(
configData
);
}
static
ClientConfigData
BuildClientConfigData
(
RepositorySpec
repSpec
,
string
projectPath
,
CredentialsResponse
response
)
{
SEIDWorkingMode
workingMode
=
SEIDWorkingMode
.
LDAPWorkingMode
;
ClientConfigData
configData
=
new
ClientConfigData
();
configData
.
WorkspaceServer
=
repSpec
.
Server
;
configData
.
CurrentWorkspace
=
projectPath
;
configData
.
WorkingMode
=
workingMode
.
ToString
();
configData
.
SecurityConfig
=
UserInfo
.
GetSecurityConfigStr
(
workingMode
,
response
.
Email
,
GetPassword
(
response
.
Token
,
response
.
Type
));
return
configData
;
}
static
string
GetPassword
(
string
token
,
CredentialsResponse
.
TokenType
tokenType
)
{
if
(
tokenType
==
CredentialsResponse
.
TokenType
.
Bearer
)
return
BEARER_PREFIX
+
token
;
return
token
;
}
const
string
BEARER_PREFIX
=
"Bearer "
;
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/CloudProjectDownloader/CloudProjectDownloader.cs
0 → 100644
View file @
1c847220
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
UnityEditor
;
using
UnityEngine
;
using
Codice.LogWrapper
;
namespace
Unity.PlasticSCM.Editor.ProjectDownloader
{
[
InitializeOnLoad
]
internal
static
class
CloudProjectDownloader
{
static
CloudProjectDownloader
()
{
EditorApplication
.
update
+=
RunOnceWhenAccessTokenIsInitialized
;
}
static
void
RunOnceWhenAccessTokenIsInitialized
()
{
if
(
string
.
IsNullOrEmpty
(
CloudProjectSettings
.
accessToken
))
return
;
EditorApplication
.
update
-=
RunOnceWhenAccessTokenIsInitialized
;
Execute
(
CloudProjectSettings
.
accessToken
);
}
static
void
Execute
(
string
unityAccessToken
)
{
if
(
SessionState
.
GetBool
(
IS_PROJECT_DOWNLOADER_ALREADY_EXECUTED_KEY
,
false
))
{
return
;
}
SessionState
.
SetBool
(
IS_PROJECT_DOWNLOADER_ALREADY_EXECUTED_KEY
,
true
);
DownloadRepository
(
unityAccessToken
);
}
static
void
DownloadRepository
(
string
unityAccessToken
)
{
Dictionary
<
string
,
string
>
args
=
CommandLineArguments
.
Build
(
Environment
.
GetCommandLineArgs
());
mLog
.
DebugFormat
(
"Processing Unity arguments: {0}"
,
string
.
Join
(
" "
,
Environment
.
GetCommandLineArgs
()));
string
projectPath
=
ParseArguments
.
ProjectPath
(
args
);
string
cloudRepository
=
ParseArguments
.
CloudProject
(
args
);
string
cloudOrganization
=
ParseArguments
.
CloudOrganization
(
args
);
if
(
string
.
IsNullOrEmpty
(
projectPath
)
||
string
.
IsNullOrEmpty
(
cloudRepository
)
||
string
.
IsNullOrEmpty
(
cloudOrganization
))
return
;
PlasticApp
.
InitializeIfNeeded
();
DownloadRepositoryOperation
downloadOperation
=
new
DownloadRepositoryOperation
();
downloadOperation
.
DownloadRepositoryToPathIfNeeded
(
cloudRepository
,
cloudOrganization
,
Path
.
GetFullPath
(
projectPath
),
unityAccessToken
);
}
const
string
IS_PROJECT_DOWNLOADER_ALREADY_EXECUTED_KEY
=
"PlasticSCM.ProjectDownloader.IsAlreadyExecuted"
;
static
readonly
ILog
mLog
=
LogManager
.
GetLogger
(
"ProjectDownloader"
);
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/CloudProjectDownloader/CommandLineArguments.cs
0 → 100644
View file @
1c847220
using
System
;
using
System.Collections.Generic
;
namespace
Unity.PlasticSCM.Editor.ProjectDownloader
{
internal
class
CommandLineArguments
{
internal
static
Dictionary
<
string
,
string
>
Build
(
string
[]
args
)
{
Dictionary
<
string
,
string
>
result
=
new
Dictionary
<
string
,
string
>(
StringComparer
.
OrdinalIgnoreCase
);
if
(
args
==
null
)
return
result
;
List
<
string
>
trimmedArguments
=
TrimArgs
(
args
);
int
index
=
1
;
while
(
true
)
{
if
(
index
>
trimmedArguments
.
Count
-
1
)
break
;
if
(
IsKeyValueArgumentAtIndex
(
trimmedArguments
,
index
))
{
result
[
trimmedArguments
[
index
]]
=
trimmedArguments
[
index
+
1
];
index
+=
2
;
continue
;
}
result
[
trimmedArguments
[
index
]]
=
null
;
index
+=
1
;
}
return
result
;
}
static
List
<
string
>
TrimArgs
(
string
[]
args
)
{
List
<
string
>
trimmedArguments
=
new
List
<
string
>();
foreach
(
string
argument
in
args
)
trimmedArguments
.
Add
(
argument
.
Trim
());
return
trimmedArguments
;
}
static
bool
IsKeyValueArgumentAtIndex
(
List
<
string
>
trimmedArguments
,
int
index
)
{
if
(
index
+
1
>
trimmedArguments
.
Count
-
1
)
return
false
;
return
!
trimmedArguments
[
index
+
1
].
StartsWith
(
"-"
);
}
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/CloudProjectDownloader/DownloadRepositoryOperation.cs
0 → 100644
View file @
1c847220
using
System
;
using
System.IO
;
using
System.Threading
;
using
UnityEditor
;
using
UnityEngine
;
using
Codice.Client.BaseCommands
;
using
Codice.Client.Commands
;
using
Codice.Client.Common
;
using
Codice.CM.Common
;
using
Codice.LogWrapper
;
using
Codice.Utils
;
using
PlasticGui
;
using
PlasticGui.WebApi
;
using
PlasticGui.WorkspaceWindow
;
using
PlasticGui.WorkspaceWindow.Update
;
using
Unity.PlasticSCM.Editor.AssetUtils
;
using
Unity.PlasticSCM.Editor.Tool
;
using
Unity.PlasticSCM.Editor.UI
;
namespace
Unity.PlasticSCM.Editor.ProjectDownloader
{
internal
class
DownloadRepositoryOperation
{
internal
void
DownloadRepositoryToPathIfNeeded
(
string
cloudRepository
,
string
cloudOrganization
,
string
projectPath
,
string
unityAccessToken
)
{
AssetDatabase
.
DisallowAutoRefresh
();
try
{
BuildProgressSpeedAndRemainingTime
.
ProgressData
progressData
=
new
BuildProgressSpeedAndRemainingTime
.
ProgressData
(
DateTime
.
Now
);
ThreadPool
.
QueueUserWorkItem
(
DownloadRepository
,
new
DownloadRepositoryParameters
()
{
CloudOrganization
=
cloudOrganization
,
CloudRepository
=
cloudRepository
,
ProjectPath
=
projectPath
,
AccessToken
=
unityAccessToken
});
while
(!
mOperationFinished
)
{
if
(
mDisplayProgress
)
{
DisplayProgress
(
mUpdateNotifier
.
GetUpdateStatus
(),
progressData
,
cloudRepository
);
}
Thread
.
Sleep
(
150
);
}
}
finally
{
EditorUtility
.
ClearProgressBar
();
AssetDatabase
.
AllowAutoRefresh
();
RefreshAsset
.
UnityAssetDatabase
();
if
(!
mOperationFailed
)
{
ShowWindow
.
PlasticAfterDownloadingProject
();
}
}
}
void
DownloadRepository
(
object
state
)
{
DownloadRepositoryParameters
parameters
=
(
DownloadRepositoryParameters
)
state
;
try
{
IPlasticWebRestApi
restApi
=
new
PlasticWebRestApi
();
string
defaultCloudAlias
=
restApi
.
GetDefaultCloudAlias
();
RepositorySpec
repSpec
=
BuildRepSpec
(
parameters
.
CloudRepository
,
parameters
.
CloudOrganization
,
defaultCloudAlias
);
// we just download a cloud project,
// so let's assume we're going to use Cloud Edition
SetupUnityEditionToken
.
CreateCloudEditionTokenIfNeeded
();
if
(!
ClientConfig
.
IsConfigured
())
{
AutoConfigClientConf
.
FromUnityAccessToken
(
parameters
.
AccessToken
,
repSpec
,
parameters
.
ProjectPath
);
}
if
(
WorkspaceExists
(
parameters
.
ProjectPath
))
{
// each domain reload, the package is reloaded.
// way need to check if we already downloaded it
return
;
}
mDisplayProgress
=
true
;
WorkspaceInfo
wkInfo
=
CreateWorkspace
(
repSpec
,
parameters
.
ProjectPath
);
mLog
.
DebugFormat
(
"Created workspace {0} on {1}"
,
wkInfo
.
Name
,
wkInfo
.
ClientPath
);
Plastic
.
API
.
Update
(
wkInfo
.
ClientPath
,
UpdateFlags
.
None
,
null
,
mUpdateNotifier
);
}
catch
(
Exception
ex
)
{
LogException
(
ex
);
UnityEngine
.
Debug
.
LogErrorFormat
(
PlasticLocalization
.
GetString
(
PlasticLocalization
.
Name
.
ErrorDownloadingCloudProject
),
ex
.
Message
);
mOperationFailed
=
true
;
}
finally
{
mOperationFinished
=
true
;
}
}
static
void
DisplayProgress
(
UpdateOperationStatus
status
,
BuildProgressSpeedAndRemainingTime
.
ProgressData
progressData
,
string
cloudRepository
)
{
string
totalProgressMessage
=
UpdateProgressRender
.
GetProgressString
(
status
,
progressData
);
float
totalProgressPercent
=
GetProgressBarPercent
.
ForTransfer
(
status
.
UpdatedSize
,
status
.
TotalSize
)
/
100f
;
EditorUtility
.
DisplayProgressBar
(
string
.
Format
(
"{0} {1}"
,
PlasticLocalization
.
GetString
(
PlasticLocalization
.
Name
.
DownloadingProgress
),
cloudRepository
),
totalProgressMessage
,
totalProgressPercent
);
}
static
WorkspaceInfo
CreateWorkspace
(
RepositorySpec
repositorySpec
,
string
projectPath
)
{
CreateWorkspaceDialogUserAssistant
assistant
=
new
CreateWorkspaceDialogUserAssistant
(
PlasticGuiConfig
.
Get
().
Configuration
.
DefaultWorkspaceRoot
,
Plastic
.
API
.
GetAllWorkspacesArray
());
assistant
.
RepositoryChanged
(
repositorySpec
.
ToString
(),
string
.
Empty
,
string
.
Empty
);
return
Plastic
.
API
.
CreateWorkspace
(
projectPath
,
assistant
.
GetProposedWorkspaceName
(),
repositorySpec
.
ToString
());
}
static
RepositorySpec
BuildRepSpec
(
string
cloudRepository
,
string
cloudOrganization
,
string
defaultCloudAlias
)
{
return
new
RepositorySpec
()
{
Name
=
cloudRepository
,
Server
=
CloudServer
.
BuildFullyQualifiedName
(
cloudOrganization
,
defaultCloudAlias
)
};
}
static
void
LogException
(
Exception
ex
)
{
mLog
.
WarnFormat
(
"Message: {0}"
,
ex
.
Message
);
mLog
.
DebugFormat
(
"StackTrace:{0}{1}"
,
Environment
.
NewLine
,
ex
.
StackTrace
);
}
static
bool
WorkspaceExists
(
string
projectPath
)
{
return
Plastic
.
API
.
GetWorkspaceFromPath
(
projectPath
)
!=
null
;
}
class
DownloadRepositoryParameters
{
internal
string
CloudRepository
;
internal
string
CloudOrganization
;
internal
string
ProjectPath
;
internal
string
AccessToken
;
}
volatile
bool
mOperationFinished
=
false
;
volatile
bool
mOperationFailed
=
false
;
volatile
bool
mDisplayProgress
;
UpdateNotifier
mUpdateNotifier
=
new
UpdateNotifier
();
static
readonly
ILog
mLog
=
LogManager
.
GetLogger
(
"DownloadRepositoryOperation"
);
}
}
ydk2021/New Unity Project/Library/PackageCache/com.unity.collab-proxy@1.5.7/Editor/PlasticSCM/CloudProjectDownloader/ParseArguments.cs
0 → 100644
View file @
1c847220
using
System.Collections.Generic
;
namespace
Unity.PlasticSCM.Editor.ProjectDownloader
{
internal
static
class
ParseArguments
{
internal
static
string
CloudProject
(
Dictionary
<
string
,
string
>
args
)
{
string
data
;
if
(!
args
.
TryGetValue
(
CLOUD_PROJECT
,
out
data
))
return
null
;
return
data
;
}
internal
static
string
CloudOrganization
(
Dictionary
<
string
,
string
>
args
)
{
string
data
;
if
(!
args
.
TryGetValue
(
CLOUD_ORGANIZATION
,
out
data
))
return
null
;
return
GetOrganizationNameFromData
(
data
);
}
internal
static
string
ProjectPath
(
Dictionary
<
string
,
string
>
args
)
{
string
data
;
if
(!
args
.
TryGetValue
(
CREATE_PROJECT
,
out
data
))
return
null
;
return
data
;
}
static
string
GetOrganizationNameFromData
(
string
data
)
{
// data is in format: 151d73c7-38cb-4eec-b11e-34764e707226-danipen-unity
int
guidLenght
=
36
;
if
(
data
.
Length
<
guidLenght
+
1
)
return
null
;
return
data
.
Substring
(
guidLenght
+
1
);
}
const
string
CLOUD_PROJECT
=
"-cloudProject"
;
const
string
CLOUD_ORGANIZATION
=
"-cloudOrganization"
;
const
string
CREATE_PROJECT
=
"-createProject"
;
}
}
Prev
1
…
17
18
19
20
21
22
23
24
25
…
32
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment