Commit 3685d7a3 authored by Frederic Nicolas Schneider's avatar Frederic Nicolas Schneider
Browse files

Merge remote-tracking branch 'origin/master'

parents 7feaf2bc 12dfe7c5
......@@ -478,7 +478,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -300, y: 0}
m_AnchoredPosition: {x: -250, y: 0}
m_SizeDelta: {x: 300, y: 90}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &330042300
......@@ -1174,7 +1174,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 200, y: 0}
m_AnchoredPosition: {x: 150, y: 0}
m_SizeDelta: {x: 400, y: 90}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1567679652
......
......@@ -11580,6 +11580,11 @@ PrefabInstance:
propertyPath: m_Name
value: Game Manager
objectReference: {fileID: 0}
- target: {fileID: 5039903204970821658, guid: bf18cb00ef043184eb50a0f82e61aba6,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6970042148868717514, guid: bf18cb00ef043184eb50a0f82e61aba6,
type: 3}
propertyPath: m_LocalPosition.x
......@@ -11635,11 +11640,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5039903204970821658, guid: bf18cb00ef043184eb50a0f82e61aba6,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7393841134299425669, guid: bf18cb00ef043184eb50a0f82e61aba6,
type: 3}
propertyPath: m_havePropertiesChanged
......@@ -24673,7 +24673,7 @@ PrefabInstance:
- target: {fileID: 3450176123358320517, guid: 27452f8a6ee77ca41b798823eab9710e,
type: 3}
propertyPath: m_LocalPosition.x
value: 33.8
value: -7
objectReference: {fileID: 0}
- target: {fileID: 3450176123358320517, guid: 27452f8a6ee77ca41b798823eab9710e,
type: 3}
......
......@@ -63,11 +63,12 @@ public class GroupController : MonoBehaviour, IKillTarget
ActiveLemmingIndex = 0;
SetActiveLemming(ActiveLemmingIndex);
while (gameManager.getInstance().currentLemmings > gameManager.getInstance().maxLemming)
{
RemoveLemmingFromGroup();
}
//while (gameManager.getInstance().currentLemmings > gameManager.getInstance().maxLemming)
//{
// Debug.Log("Remove im Awake");
// RemoveLemmingFromGroup();
//}
gameManager.getInstance().currentLemmings = gameManager.getInstance().maxLemming;
gameManager.currentLemmingText.text = "Leben: " + gameManager.getInstance().currentLemmings;
......@@ -104,17 +105,19 @@ public class GroupController : MonoBehaviour, IKillTarget
ActiveLemmingIndex = 0;
SetActiveLemming(ActiveLemmingIndex);
while (gameManager.getInstance().currentLemmings > gameManager.getInstance().MaxLevelLemming)
{
RemoveLemmingFromGroup();
}
//while (gameManager.getInstance().currentLemmings > gameManager.getInstance().MaxLevelLemming)
//{
// Debug.Log("Remove im Start");
// RemoveLemmingFromGroup();
//}
rbGroup = GetComponent<Rigidbody2D>();
CamController = GetComponent<CamController>();
CamController.initTargets(this);
}
}
}
private void FixedUpdate()
{
......
......@@ -93,7 +93,7 @@ public class GameManager : MonoBehaviour
instance.FireButtonDisable();
}
else if (instance.level==2)
else if (instance.level==2)
{
instance.BombButtonDisable();
}
......@@ -104,13 +104,15 @@ public class GameManager : MonoBehaviour
}
//Sets this to not be destroyed when reloading scene
DontDestroyOnLoad(gameObject);
if (SceneManager.GetActiveScene().name.Contains("Level"))
playMusic.Play();
maxLemming= MaxLevelLemming;
maxLemming = MaxLevelLemming;
}
private void Start()
{
if(Application.platform == RuntimePlatform.Android)
if (Application.platform == RuntimePlatform.Android)
{
Screen.SetResolution(800, 480, true);
}
......@@ -138,13 +140,13 @@ public class GameManager : MonoBehaviour
switch (level)
{
case 1:
MaxLevelLemming = 7;
getInstance().MaxLevelLemming = 7;
break;
case 2:
MaxLevelLemming = 4;
getInstance().MaxLevelLemming = 4;
break;
case 3:
MaxLevelLemming = 4;
getInstance().MaxLevelLemming = 4;
break;
case 4:
SceneManager.LoadScene("Ending", LoadSceneMode.Single);
......@@ -154,6 +156,8 @@ public class GameManager : MonoBehaviour
break;
}
getInstance().maxLemming = getInstance().MaxLevelLemming;
PlayerPrefs.SetInt("level", level);
PlayerPrefs.SetInt("currentLemmings", currentLemmings);
PlayerPrefs.SetInt("maxLemminge", MaxLevelLemming);
......@@ -165,8 +169,21 @@ public class GameManager : MonoBehaviour
currentLemmingText.text = "Leben: " + currentLemmings;
if(level<4)
SceneManager.LoadScene("Level " + level, LoadSceneMode.Single);
SceneManager.sceneLoaded += OnLevelLoaded;
}
public void OnLevelLoaded(Scene scene, LoadSceneMode mode)
{
GroupController groupController = FindObjectOfType<GroupController>();
if (SceneManager.GetActiveScene().name.Equals("Level " + level))
{
while (currentLemmings > MaxLevelLemming)
groupController.RemoveLemmingFromGroup();
}
SceneManager.sceneLoaded -= OnLevelLoaded;
}
public void EnableIngameUI(bool enable)
{
......@@ -382,6 +399,10 @@ public class GameManager : MonoBehaviour
public void ResetProgress()
{
instance.currentLemmings = 7;
instance.MaxLevelLemming = 7;
instance.level = 1;
instance.maxLemming = 7;
PlayerPrefs.SetInt("level", instance.level = 1);
PlayerPrefs.SetInt("currentLemmings", instance.currentLemmings =7);
PlayerPrefs.SetInt("maxLemminge", instance.MaxLevelLemming = 7);
......
......@@ -76,6 +76,7 @@ public class MenuController : MonoBehaviour
public void ContinueGame_Click()
{
//menuUI.SetActive(false);
SceneManager.sceneLoaded += gameManager.OnLevelLoaded;
SceneManager.LoadScene("Level " + gameManager.level, LoadSceneMode.Single);
gameManager.currentLemmingText.text = "Leben: " + gameManager.currentLemmings;
gameManager.playMusic.enabled = true;
......
......@@ -38,7 +38,6 @@ GraphicsSettings:
- {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
......
Supports Markdown
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