Skip to content

Commit

Permalink
Late Night Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Rnen committed Jan 31, 2016
1 parent df3b966 commit 823179a
Show file tree
Hide file tree
Showing 37 changed files with 3,720 additions and 8 deletions.
Binary file added Assets/Animations/happy_idle.anim
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/Animations/happy_idle.anim.meta

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

Binary file added Assets/Animations/happy_walk.anim
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/Animations/happy_walk.anim.meta

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

Binary file added Assets/Animations/normal_idle.anim
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/Animations/normal_idle.anim.meta

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

Binary file added Assets/Animations/normal_walk.anim
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/Animations/normal_walk.anim.meta

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

Binary file modified Assets/Animations/walkCharacter_0.controller
Binary file not shown.
Binary file added Assets/Audio/Loops/ggj2016_On_the_Bus.ogg
Binary file not shown.
22 changes: 22 additions & 0 deletions Assets/Audio/Loops/ggj2016_On_the_Bus.ogg.meta

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

Binary file not shown.
File renamed without changes.
Binary file modified Assets/Scenes/M_Menu.unity
Binary file not shown.
Binary file modified Assets/Scenes/NScene1.unity
Binary file not shown.
Binary file modified Assets/Scenes/NScene3.unity
Binary file not shown.
11 changes: 9 additions & 2 deletions Assets/Scripts/ButtonManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@ public class ButtonManager : MonoBehaviour {
public int SceneToLoad;
public bool b_ShowEndings = false;
public Canvas MenuCanvas, EndingsCanvas;
public GameObject MainMenuStuff, OptionsStuff;
void Start()
{

ButtonOptionsBack();
}
public void ButtonPlay()
{
SceneManager.LoadScene(SceneToLoad);
}
public void ButtonOptions()
{

MainMenuStuff.SetActive(false);
OptionsStuff.SetActive(true);
}
public void ButtonOptionsBack()
{
MainMenuStuff.SetActive(true);
OptionsStuff.SetActive(false);
}
public void ShowEndings()
{
Expand Down
18 changes: 15 additions & 3 deletions Assets/Scripts/GameMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,29 @@ public class GameMaster : MonoBehaviour

int day = 0;

public static GameMaster Instance;

// Use this for initialization
void Start ()
void Awake()
{
if(Instance)
DestroyImmediate(gameObject);
else
{
DontDestroyOnLoad(gameObject);
Instance = this;
}
}


// Use this for initialization
void Start ()
{
NumberOfChoise = inspectorNumberOfChoise;
}

// Update is called once per frame
void Update ()
{
DontDestroyOnLoad(this.gameObject);
if (NumberOfChoise == 0)
{
NumberOfChoise = inspectorNumberOfChoise;
Expand Down
23 changes: 23 additions & 0 deletions Assets/Scripts/Options.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Options : MonoBehaviour {
public Text MusicVolumeText, SoundVolumeText;
public Slider MusicSlider, SoundSlider;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
SoundController.MusicVolume = MusicSlider.value;
SoundController.SoundVolume = SoundSlider.value;
int v2 = (int)(SoundController.SoundVolume * 100);
int v1 = (int)(SoundController.MusicVolume * 100);
SoundVolumeText.text = "Sound Volume: " + (v2).ToString() + "%";
MusicVolumeText.text = "Music Volume: " + (v1).ToString() + "%";
}
}
12 changes: 12 additions & 0 deletions Assets/Scripts/Options.cs.meta

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

24 changes: 21 additions & 3 deletions Assets/Scripts/PlayerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,29 @@ public class PlayerController : MonoBehaviour {
Vector3 targetPosition;
Animator derAnimator;

// Use this for initialization
void Start () {
public enum MyEnumListy { Normal, Happy, Sad }
public MyEnumListy TypeOfMood;

// Use this for initialization
void Start () {
targetPosition = transform.position;
derAnimator = GetComponent<Animator>();
}
switch (TypeOfMood)
{
case MyEnumListy.Normal:
derAnimator.Play("normal_idle");
break;
case MyEnumListy.Happy:
derAnimator.Play("happy_idle");
break;
case MyEnumListy.Sad:
derAnimator.Play("idle");
break;
default:
Debug.Log("NOTHING");
break;
}
}

// Update is called once per frame
void Update () {
Expand Down
58 changes: 58 additions & 0 deletions Assets/Scripts/SoundController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class SoundController : MonoBehaviour {
public static float MusicVolume = 0.75f, SoundVolume = 0.75f;

public static bool MusicIsMuted = false, SoundIsMuted = false;

public AudioClip[] Music;
public int CurrentSceneMusicTrack;

private AudioSource MainMusicAudio;


public static SoundController Instance;

void Awake()
{
if(Instance)
DestroyImmediate(gameObject);
else
{
DontDestroyOnLoad(gameObject);
Instance = this;
}
}


void Start()
{
MainMusicAudio = GetComponent<AudioSource>();
MainMusicAudio.Stop();
}
void Update()
{
if (CurrentSceneMusicTrack != Application.loadedLevel) { MainMusicAudio.Stop();
CurrentSceneMusicTrack = Application.loadedLevel;
}
if (MusicIsMuted) MainMusicAudio.mute = true;
else MainMusicAudio.mute = false;


MainMusicAudio.volume = MusicVolume;
if (!MainMusicAudio.isPlaying) {
MainMusicAudio.clip = Music[CurrentSceneMusicTrack];
MainMusicAudio.Play();
}
}
public void ToggleMusic()
{
MusicIsMuted = !MusicIsMuted;
}
public void ToggleSound()
{
SoundIsMuted = !SoundIsMuted;
}
}
12 changes: 12 additions & 0 deletions Assets/Scripts/SoundController.cs.meta

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

30 changes: 30 additions & 0 deletions Assets/Scripts/VolumeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using UnityEngine;
using System.Collections;
using System;

public class VolumeController : MonoBehaviour {
private AudioSource AS;

public enum MyEnumListy { Music, Sound}
public MyEnumListy TypeOfAudio;

void Start()
{
AS = GetComponent<AudioSource>();
}
void Update()
{
switch (TypeOfAudio)
{
case MyEnumListy.Music:
AS.volume = SoundController.MusicVolume;
break;
case MyEnumListy.Sound:
AS.volume = SoundController.SoundVolume;
break;
default:
Debug.Log("NOTHING");
break;
}
}
}
12 changes: 12 additions & 0 deletions Assets/Scripts/VolumeController.cs.meta

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

35 changes: 35 additions & 0 deletions Assets/Scripts/background.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class background : MonoBehaviour {


Image bakgroundcolor;

static float happynes;

static float newColor = 1;


public Color A = Color.white;
public Color B;

// Use this for initialization
void Start () {

bakgroundcolor = GetComponent<Image>();
}

// Update is called once per frame
void Update () {

newColor = GameMaster.LevelOfdepresion / 255;
B = new Color(newColor, newColor, newColor, 1);
newColor = GameMaster.LevelOfdepresion / 255;
//print(newColor);
bakgroundcolor.color = Color.Lerp(bakgroundcolor.color, B, Time.deltaTime * 0.5f);


}
}
12 changes: 12 additions & 0 deletions Assets/Scripts/background.cs.meta

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

Binary file added Assets/Sprites/happyIdle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 823179a

Please sign in to comment.