...
 
Commits (4)
fileFormatVersion: 2
guid: 2a297c7ca09cc144e83f30a5958ef7ab
folderAsset: yes
timeCreated: 1491639508
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
"Up-to-date documentation at: https://github.com/speps/XInputDotNet"
fileFormatVersion: 2
guid: 43d07360c75581d439e3717e25e66a4e
timeCreated: 1491646258
licenseType: Free
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 5178daca8bd29fe4892dd0344de9e08a
folderAsset: yes
timeCreated: 1491639509
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: cccde4c5ffb739943ba6857307a20901
timeCreated: 1491639508
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using XInputDotNetPure; // Required in C#
public class XInputTestCS : MonoBehaviour
{
bool playerIndexSet = false;
PlayerIndex playerIndex;
GamePadState state;
GamePadState prevState;
// Use this for initialization
void Start()
{
// No need to initialize anything for the plugin
}
void FixedUpdate()
{
// SetVibration should be sent in a slower rate.
// Set vibration according to triggers
GamePad.SetVibration(playerIndex, state.Triggers.Left, state.Triggers.Right);
}
// Update is called once per frame
void Update()
{
// Find a PlayerIndex, for a single player game
// Will find the first controller that is connected ans use it
if (!playerIndexSet || !prevState.IsConnected)
{
for (int i = 0; i < 4; ++i)
{
PlayerIndex testPlayerIndex = (PlayerIndex)i;
GamePadState testState = GamePad.GetState(testPlayerIndex);
if (testState.IsConnected)
{
Debug.Log(string.Format("GamePad found {0}", testPlayerIndex));
playerIndex = testPlayerIndex;
playerIndexSet = true;
}
}
}
prevState = state;
state = GamePad.GetState(playerIndex);
// Detect if a button was pressed this frame
if (prevState.Buttons.A == ButtonState.Released && state.Buttons.A == ButtonState.Pressed)
{
GetComponent<Renderer>().material.color = new Color(Random.value, Random.value, Random.value, 1.0f);
}
// Detect if a button was released this frame
if (prevState.Buttons.A == ButtonState.Pressed && state.Buttons.A == ButtonState.Released)
{
GetComponent<Renderer>().material.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
}
// Make the current object turn
transform.localRotation *= Quaternion.Euler(0.0f, state.ThumbSticks.Left.X * 25.0f * Time.deltaTime, 0.0f);
}
void OnGUI()
{
string text = "Use left stick to turn the cube, hold A to change color\n";
text += string.Format("IsConnected {0} Packet #{1}\n", state.IsConnected, state.PacketNumber);
text += string.Format("\tTriggers {0} {1}\n", state.Triggers.Left, state.Triggers.Right);
text += string.Format("\tD-Pad {0} {1} {2} {3}\n", state.DPad.Up, state.DPad.Right, state.DPad.Down, state.DPad.Left);
text += string.Format("\tButtons Start {0} Back {1} Guide {2}\n", state.Buttons.Start, state.Buttons.Back, state.Buttons.Guide);
text += string.Format("\tButtons LeftStick {0} RightStick {1} LeftShoulder {2} RightShoulder {3}\n", state.Buttons.LeftStick, state.Buttons.RightStick, state.Buttons.LeftShoulder, state.Buttons.RightShoulder);
text += string.Format("\tButtons A {0} B {1} X {2} Y {3}\n", state.Buttons.A, state.Buttons.B, state.Buttons.X, state.Buttons.Y);
text += string.Format("\tSticks Left {0} {1} Right {2} {3}\n", state.ThumbSticks.Left.X, state.ThumbSticks.Left.Y, state.ThumbSticks.Right.X, state.ThumbSticks.Right.Y);
GUI.Label(new Rect(0, 0, Screen.width, Screen.height), text);
}
}
fileFormatVersion: 2
guid: e143cf088d969334389b47fee45014c4
timeCreated: 1491639512
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
The MIT License
Copyright (c) 2009 Remi Gillig <remigillig@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
\ No newline at end of file
fileFormatVersion: 2
guid: ed3e6bf255d74d744a4688ccf8acd059
timeCreated: 1491639515
licenseType: Free
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e9df0c444d5578648ae91c1b43400cdd
folderAsset: yes
timeCreated: 1491640316
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b36a7f6d28503d045b758e8fb3c40d0f
timeCreated: 1491640590
licenseType: Free
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 0
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXIntel: 1
Exclude OSXIntel64: 1
Exclude OSXUniversal: 1
Exclude Win: 0
Exclude Win64: 0
data:
first:
'': Editor
second:
enabled: 0
settings:
CPU: AnyCPU
OS: Windows
data:
first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
data:
first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
data:
first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXIntel
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXIntel64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
data:
first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 81ee109614ee77f40aea029a397052bf
folderAsset: yes
timeCreated: 1491639509
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: ea8c4f25f91eef24498783a97d350656
timeCreated: 1491639515
licenseType: Free
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 0
Exclude LinuxUniversal: 0
Exclude OSXIntel: 0
Exclude OSXIntel64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 1
data:
first:
'': Editor
second:
enabled: 0
settings:
CPU: x86
OS: Windows
data:
first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86
DefaultValueInitialized: true
OS: Windows
data:
first:
Facebook: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: None
data:
first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
data:
first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b1a9a3e0cfd88334d8984a8fe2b3a027
folderAsset: yes
timeCreated: 1491639509
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f79ea96a8e336c9429ea63c03eda9674
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 0
Exclude LinuxUniversal: 0
Exclude OSXIntel: 0
Exclude OSXIntel64: 0
Exclude OSXUniversal: 0
Exclude Win: 1
Exclude Win64: 0
- first:
'': Editor
second:
enabled: 0
settings:
CPU: x86_64
OS: Windows
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
- first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b2ecb1924009c4c4e9a236b73acb3bb6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: adbb5765bcc14a047a488cf351a8e126, type: 3}
m_Name: Counting Variables
m_EditorClassIdentifier:
p1Deaths: {fileID: 11400000, guid: ce901c3b08fedd94aafc1f2914b6a7fb, type: 2}
p2Deaths: {fileID: 11400000, guid: 7b578f30caa128841b3d04f745b1493d, type: 2}
menuHasBeenLoaded: {fileID: 11400000, guid: 4032cf54e5376c241bc6860e23a961c0, type: 2}
fileFormatVersion: 2
guid: 646b89dadb3e1c041b6bc4a542589308
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityAtoms;
using UnityEngine;
[CreateAssetMenu(menuName="A new ending")]
public class CountingVariables : ScriptableObject
{
[SerializeField] private IntVariable p1Deaths;
[SerializeField] private IntVariable p2Deaths;
[SerializeField] private BoolVariable menuHasBeenLoaded;
public void ResetCountingVariables()
{
p1Deaths.Value = 0;
p2Deaths.Value = 0;
menuHasBeenLoaded.Value = false;
}
}
fileFormatVersion: 2
guid: adbb5765bcc14a047a488cf351a8e126
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 07a094dae4de443b4a887630b07c7bfe, type: 3}
m_Name: Quit
m_EditorClassIdentifier:
fileFormatVersion: 2
guid: 6c18c6e726cde0e468da0592c3c8776a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 320ccd2dc511d4d1b9d768f703fd3bb8, type: 3}
m_Name: MenuHasBeenLoaded
m_EditorClassIdentifier:
DeveloperDescription:
value: 0
oldValue: 0
Changed: {fileID: 0}
ChangedWithHistory: {fileID: 0}
fileFormatVersion: 2
guid: 4032cf54e5376c241bc6860e23a961c0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4b01d10ebe5fb40b988e6f1caaf85145, type: 3}
m_Name: Drag
m_EditorClassIdentifier:
DeveloperDescription:
value: 0.7
oldValue: 0
Changed: {fileID: 0}
ChangedWithHistory: {fileID: 0}
fileFormatVersion: 2
guid: c7f342e614d33624ba22bfe42f88f8b8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4b01d10ebe5fb40b988e6f1caaf85145, type: 3}
m_Name: Drag
m_EditorClassIdentifier:
DeveloperDescription:
value: 0.7
oldValue: 0
Changed: {fileID: 0}
ChangedWithHistory: {fileID: 0}
fileFormatVersion: 2
guid: 840d9ec3eac23d04b9417694fcfc48f7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
......@@ -13,7 +13,7 @@ MonoBehaviour:
m_Name: debuffDrag
m_EditorClassIdentifier:
DeveloperDescription:
value: 2
value: 1.4
oldValue: 0
Changed: {fileID: 0}
ChangedWithHistory: {fileID: 0}
......@@ -13,7 +13,7 @@ MonoBehaviour:
m_Name: debuffJump
m_EditorClassIdentifier:
DeveloperDescription: normal is 7
value: 0
value: 0.3
oldValue: 0
Changed: {fileID: 0}
ChangedWithHistory: {fileID: 0}
......@@ -14,6 +14,7 @@ GameObject:
- component: {fileID: 6454913238435751179}
- component: {fileID: 8614171064719550910}
- component: {fileID: 414725474638597084}
- component: {fileID: 4641984784149214760}
m_Layer: 0
m_Name: GameManager
m_TagString: Untagged
......@@ -155,6 +156,18 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5ee3c33da0cafb54c98d831b44816789, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &4641984784149214760
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4594634929475243472}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 21952804afb78654fbc3f020e326eab0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &7049748456825307160
PrefabInstance:
m_ObjectHideFlags: 0
......
......@@ -13,6 +13,7 @@ GameObject:
- component: {fileID: 46179617408924949}
- component: {fileID: 5810170731428422867}
- component: {fileID: 2783878841515753837}
- component: {fileID: 5374147668424276736}
m_Layer: 11
m_Name: Lever
m_TagString: Untagged
......@@ -163,6 +164,8 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
pulledLevers: {fileID: 11400000, guid: 9612907be0f0e574196d911693f5fa81, type: 2}
checkpointTag: {fileID: 11400000, guid: 3458fcec955445a4f94e41fc34583bcd, type: 2}
IsTimed: 0
AfterTime: 0
--- !u!114 &2783878841515753837
......@@ -177,4 +180,18 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3570dca9cf8f40ac9731ef4082c9a4ef, type: 3}
m_Name:
m_EditorClassIdentifier:
_tags: []
_tags:
- {fileID: 0}
--- !u!114 &5374147668424276736
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 46179617408924945}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 559838af38077ab4ab9c5c3d477b0096, type: 3}
m_Name:
m_EditorClassIdentifier:
transfer: {fileID: 11400000, guid: 7b22bba61d075c64e85adbda114d5db8, type: 2}
This diff is collapsed.
......@@ -13,6 +13,6 @@ public class SizeDebuff : DeBuff
{
//Debug.Log("scaling down");
Target.transform.localScale=new Vector3(debuffSize.Value,debuffSize.Value,Target.transform.localScale.z) ;
Target.GetComponent<Rigidbody2D>().drag *= debuffDrag.Value;
Target.GetComponent<Rigidbody2D>().drag = debuffDrag.Value;
}
}
fileFormatVersion: 2
guid: 1e47791daea0e9b4a99c3f7e849f350f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XInputDotNetPure;
public class GoodVibrations :MonoBehaviour
{
public void SetVibration(float seconds, float intensity=0.1f)
{
GamePad.SetVibration(PlayerIndex.One, intensity, intensity);
GamePad.SetVibration(PlayerIndex.Two, intensity, intensity);
StartCoroutine(StopVibratingAfterSeconds(seconds));
}
public void Vibrate()
{
SetVibration(0.15f);
}
IEnumerator StopVibratingAfterSeconds(float time)
{
yield return new WaitForSeconds(time);
GamePad.SetVibration(PlayerIndex.One, 0, 0);
GamePad.SetVibration(PlayerIndex.Two, 0, 0);
}
}
fileFormatVersion: 2
guid: 21952804afb78654fbc3f020e326eab0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -9,6 +9,7 @@ public class NextLevel : MonoBehaviour
{
public void LoadNextLevel()
{
if (SceneManager.sceneCountInBuildSettings > SceneManager.GetActiveScene().buildIndex+1 )
{
int sceneIndex = SceneManager.GetActiveScene().buildIndex;
......
using System.Collections;
using System.Collections.Generic;
using UnityAtoms;
using UnityEngine;
public class StartScreen : MonoBehaviour
{
[SerializeField] private BoolVariable hasBeenLoaded;
[SerializeField] private GameObject MainMenu;
private void Start()
{
if (hasBeenLoaded.Value)
{
MainMenu.SetActive(true);
this.gameObject.SetActive(false);
}
hasBeenLoaded.Value = true;
}
// Update is called once per frame
void Update()
{
}
}
fileFormatVersion: 2
guid: 37e360c05330f334aa5e4141e5025142
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityAtoms;
using UnityEngine;
......@@ -11,6 +12,12 @@ public class Timer : MonoBehaviour
[SerializeField] private FloatVariable secondsCount;
[SerializeField] private IntVariable minuteCount;
[SerializeField] private IntVariable hourCount;
private void Start()
{
ResetTimer();
}
void Update(){
UpdateTimerUI();
}
......
using System;
using System.Collections;
using System.Collections.Generic;
using UnityAtoms;
using UnityEngine;
using UnityEngine.Events;
......@@ -8,23 +9,37 @@ public class LeverLogic : MonoBehaviour
{
[SerializeField] private UnityEvent _eventPulled;
[SerializeField] private UnityEvent _eventUnPulled;
[SerializeField] private PickedUpItems pulledLevers;
private SavePoint checkpoint;
[SerializeField] private StringConstant checkpointTag;
[SerializeField] private bool IsTimed = false;
[SerializeField] private float AfterTime = 0;
private bool pulled = false;
private void Start()
{
checkpoint = AtomicTags.FindByTag(checkpointTag.Value).GetComponent<SavePoint>();
}
void OnTriggerEnter2D(Collider2D other)
{
if (pulled)
{
GetComponent<ActionsToSave>()?.TransferAction(UnPull);
//GetComponent<ActionsToSave>()?.UnTransferAction(Pull);//replace by take this from list
pulledLevers.levers[0].Remove(gameObject);
Debug.Log("remove "+gameObject);
Debug.Log(pulledLevers.levers[0].Count);
UnPull();
}
else
{
GetComponent<ActionsToSave>()?.TransferAction(Pull);
GetComponent<ActionsToSave>()?.ForceTransferAction(UnPullAllLevers);
pulledLevers.levers[0].Add(gameObject);
Debug.Log("add "+gameObject );
Debug.Log(pulledLevers.levers[0].Count);
Pull();
if (IsTimed)
......@@ -43,8 +58,21 @@ public class LeverLogic : MonoBehaviour
FindObjectOfType<AudioManager>().Play("Lever");
}
public void UnPullAllLevers()
{
Debug.Log("pulling the levers. "+ pulledLevers.levers[0].Count+" are activated");
foreach (GameObject obj in pulledLevers.levers[0])
{
Debug.Log("pulling "+obj);
obj.GetComponent<LeverLogic>().UnPull();
}
}
public void UnPull()
{
pulled = false;
_eventUnPulled?.Invoke();
FindObjectOfType<AudioManager>().Play("Lever");
......@@ -56,6 +84,8 @@ public class LeverLogic : MonoBehaviour
FindObjectOfType<AudioManager>().StopPlaying("TimerTicks");
pulledLevers.levers[checkpoint.numActive+1].Remove(gameObject);
//GetComponent<ActionsToSave>()?.UnTransferAction(Pull);
UnPull();
}
}
......@@ -14,6 +14,10 @@ public class ActionsToSave : MonoBehaviour
{
transfer.AddEvent(action);
}
/*public void UnTransferAction(SavedActions.actions action)
{
transfer.RemoveEvent(action);
}*/
public void ForceTransferAction(SavedActions.actions action)
{
transfer.ForceAddEvent(action);
......
......@@ -6,6 +6,8 @@ using UnityEngine;
public class PickedUpItems : ScriptableObject
{
public List<List<GameObject>> items;
public List<List<GameObject>> levers;
public void ResetItems()
{
......
......@@ -4,6 +4,7 @@ using System.Collections.Generic;
using UnityAtoms;
using UnityEngine;
using UnityEngine.SceneManagement;
using XInputDotNetPure;
public class SavePoint : MonoBehaviour
{
......@@ -18,12 +19,17 @@ public class SavePoint : MonoBehaviour
[SerializeField] private Vector3 currentSpawnPlayer2;
[SerializeField] private StringConstant playerTag;
public void Trigger(Collider2D other, int triggerNum)
{
if (triggerNum>numActive)
{
numActive = triggerNum;
PotionsThatWillDisappear.items[0].Clear();
Debug.Log("clearing levers");
PotionsThatWillDisappear.levers[0].Clear();
Debug.Log(PotionsThatWillDisappear.levers[0].Count);
}
//Debug.Log(numActive +1+ " checkpoints are active");
hasBeenActivated[numActive] = true;
......@@ -39,15 +45,20 @@ public class SavePoint : MonoBehaviour
hasBeenActivated = new bool[GetComponentsInChildren<BoxCollider2D>().Length];
//items.items.Clear();
items.items=new List<List<GameObject>>();
items.levers=new List<List<GameObject>>();
foreach (var VARIABLE in hasBeenActivated)
{
items.items.Add(new List<GameObject>());
items.levers.Add(new List<GameObject>());
}
items.items.Add(new List<GameObject>());
items.levers.Add(new List<GameObject>());
//PotionsThatWillDisappear.items.Clear();
PotionsThatWillDisappear.items=new List<List<GameObject>>();
PotionsThatWillDisappear.items.Add(new List<GameObject>());
PotionsThatWillDisappear.levers=new List<List<GameObject>>();
PotionsThatWillDisappear.levers.Add(new List<GameObject>());
GameObject p1 = AtomicTags.FindAllByTag(playerTag.Value)[0];
GameObject p2 = AtomicTags.FindAllByTag(playerTag.Value)[1];
......@@ -61,14 +72,18 @@ public class SavePoint : MonoBehaviour
{
GameObject p1 = AtomicTags.FindAllByTag(playerTag.Value)[0];
GameObject p2 = AtomicTags.FindAllByTag(playerTag.Value)[1];
//!!!reset all in current cp pulled levers----------------------------------------------------------------------------------
p1.GetComponent<Player_Movement>().ResetBuffs();
p2.GetComponent<Player_Movement>().ResetBuffs();
//clear current set!
items.items[numActive+1].Clear();
transfer.InvokeEvent();
transfer.InvokeEvent();//unpull all levers
//items.levers[numActive+1].Clear(); //reset list with in current cp pulled levers
for (int i = 0; i <= numActive; i++)
{
if (hasBeenActivated[i])
......
......@@ -42,17 +42,24 @@ public class SavedActions : ScriptableObject
}
}*/
//AddEvent to checkpoint(active+1)
if (checkpoint.numActive>=myActions.Length)
{
Debug.Log("returning empty");
return;
}
Debug.Log(action.GetMethodInfo());
myActions[checkpoint.numActive + 1] -= action;
myActions[checkpoint.numActive + 1] += action;
}
public void RemoveEvent(actions action)
{
myActions[checkpoint.numActive + 1] -= action;
}
public void ForceAddEvent(actions action)
{
eventActivateDestructables -= action;
......@@ -64,10 +71,12 @@ public class SavedActions : ScriptableObject
{
checkpoint = AtomicTags.FindByTag(checkpointTag.Value).GetComponent<SavePoint>();
//Debug.Log(checkpoint.numActive+1 +" checkpoints are active");
Debug.Log("a cockroach");
if (checkpoint.numActive >= 0)
{
//Debug.Log("invoke action from set " + checkpoint.numActive );
//Debug.Log(myActions?[checkpoint.numActive]?.GetMethodInfo());
Debug.Log("in a bunker");
myActions?[checkpoint.numActive]?.Invoke();
}
} //on death
......@@ -80,8 +89,9 @@ public class SavedActions : ScriptableObject
public void InvokeDestructables()
{
//Debug.Log("invoking");
Debug.Log("invoking");
eventActivateDestructables?.Invoke();
Debug.Log(eventActivateDestructables?.GetMethodInfo());
}
/* public void ResetDestructables()
......
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityAtoms;
using UnityEngine;
......@@ -6,15 +7,28 @@ using UnityEngine.SceneManagement;
public class MainMenu : MonoBehaviour
{
[SerializeField] private BoolVariable hasBeenLoaded;
private void Start()
{
hasBeenLoaded.Value = true;
}
public void PlayGame()
{
Debug.Log("Loaded New Scene");
SceneManager.LoadScene(10, LoadSceneMode.Single);
// Merge between 10 and 3s
SceneManager.LoadScene(13, LoadSceneMode.Single);
}
public void QuitGame()
{
hasBeenLoaded.Value = false;
#if UNITY_EDITOR
// Application.Quit() does not work in the editor so
// UnityEditor.EditorApplication.isPlaying need to be set to false to end the game
......
......@@ -43,7 +43,7 @@ public class PlayerTouching : MonoBehaviour
{
yield return new WaitForSeconds(0.05f);
Debug.Log(gameObject.name);
//Debug.Log(gameObject.name);
IsTouching.Value = false;
......
......@@ -21,6 +21,7 @@ public class Player_Movement : MonoBehaviour
[SerializeField] private FloatVariable horizontalMovement;
[SerializeField] private StringVariable jumpAxis;
[SerializeField] private FloatVariable coyoteJump;
[SerializeField] private FloatVariable drag;
[SerializeField] private FloatVariable downForce;
......@@ -50,8 +51,8 @@ public class Player_Movement : MonoBehaviour
_originalFloats[6] = speed;
_originalFloats[7] = airSpeed;
_originalFloats[8] = stumbleSmooth;
_originalFloats[9] = stumbleSmooth;
_originalFloats[9] = size;
_originalFloats[10] = drag;
}
public void ResetBuffs()
......@@ -66,6 +67,8 @@ public class Player_Movement : MonoBehaviour
airSpeed = _originalFloats[7];
stumbleSmooth = _originalFloats[8];
size = _originalFloats[9];
drag = _originalFloats[10];
GetComponent<Rigidbody2D>().drag = drag.Value;
transform.localScale=new Vector3(1,1,1);
}
......
......@@ -45,7 +45,6 @@ public class AudioManager : MonoBehaviour
{
Debug.LogWarning("Sound: " + name + " not found!");
return;
}
if (s.randomized)
......@@ -56,7 +55,7 @@ public class AudioManager : MonoBehaviour
s.source.Play();
Debug.Log("Sound Played: " + s.source.clip.name);
//Debug.Log("Sound Played: " + s.source.clip.name);
}
public void StopPlaying(string sound)
......
......@@ -118,7 +118,7 @@ QualitySettings:
shadowResolution: 1
shadowProjection: 1
shadowCascades: 2
shadowDistance: 40
shadowDistance: 48.478527
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
......