Cozy Wather + buld systeme
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "DistantLands.Cozy.Link.Editor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:5492a51f516277543a92d676903897bf",
|
||||
"GUID:5706c50feecb01b4cb045870dd1a027e",
|
||||
"GUID:d63360ab401c0fe4cb72fc3371d655bb"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 577e0b508379ffd4badaa64bb2a4790a
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 238669
|
||||
packageName: 'COZY: Link - Multiplayer Module'
|
||||
packageVersion: 1.9.1
|
||||
assetPath: Packages/com.distantlands.cozy.link/Editor/DistantLands.Cozy.Link.Editor.asmdef
|
||||
uploadId: 822162
|
||||
@@ -0,0 +1,128 @@
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
public class LinkIntegrations : EditorWindow
|
||||
{
|
||||
|
||||
|
||||
// [MenuItem("Tools/Cozy: Stylized Weather 3/Check Link Integrations", false, 1500)]
|
||||
[MenuItem("Window/Cozy: Stylized Weather 3/Check Link Integrations", false, 1021)]
|
||||
public static void Init()
|
||||
{
|
||||
|
||||
LinkIntegrations window = (LinkIntegrations)EditorWindow.GetWindow(typeof(LinkIntegrations), false, "Setup LINK");
|
||||
window.minSize = new Vector2(400, 500);
|
||||
window.Show();
|
||||
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
|
||||
EditorGUILayout.LabelField("LINK Integrations");
|
||||
EditorGUILayout.HelpBox("Thank you for your purchase of LINK: COZY Multiplayer Module! Select your multiplayer solution from the dropdown and allow your scripts to reload to get started.", MessageType.Info);
|
||||
|
||||
string[] integrations = new string[6] { "None", "PUN", "FishNetworking", "Netcode for Gameobjects", "Mirror", "Purrnet" };
|
||||
|
||||
int i = EditorGUILayout.Popup(new GUIContent("Multiplayer Type"), EditorPrefs.GetInt("LINK_Integration"), integrations);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
if (i != EditorPrefs.GetInt("LINK_Integration"))
|
||||
{
|
||||
|
||||
SetupIntegration(i);
|
||||
EditorPrefs.SetInt("LINK_Integration", i);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.HelpBox("Then in a scene setup for multiplayer, setup your scene for COZY and add the LINK module to the COZY weather sphere in the settings/modules tab. If you are using Mirror, be sure to click the Ensure Setup button.", MessageType.Info);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SetupIntegration(int integration)
|
||||
{
|
||||
|
||||
switch (integration)
|
||||
{
|
||||
case (0):
|
||||
RemoveDefine("LINK_PUN");
|
||||
RemoveDefine("LINK_FISHNET");
|
||||
RemoveDefine("LINK_NETCODE");
|
||||
RemoveDefine("LINK_MIRROR");
|
||||
RemoveDefine("LINK_PURRNET");
|
||||
break;
|
||||
case (1):
|
||||
AddDefine("LINK_PUN");
|
||||
RemoveDefine("LINK_FISHNET");
|
||||
RemoveDefine("LINK_NETCODE");
|
||||
RemoveDefine("LINK_MIRROR");
|
||||
RemoveDefine("LINK_PURRNET");
|
||||
break;
|
||||
case (2):
|
||||
RemoveDefine("LINK_PUN");
|
||||
AddDefine("LINK_FISHNET");
|
||||
RemoveDefine("LINK_NETCODE");
|
||||
RemoveDefine("LINK_MIRROR");
|
||||
RemoveDefine("LINK_PURRNET");
|
||||
break;
|
||||
case (3):
|
||||
RemoveDefine("LINK_PUN");
|
||||
RemoveDefine("LINK_FISHNET");
|
||||
AddDefine("LINK_NETCODE");
|
||||
RemoveDefine("LINK_MIRROR");
|
||||
RemoveDefine("LINK_PURRNET");
|
||||
break;
|
||||
case (4):
|
||||
RemoveDefine("LINK_PUN");
|
||||
RemoveDefine("LINK_FISHNET");
|
||||
RemoveDefine("LINK_NETCODE");
|
||||
AddDefine("LINK_MIRROR");
|
||||
RemoveDefine("LINK_PURRNET");
|
||||
break;
|
||||
case (5):
|
||||
RemoveDefine("LINK_PUN");
|
||||
RemoveDefine("LINK_FISHNET");
|
||||
RemoveDefine("LINK_NETCODE");
|
||||
RemoveDefine("LINK_MIRROR");
|
||||
AddDefine("LINK_PURRNET");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void AddDefine(string define)
|
||||
{
|
||||
string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
|
||||
List<string> allDefines = definesString.Split(';').ToList();
|
||||
allDefines.Add(define);
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(
|
||||
EditorUserBuildSettings.selectedBuildTargetGroup,
|
||||
string.Join(";", allDefines.ToArray()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void RemoveDefine(string define)
|
||||
{
|
||||
string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
|
||||
|
||||
List<string> allDefines = definesString.Split(';').ToList();
|
||||
|
||||
if (allDefines.Contains(define))
|
||||
allDefines.Remove(define);
|
||||
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, string.Join(";", allDefines.ToArray()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca20af13864c5da439bf1c4442331bcb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 238669
|
||||
packageName: 'COZY: Link - Multiplayer Module'
|
||||
packageVersion: 1.9.1
|
||||
assetPath: Packages/com.distantlands.cozy.link/Editor/LinkIntegrations.cs
|
||||
uploadId: 822162
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e9e197600f96fbb40beb8ec22042768d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1060b614add0d874e95a4e2a7cea2d91
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 432ec55c92b99a74dad69715565d88e9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
@@ -0,0 +1,115 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fdb6073190be90646a9b9f991f36c245
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 238669
|
||||
packageName: 'COZY: Link - Multiplayer Module'
|
||||
packageVersion: 1.9.1
|
||||
assetPath: Packages/com.distantlands.cozy.link/Editor/Resources/Icons/Modules/Link.png
|
||||
uploadId: 822162
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4fcbebc896b635d41b5aaaf1879c1853
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b34fa850bf91c349ac30cc46c1ce9dd
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,76 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using DistantLands.Cozy.Data;
|
||||
|
||||
namespace DistantLands.Cozy.EditorScripts
|
||||
{
|
||||
[CustomEditor(typeof(LinkModule))]
|
||||
public class CozyLinkModuleEditor : CozyModuleEditor
|
||||
{
|
||||
|
||||
LinkModule module;
|
||||
public override ModuleCategory Category => ModuleCategory.integration;
|
||||
public override string ModuleTitle => "Link";
|
||||
public override string ModuleSubtitle => "Multiplayer Module";
|
||||
public override string ModuleTooltip => "Manage multiplayer integrations with a number of server/client multiplayer solutions.";
|
||||
|
||||
public Button IntegrationSelection => root.Q<Button>("integration-selection");
|
||||
public Label SelectedIntegration => root.Q<Label>("selected-integration");
|
||||
|
||||
Button widget;
|
||||
VisualElement root;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
module = (LinkModule)target;
|
||||
}
|
||||
|
||||
public override Button DisplayWidget()
|
||||
{
|
||||
widget = SmallWidget();
|
||||
Label status = widget.Q<Label>("dynamic-status");
|
||||
status.style.fontSize = 8;
|
||||
status.text = LinkModule.SelectedIntegrationName;
|
||||
|
||||
return widget;
|
||||
|
||||
}
|
||||
|
||||
public override VisualElement DisplayUI()
|
||||
{
|
||||
root = new VisualElement();
|
||||
|
||||
VisualTreeAsset asset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(
|
||||
"Packages/com.distantlands.cozy.link/Editor/UI/UXML/link-module-editor.uxml"
|
||||
);
|
||||
|
||||
root.Bind(serializedObject);
|
||||
|
||||
asset.CloneTree(root);
|
||||
|
||||
SelectedIntegration.text = LinkModule.SelectedIntegrationName;
|
||||
|
||||
IntegrationSelection.RegisterCallback((ClickEvent evt) =>
|
||||
{
|
||||
LinkIntegrations.Init();
|
||||
});
|
||||
|
||||
|
||||
return root;
|
||||
|
||||
}
|
||||
public override void OpenDocumentationURL()
|
||||
{
|
||||
Application.OpenURL("https://distant-lands.gitbook.io/cozy-stylized-weather-documentation/how-it-works/modules/link-module");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12f52ee919015bc46a3c7f2bf485ead2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 238669
|
||||
packageName: 'COZY: Link - Multiplayer Module'
|
||||
packageVersion: 1.9.1
|
||||
assetPath: Packages/com.distantlands.cozy.link/Editor/UI/C#/CozyLinkModuleEditor.cs
|
||||
uploadId: 822162
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ff37e6579ac52b469ad170b31dba42b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
|
||||
<Style src="project://database/Packages/com.distantlands.cozy.core/Editor/UI/Globals.uss?fileID=7433441132597879392&guid=60b39676bc45100478c0c8a083850788&type=3#Globals" />
|
||||
<ui:Label tabindex="-1" text="Selected Integration" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="selection-container" class="section-bg flex-row" style="justify-content: space-between; align-items: center;">
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="selected-integration" />
|
||||
<ui:Button text="Swap Integration" parse-escape-sequences="true" display-tooltip-when-elided="true" name="integration-selection" />
|
||||
</ui:VisualElement>
|
||||
<ui:Label tabindex="-1" text="Links" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="selection-container" class="section-bg" style="flex-grow: 0;">
|
||||
<uie:PropertyField binding-path="linkTime" />
|
||||
<uie:PropertyField binding-path="linkWeather" />
|
||||
<uie:PropertyField binding-path="linkAmbience" name="PropertyField" />
|
||||
</ui:VisualElement>
|
||||
<ui:Label tabindex="-1" text="Settings" parse-escape-sequences="true" display-tooltip-when-elided="true" class="h1" />
|
||||
<ui:VisualElement name="settings-container" class="section-bg" style="flex-grow: 0;">
|
||||
<uie:PropertyField binding-path="timeSettingSensitivity" />
|
||||
<uie:PropertyField binding-path="updateDelay" />
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6066763499d381147ac7a7ff5a1fba9e
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 238669
|
||||
packageName: 'COZY: Link - Multiplayer Module'
|
||||
packageVersion: 1.9.1
|
||||
assetPath: Packages/com.distantlands.cozy.link/Editor/UI/UXML/link-module-editor.uxml
|
||||
uploadId: 822162
|
||||
Reference in New Issue
Block a user