mirror of
https://github.com/Kizuren/ShantiManti.git
synced 2026-01-10 00:20:18 +01:00
Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
283d0b981b | ||
|
|
306a64c933 | ||
|
|
0ced7d4da4 |
13 changed files with 108 additions and 8453 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -76,3 +76,4 @@ crashlytics-build.properties
|
|||
|
||||
# Auto-generated build files
|
||||
Assets/Resources/BuildInfo.txt*
|
||||
.utmp/
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 33587c0f08f467544a0a35ee2ec4bcdf
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -6,18 +6,18 @@ public class Endlevel : MonoBehaviour
|
|||
{
|
||||
public string levelToLoad = "Level2";
|
||||
public SceneFader sceneFader;
|
||||
public static int level = 0;
|
||||
private int SetLevel;
|
||||
public static int Level;
|
||||
private int _setLevel;
|
||||
|
||||
void Awake()
|
||||
private void Awake()
|
||||
{
|
||||
//Make Collider2D as trigger
|
||||
GetComponent<Collider2D>().isTrigger = true;
|
||||
level = PlayerSaving.Level;
|
||||
SetLevel = GetValueForSetLevel();
|
||||
Level = PlayerSaving.Level;
|
||||
_setLevel = GetValueForSetLevel();
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D c2d)
|
||||
private void OnTriggerEnter2D(Collider2D c2d)
|
||||
{
|
||||
if (c2d.CompareTag("Player"))
|
||||
{
|
||||
|
|
@ -25,27 +25,26 @@ public class Endlevel : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
private void Update()
|
||||
{
|
||||
if (level != PlayerSaving.Level)
|
||||
if (Level != PlayerSaving.Level)
|
||||
{
|
||||
if (PlayerSaving.Level < level)
|
||||
if (PlayerSaving.Level < Level)
|
||||
{
|
||||
PlayerSaving.Level = level;
|
||||
PlayerSaving.Level = Level;
|
||||
PlayerSaving.SavePlayer();
|
||||
//Debug.Log("Saved " + PlayerSaving.levels + " Level");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void GoToNextLevel()
|
||||
{
|
||||
level = SetLevel;
|
||||
Debug.Log(level);
|
||||
Level = _setLevel;
|
||||
Debug.Log(Level);
|
||||
sceneFader.FadeTo(levelToLoad);
|
||||
}
|
||||
|
||||
public int GetValueForSetLevel()
|
||||
private int GetValueForSetLevel()
|
||||
{
|
||||
if(!levelToLoad.StartsWith("level"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class PlayerSaving : MonoBehaviour
|
|||
|
||||
Debug.Log($"Loaded level: {Level}, coins: {Coins}, tutorial: {HasCompletedTutorial}, cloudsMove: {MovingClouds}");
|
||||
SC_2DCoin.TotalCoins = Coins;
|
||||
Endlevel.level = Level;
|
||||
Endlevel.Level = Level;
|
||||
}
|
||||
|
||||
public static void DeletePlayer()
|
||||
|
|
|
|||
|
|
@ -5,27 +5,26 @@ using System;
|
|||
|
||||
public class Clouds : MonoBehaviour
|
||||
{
|
||||
private Rigidbody2D rb;
|
||||
private Rigidbody2D _rb;
|
||||
public Transform clonePoint;
|
||||
public Transform destroyPoint;
|
||||
new public Transform camera;
|
||||
public new Transform camera;
|
||||
public GameObject cloudPrefab;
|
||||
public float speed = 5;
|
||||
public float height = 2.064558f;
|
||||
public float spaceBetween = 15.841f;
|
||||
//public float maxCloudClonesAtStart = 200;
|
||||
void Start()
|
||||
private void Start()
|
||||
{
|
||||
rb = GetComponent<Rigidbody2D>();
|
||||
_rb = GetComponent<Rigidbody2D>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
private void Update()
|
||||
{
|
||||
float distanceX = destroyPoint.position.x - transform.position.x;
|
||||
var distanceX = destroyPoint.position.x - transform.position.x;
|
||||
|
||||
if (!Pause.IsPause && CloudsToggle.cloudsCanMove)
|
||||
if (!Pause.IsPause && CloudsToggle.CloudsCanMove)
|
||||
{
|
||||
transform.position += Vector3.right * Time.deltaTime * speed;
|
||||
transform.position += Vector3.right * (Time.deltaTime * speed);
|
||||
//rb.velocity = transform.right * speed;
|
||||
if (distanceX <= 0)
|
||||
{
|
||||
|
|
@ -38,9 +37,9 @@ public class Clouds : MonoBehaviour
|
|||
UpdateYPosition(clonePoint);
|
||||
}
|
||||
|
||||
void UpdateYPosition(Transform targetTransform)
|
||||
private void UpdateYPosition(Transform targetTransform)
|
||||
{
|
||||
Vector3 newPosition = targetTransform.position;
|
||||
var newPosition = targetTransform.position;
|
||||
newPosition.y = camera.position.y + height;
|
||||
targetTransform.position = newPosition;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,51 +5,54 @@ using UnityEngine.UI;
|
|||
|
||||
public class CloudsToggle : MonoBehaviour
|
||||
{
|
||||
public static bool cloudsCanMove;
|
||||
public static bool CloudsCanMove;
|
||||
public Toggle cloudsToggle;
|
||||
bool previousCloudsCanMoveState;
|
||||
bool changingStates = false;
|
||||
private bool _previousCloudsCanMoveState;
|
||||
private bool _changingStates;
|
||||
|
||||
void Start()
|
||||
private static InputActions _inputActions;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
changingStates = true;
|
||||
|
||||
cloudsCanMove = PlayerSaving.MovingClouds;
|
||||
cloudsToggle.isOn = cloudsCanMove;
|
||||
previousCloudsCanMoveState = cloudsCanMove;
|
||||
|
||||
changingStates = false;
|
||||
_inputActions = new InputActions();
|
||||
_inputActions.Player.Clouds.performed += ctx => ChangeBool();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
private void Start()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.C))
|
||||
{
|
||||
ChangeBool();
|
||||
}
|
||||
_changingStates = true;
|
||||
|
||||
if (cloudsCanMove != previousCloudsCanMoveState)
|
||||
{
|
||||
//Debug.Log("State changed. Saving Clouds state: " + cloudsCanMove);
|
||||
PlayerSaving.MovingClouds = cloudsCanMove;
|
||||
PlayerSaving.SavePlayer();
|
||||
previousCloudsCanMoveState = cloudsCanMove;
|
||||
}
|
||||
CloudsCanMove = PlayerSaving.MovingClouds;
|
||||
cloudsToggle.isOn = CloudsCanMove;
|
||||
_previousCloudsCanMoveState = CloudsCanMove;
|
||||
|
||||
_changingStates = false;
|
||||
}
|
||||
|
||||
private void OnEnable() => _inputActions.Enable();
|
||||
|
||||
private void OnDisable() => _inputActions.Disable();
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (CloudsCanMove == _previousCloudsCanMoveState) return;
|
||||
|
||||
PlayerSaving.MovingClouds = CloudsCanMove;
|
||||
PlayerSaving.SavePlayer();
|
||||
_previousCloudsCanMoveState = CloudsCanMove;
|
||||
}
|
||||
|
||||
public void ChangeBool()
|
||||
{
|
||||
if (changingStates)
|
||||
if (_changingStates)
|
||||
{
|
||||
return;
|
||||
}
|
||||
changingStates = true;
|
||||
_changingStates = true;
|
||||
|
||||
cloudsToggle.isOn = !cloudsCanMove;
|
||||
cloudsCanMove = !cloudsCanMove;
|
||||
cloudsToggle.isOn = !CloudsCanMove;
|
||||
CloudsCanMove = !CloudsCanMove;
|
||||
|
||||
changingStates = false;
|
||||
//Debug.Log("Clouds state changed by user: " + cloudsCanMove);
|
||||
_changingStates = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,31 +5,31 @@ using System;
|
|||
|
||||
public class Mountains : MonoBehaviour
|
||||
{
|
||||
float horizontalMountainMove = 0;
|
||||
private Rigidbody2D rb;
|
||||
private float _horizontalMountainMove;
|
||||
private Rigidbody2D _rb;
|
||||
public Transform clonePoint;
|
||||
public Transform destroyPoint;
|
||||
//public Transform camera;
|
||||
public GameObject mountain;
|
||||
public float speed = 5;
|
||||
//public float height = 0.96f;
|
||||
void Start()
|
||||
private void Start()
|
||||
{
|
||||
rb = GetComponent<Rigidbody2D>();
|
||||
_rb = GetComponent<Rigidbody2D>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
private void Update()
|
||||
{
|
||||
if (horizontalMountainMove / 2 != PlayerMovement.HorizontalMove)
|
||||
if (!Mathf.Approximately(_horizontalMountainMove / 2, PlayerMovement.HorizontalMove))
|
||||
{
|
||||
horizontalMountainMove = PlayerMovement.HorizontalMove / 2;
|
||||
_horizontalMountainMove = PlayerMovement.HorizontalMove / 2;
|
||||
}
|
||||
|
||||
float distance = Vector2.Distance(transform.position, destroyPoint.position);
|
||||
int distanceOfDestroyPoint = (int)Math.Round(distance);
|
||||
var distance = Vector2.Distance(transform.position, destroyPoint.position);
|
||||
var distanceOfDestroyPoint = (int)Math.Round(distance);
|
||||
if (!Pause.IsPause)
|
||||
{
|
||||
transform.position += Vector3.left * horizontalMountainMove * Time.deltaTime * speed;
|
||||
transform.position += Vector3.left * (_horizontalMountainMove * Time.deltaTime * speed);
|
||||
//rb.velocity = transform.right * speed * horizontalMountainMove;
|
||||
if (distanceOfDestroyPoint <= 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,19 +7,22 @@ public class Weapon : MonoBehaviour
|
|||
public Transform firePoint;
|
||||
public GameObject bulletPrefab;
|
||||
private bool _canShoot = true;
|
||||
|
||||
private void Update()
|
||||
|
||||
private static InputActions _inputActions;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Pause.IsPause)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Input.GetButtonDown("Fire1"))
|
||||
_inputActions = new InputActions();
|
||||
_inputActions.Player.Attack.performed += ctx =>
|
||||
{
|
||||
if (Pause.IsPause) return;
|
||||
Shoot();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void OnEnable() => _inputActions.Enable();
|
||||
|
||||
private void OnDisable() => _inputActions.Disable();
|
||||
|
||||
private void Shoot()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"com.unity.ai.navigation": "2.0.5",
|
||||
"com.unity.analytics": "3.8.1",
|
||||
"com.unity.cinemachine": "3.1.2",
|
||||
"com.unity.collab-proxy": "2.5.2",
|
||||
"com.unity.collab-proxy": "2.6.0",
|
||||
"com.unity.feature.2d": "2.0.1",
|
||||
"com.unity.ide.rider": "3.0.34",
|
||||
"com.unity.ide.visualstudio": "2.0.22",
|
||||
|
|
|
|||
|
|
@ -14,12 +14,12 @@
|
|||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.2d.aseprite": {
|
||||
"version": "1.1.6",
|
||||
"version": "1.1.7",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.2d.common": "6.0.6",
|
||||
"com.unity.2d.sprite": "1.0.0",
|
||||
"com.unity.2d.common": "6.0.6",
|
||||
"com.unity.mathematics": "1.2.6",
|
||||
"com.unity.modules.animation": "1.0.0"
|
||||
},
|
||||
|
|
@ -30,11 +30,11 @@
|
|||
"depth": 2,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.burst": "1.8.4",
|
||||
"com.unity.2d.sprite": "1.0.0",
|
||||
"com.unity.mathematics": "1.1.0",
|
||||
"com.unity.modules.uielements": "1.0.0",
|
||||
"com.unity.modules.animation": "1.0.0",
|
||||
"com.unity.modules.uielements": "1.0.0"
|
||||
"com.unity.burst": "1.8.4"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
|
|
@ -66,8 +66,8 @@
|
|||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.2d.common": "9.0.7",
|
||||
"com.unity.mathematics": "1.1.0",
|
||||
"com.unity.2d.common": "9.0.7",
|
||||
"com.unity.modules.physics2d": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
|
|
@ -86,8 +86,8 @@
|
|||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.2d.tilemap": "1.0.0",
|
||||
"com.unity.modules.tilemap": "1.0.0",
|
||||
"com.unity.2d.tilemap": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
|
|
@ -106,8 +106,8 @@
|
|||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.ugui": "1.0.0",
|
||||
"com.unity.services.analytics": "1.0.4"
|
||||
"com.unity.services.analytics": "1.0.4",
|
||||
"com.unity.ugui": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.collab-proxy": {
|
||||
"version": "2.5.2",
|
||||
"version": "2.6.0",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
|
|
@ -143,8 +143,8 @@
|
|||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.burst": "1.8.17",
|
||||
"com.unity.test-framework": "1.4.5",
|
||||
"com.unity.nuget.mono-cecil": "1.11.4",
|
||||
"com.unity.test-framework": "1.4.5",
|
||||
"com.unity.test-framework.performance": "3.0.3"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
|
|
@ -168,7 +168,7 @@
|
|||
"com.unity.2d.spriteshape": "10.0.7",
|
||||
"com.unity.2d.tilemap": "1.0.0",
|
||||
"com.unity.2d.tilemap.extras": "4.1.0",
|
||||
"com.unity.2d.aseprite": "1.1.6"
|
||||
"com.unity.2d.aseprite": "1.1.7"
|
||||
}
|
||||
},
|
||||
"com.unity.ide.rider": {
|
||||
|
|
@ -239,13 +239,13 @@
|
|||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.services.core": {
|
||||
"version": "1.13.0",
|
||||
"version": "1.14.0",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.modules.androidjni": "1.0.0",
|
||||
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||
"com.unity.nuget.newtonsoft-json": "3.2.1",
|
||||
"com.unity.modules.unitywebrequest": "1.0.0"
|
||||
"com.unity.modules.androidjni": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
|
|
@ -257,13 +257,12 @@
|
|||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.splines": {
|
||||
"version": "2.6.1",
|
||||
"version": "2.7.2",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.ugui": "1.0.0",
|
||||
"com.unity.mathematics": "1.2.1",
|
||||
"com.unity.settings-manager": "1.0.3"
|
||||
"com.unity.settings-manager": "1.0.3",
|
||||
"com.unity.mathematics": "1.2.1"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
|
|
@ -309,9 +308,9 @@
|
|||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.modules.audio": "1.0.0",
|
||||
"com.unity.modules.director": "1.0.0",
|
||||
"com.unity.modules.animation": "1.0.0",
|
||||
"com.unity.modules.audio": "1.0.0",
|
||||
"com.unity.modules.particlesystem": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@ PlayerSettings:
|
|||
androidMaxAspectRatio: 2.1
|
||||
androidMinAspectRatio: 1
|
||||
applicationIdentifier:
|
||||
Android: com.MarcUs7i.ShantiManti
|
||||
Standalone: com.DefaultCompany.2DProject
|
||||
iPhone: com.marc.shantimanti
|
||||
buildNumber:
|
||||
|
|
@ -589,6 +590,9 @@ PlayerSettings:
|
|||
- serializedVersion: 3
|
||||
m_BuildTarget: Android
|
||||
m_Formats: 03000000
|
||||
- serializedVersion: 3
|
||||
m_BuildTarget: WebGL
|
||||
m_Formats: 05000000
|
||||
playModeTestRunnerEnabled: 0
|
||||
runPlayModeTestAsEditModeTest: 0
|
||||
actionOnDotNetUnhandledException: 1
|
||||
|
|
@ -856,6 +860,8 @@ PlayerSettings:
|
|||
webWasm2023: 0
|
||||
scriptingDefineSymbols: {}
|
||||
additionalCompilerArguments:
|
||||
Android:
|
||||
- /langversion:latest
|
||||
Standalone:
|
||||
- /langversion:latest
|
||||
platformArchitecture: {}
|
||||
|
|
@ -971,7 +977,7 @@ PlayerSettings:
|
|||
qnxGraphicConfPath:
|
||||
apiCompatibilityLevel: 6
|
||||
captureStartupLogs: {}
|
||||
activeInputHandler: 2
|
||||
activeInputHandler: 1
|
||||
windowsGamepadBackendHint: 0
|
||||
cloudProjectId: da2feb68-c12b-4efb-becb-3051c43020ea
|
||||
framebufferDepthMemorylessMode: 0
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
m_EditorVersion: 6000.0.30f1
|
||||
m_EditorVersionWithRevision: 6000.0.30f1 (62b05ba0686a)
|
||||
m_EditorVersion: 6000.0.33f1
|
||||
m_EditorVersionWithRevision: 6000.0.33f1 (433b0a79340b)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue