Commit f8751f2b authored by radow's avatar radow
Browse files

fixed links opening in the same tab

parent 9811baab
fileFormatVersion: 2
guid: 1a2ce5f480c731a4998a3cdeb72bc789
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
mergeInto(LibraryManager.library, {
Speak: function (str) {
var msg = new SpeechSynthesisUtterance(Pointer_stringify(str));
msg.lang = 'en-US';
msg.pitch = 1.5; // 0 to 2
window.speechSynthesis.cancel();
window.speechSynthesis.speak(msg);
},
ShutDown: function () {
window.speechSynthesis.cancel();
var msg = new SpeechSynthesisUtterance('Energy');
msg.lang = 'en-US';
msg.pitch = 1.5; // 0 to 2
msg.speed = 1;
window.speechSynthesis.speak(msg);
var msg = new SpeechSynthesisUtterance('depleted');
msg.lang = 'en-US';
msg.pitch = 1; // 0 to 2
msg.speed = .75;
window.speechSynthesis.speak(msg);
var msg = new SpeechSynthesisUtterance('shutting');
msg.lang = 'en-US';
msg.pitch = 0.5; // 0 to 2
msg.speed = .4;
window.speechSynthesis.speak(msg);
var msg = new SpeechSynthesisUtterance('down');
msg.lang = 'en-US';
msg.pitch = 0; // 0 to 2
msg.speed = .25;
window.speechSynthesis.speak(msg);
},
OpenInNewTab: function(link) {
var url = Pointer_stringify(link);
document.onmouseup = function()
{
window.open(url);
document.onmouseup = null;
}
}
});
fileFormatVersion: 2
guid: cf65b86e591dc4225a9d7b5efee41cc9
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Facebook: WebGL
second:
enabled: 1
settings: {}
- first:
WebGL: WebGL
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -508,6 +508,8 @@ MonoBehaviour:
stepcounter: {fileID: 515730249}
toggleMessage: {fileID: 1240806336}
winMessage: {fileID: 1610258555}
cleared: 0
levelID: 0
--- !u!1 &515730247
GameObject:
m_ObjectHideFlags: 0
......@@ -1294,6 +1296,133 @@ Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 7ebd1fe9e4d14fe4bbd10fd1586c7154, type: 3}
m_PrefabInstance: {fileID: 1120522546}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1125016042
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1125016044}
- component: {fileID: 1125016043}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!82 &1125016043
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1125016042}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: c76937a5c36fa4d4092b71e2fdfc22aa, type: 3}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!4 &1125016044
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1125016042}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 6.891743, y: -0.18530804, z: 17.927258}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1240806334
GameObject:
m_ObjectHideFlags: 0
......
......@@ -8001,6 +8001,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
factor: 1.15
auds: {fileID: 0}
--- !u!114 &837230757
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -9717,6 +9718,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
factor: 1.15
auds: {fileID: 0}
--- !u!114 &985716529
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -12418,6 +12420,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
factor: 1.15
auds: {fileID: 0}
--- !u!114 &1254093726
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -18182,6 +18185,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0230444cca0907e448a882de3f70b70a, type: 3}
m_Name:
m_EditorClassIdentifier:
settings: {fileID: 982761971}
--- !u!4 &1859257707
Transform:
m_ObjectHideFlags: 0
......@@ -18859,6 +18863,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
factor: 1.3
auds: {fileID: 0}
--- !u!114 &1933681280
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -20379,6 +20384,42 @@ PrefabInstance:
propertyPath: m_Name
value: Link
objectReference: {fileID: 0}
- target: {fileID: 6938692296354302618, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_Delegates.Array.size
value: 3
objectReference: {fileID: 0}
- target: {fileID: 6938692296354302618, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_Delegates.Array.data[2].callback.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6938692296354302618, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_Delegates.Array.data[2].eventID
value: 2
objectReference: {fileID: 0}
- target: {fileID: 6938692296354302618, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_Delegates.Array.data[2].callback.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 2648422}
- target: {fileID: 6938692296354302618, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_Delegates.Array.data[2].callback.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: MainMenu, Assembly-CSharp
objectReference: {fileID: 0}
- target: {fileID: 6938692296354302618, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_Delegates.Array.data[2].callback.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: OpenLinkNT
objectReference: {fileID: 0}
- target: {fileID: 6938692296354302618, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_Delegates.Array.data[2].callback.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6938692296354302618, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_Delegates.Array.data[2].callback.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 6938692296354302618, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_Delegates.Array.data[2].callback.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 6938692296354302622, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_LocalPosition.x
value: 0
......@@ -20463,13 +20504,17 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6938692296354302623, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6938692296354302623, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 2648422}
- target: {fileID: 6938692296354302623, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: OpenLink
value: OpenLinkNT
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fa28768bb3f72d740a6e134561d997fb, type: 3}
......
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.SceneManagement;
......@@ -25,14 +26,16 @@ public class MainMenu : MonoBehaviour
}
}
public void OpenLink()
[DllImport("__Internal")]
public static extern void OpenInNewTab(string url);
// IPointerEvent as it needs to happen during the actual mouse event. during the next frame is not early enough!
public void OpenLinkNT()
{
if (Application.platform == RuntimePlatform.WebGLPlayer)
{
Application.ExternalEval("window.open(\"https://purplesloth.studio/\",\"_blank\")");
return;
OpenInNewTab("https://purplesloth.studio/");
}
Application.OpenURL("https://purplesloth.studio/");
}
}
......@@ -14,8 +14,7 @@ public class Settings : MonoBehaviour
public AudioSource[] effectSources;
float[] originalEffectVol;
private void Start()
public void Start()
{
originalmusicVol = musicSource.volume;
originalEffectVol = new float[effectSources.Length];
......
......@@ -4,6 +4,7 @@ using UnityEngine;
public class SettingsData : MonoBehaviour
{
public Settings settings;
public static SettingsData instance;
private void Awake()
{
......@@ -14,7 +15,11 @@ public class SettingsData : MonoBehaviour
musicVolume = 1f;
effectsVolume = 1f;
}
else if (this != instance)Destroy(this.gameObject);
else if (this != instance)
{
settings.Start();
Destroy(this.gameObject);
}
}
public static float musicVolume;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment