Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewired #9

Merged
merged 6 commits into from
Jul 23, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Integrated Player Selection and Gameplay (Main) Scenes
- Better joystick assignment to players.
+ Rewired Input preserved bewteen scenes.
  • Loading branch information
Aestial committed Jul 16, 2018
commit ba367a8491a793edea721b0de695b8243ca6e230
38 changes: 38 additions & 0 deletions Assets/InputActions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Rewired;

namespace JoystickControl
{
public class InputActions : MonoBehaviour
{

// Use this for initialization
void Start()
{

}

// Update is called once per frame
void Update()
{
CheckPlayerInput();
}

// Player specific
private void CheckPlayerInput()
{
for (int i = 0; i < ReInput.players.playerCount; i++)
{
if (ReInput.players.GetPlayer(i).GetButtonDown("Start"))
{
Debug.Log("Some fucker pressed start!");
int players = PlayerPrefs.GetInt("Players");
GameManager.Instance.StartGame(players);
}
}
}
}
}

11 changes: 11 additions & 0 deletions Assets/InputActions.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 16 additions & 3 deletions Assets/MenuManager.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class MenuManager : MonoBehaviour {

public class MenuManager : Singleton<MenuManager>
{
// Use this for initialization
void Start () {
void Start ()
{

}

public void ChangeScene(int scene)
{
StartCoroutine(ChangeSceneCoroutine(scene));
}

private IEnumerator ChangeSceneCoroutine(int scene)
{
yield return new WaitForSeconds(1.0f);
SceneManager.LoadScene(scene);
}

// Update is called once per frame
void Update () {
Expand Down
59 changes: 49 additions & 10 deletions Assets/_ChickenFlu/Prefabs/Player.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -2693,6 +2693,7 @@ MeshRenderer:
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
Expand Down Expand Up @@ -2727,6 +2728,7 @@ MeshRenderer:
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 53df06e3edcb54187bb772f340fdf610, type: 2}
m_StaticBatchInfo:
Expand Down Expand Up @@ -2761,6 +2763,7 @@ MeshRenderer:
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 53df06e3edcb54187bb772f340fdf610, type: 2}
m_StaticBatchInfo:
Expand Down Expand Up @@ -2795,6 +2798,7 @@ MeshRenderer:
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 012d17319c978e2498115eaced0b94c7, type: 2}
- {fileID: 2100000, guid: 012d17319c978e2498115eaced0b94c7, type: 2}
Expand Down Expand Up @@ -2889,54 +2893,69 @@ AudioSource:
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
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: 2
- 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: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
- 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: 0
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
- 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: 0
Expand All @@ -2957,6 +2976,7 @@ Animator:
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!95 &95463766757135366
Animator:
serializedVersion: 3
Expand All @@ -2974,6 +2994,7 @@ Animator:
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!95 &95772361552868280
Animator:
serializedVersion: 3
Expand All @@ -2991,6 +3012,7 @@ Animator:
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!96 &96159580526236032
TrailRenderer:
serializedVersion: 2
Expand All @@ -3005,6 +3027,7 @@ TrailRenderer:
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 7f7efa2fe71984b5c99e0f0353ab943c, type: 2}
m_StaticBatchInfo:
Expand Down Expand Up @@ -3033,18 +3056,24 @@ TrailRenderer:
widthCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
- serializedVersion: 3
time: 0.0036621094
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0.47999954
inSlope: -0.0000020319762
outSlope: -0.0000020319762
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
Expand Down Expand Up @@ -3098,6 +3127,7 @@ TrailRenderer:
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 7f7efa2fe71984b5c99e0f0353ab943c, type: 2}
m_StaticBatchInfo:
Expand Down Expand Up @@ -3126,18 +3156,24 @@ TrailRenderer:
widthCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
- serializedVersion: 3
time: 0.0036621094
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0.47999954
inSlope: -0.0000020319762
outSlope: -0.0000020319762
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
Expand Down Expand Up @@ -3204,7 +3240,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: aacf49d2d10ca4a7f8678dfae32afd42, type: 3}
m_Name:
m_EditorClassIdentifier:
infectedDamage: 0.018
infectedDamage: 0.05
stateCustoms:
- state: 0
mesh: {fileID: 4335606520935464}
Expand Down Expand Up @@ -3471,6 +3507,7 @@ SkinnedMeshRenderer:
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: d7ea602c7c15941c08ed5a52aad87486, type: 2}
m_StaticBatchInfo:
Expand Down Expand Up @@ -3539,6 +3576,7 @@ SkinnedMeshRenderer:
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 94e8a24e222e74f1bbc8716cdd106cfa, type: 2}
m_StaticBatchInfo:
Expand Down Expand Up @@ -3607,6 +3645,7 @@ SkinnedMeshRenderer:
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 33f2c6558a2f94309a62e4dd32e15106, type: 2}
m_StaticBatchInfo:
Expand Down
Loading