diff --git a/Assets/Resources/Prefabs.meta b/Assets/Resources/Prefabs.meta new file mode 100644 index 0000000..e74295f --- /dev/null +++ b/Assets/Resources/Prefabs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 77b030cbe6e55b84995e0b19ad5edf41 +folderAsset: yes +timeCreated: 1454137016 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Prefabs/Platform_DefaultSprite.prefab b/Assets/Resources/Prefabs/Platform_DefaultSprite.prefab new file mode 100644 index 0000000..934b28d Binary files /dev/null and b/Assets/Resources/Prefabs/Platform_DefaultSprite.prefab differ diff --git a/Assets/Resources/Prefabs/Platform_DefaultSprite.prefab.meta b/Assets/Resources/Prefabs/Platform_DefaultSprite.prefab.meta new file mode 100644 index 0000000..7f327ff --- /dev/null +++ b/Assets/Resources/Prefabs/Platform_DefaultSprite.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b6ab4d9290eb1340871ca2a666fdf3a +timeCreated: 1454137026 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Prefabs/x2_Platform.prefab b/Assets/Resources/Prefabs/x2_Platform.prefab new file mode 100644 index 0000000..baac679 Binary files /dev/null and b/Assets/Resources/Prefabs/x2_Platform.prefab differ diff --git a/Assets/Resources/Prefabs/x2_Platform.prefab.meta b/Assets/Resources/Prefabs/x2_Platform.prefab.meta new file mode 100644 index 0000000..94a1881 --- /dev/null +++ b/Assets/Resources/Prefabs/x2_Platform.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 123a3302024907640b1eacd26c56b491 +timeCreated: 1454130783 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Prefabs/x4_Platform.prefab b/Assets/Resources/Prefabs/x4_Platform.prefab new file mode 100644 index 0000000..658376b Binary files /dev/null and b/Assets/Resources/Prefabs/x4_Platform.prefab differ diff --git a/Assets/Resources/Prefabs/x4_Platform.prefab.meta b/Assets/Resources/Prefabs/x4_Platform.prefab.meta new file mode 100644 index 0000000..0cf5c0f --- /dev/null +++ b/Assets/Resources/Prefabs/x4_Platform.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 85e93861e3c44054ab770f5c292bb137 +timeCreated: 1454130735 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Scenes/PlatformTestScene.unity b/Assets/Resources/Scenes/PlatformTestScene.unity new file mode 100644 index 0000000..c099ea6 Binary files /dev/null and b/Assets/Resources/Scenes/PlatformTestScene.unity differ diff --git a/Assets/Resources/Scenes/PlatformTestScene.unity.meta b/Assets/Resources/Scenes/PlatformTestScene.unity.meta new file mode 100644 index 0000000..988a73c --- /dev/null +++ b/Assets/Resources/Scenes/PlatformTestScene.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 72a1b0a7d41c0424083f12b50eaa8b53 +timeCreated: 1454122295 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Scripts.meta b/Assets/Resources/Scripts.meta index 4aa39f6..6b049ad 100644 --- a/Assets/Resources/Scripts.meta +++ b/Assets/Resources/Scripts.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: b429bbc6158b76c4dbab3e6bf3519827 +guid: 3fa83265e1d3e234db4e457a26505779 folderAsset: yes -timeCreated: 1454119671 +timeCreated: 1454123185 licenseType: Free DefaultImporter: userData: diff --git a/Assets/Resources/Scripts/GameManager.cs b/Assets/Resources/Scripts/GameManager.cs index 9ae8b37..8aa77e6 100644 --- a/Assets/Resources/Scripts/GameManager.cs +++ b/Assets/Resources/Scripts/GameManager.cs @@ -15,6 +15,7 @@ public class GameManager : MonoBehaviour { if (gManager == null) { + DontDestroyOnLoad(gameObject); gManager = this; iManager = new InputManager(0.1f, 0.2f); tagged_objects = GameObject.FindGameObjectsWithTag("Scene_Object"); diff --git a/Assets/Resources/Scripts/Platform.cs b/Assets/Resources/Scripts/Platform.cs new file mode 100644 index 0000000..53d90db --- /dev/null +++ b/Assets/Resources/Scripts/Platform.cs @@ -0,0 +1,44 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +[ExecuteInEditMode] +public class Platform : MonoBehaviour +{ + public Sprite sprite; + public int addNum; + public GameObject prefab; + public bool isParent = true; + int oldNum = 0; + + // Update is called once per frame + void Update () + { + //Updates all of the children's SpriteRender sprites + foreach (SpriteRenderer i in GetComponentsInChildren()) + { + i.sprite = sprite; + } + + /*Vector3 curPos = this.transform.position; + float scaleX = this.transform.lossyScale.x; + + if (this.gameObject.transform.childCount < addNum && !Application.isPlaying && isParent) + { + for (int i = 0; i < addNum - oldNum; i++) + { + curPos = curPos + new Vector3(scaleX, 0); + GameObject childObj = Instantiate(prefab, curPos, Quaternion.identity) as GameObject; + childObj.GetComponent().isParent = false; + childObj.transform.parent = transform; + curPos = childObj.transform.position; + transform.GetChild(transform.childCount); + } + for (int i = 0; i < oldNum - addNum; i++) + { + Destroy(transform.GetChild(transform.childCount)); + } + oldNum = addNum; + }*/ + } +} diff --git a/Assets/Resources/Scripts/Platform.cs.meta b/Assets/Resources/Scripts/Platform.cs.meta new file mode 100644 index 0000000..d6308ed --- /dev/null +++ b/Assets/Resources/Scripts/Platform.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a62f48d093e14da4688460ed30cf5da0 +timeCreated: 1454130969 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/EditorSettings.asset b/ProjectSettings/EditorSettings.asset index 75181f1..e06868b 100644 Binary files a/ProjectSettings/EditorSettings.asset and b/ProjectSettings/EditorSettings.asset differ diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 654f2ec..0128a24 100644 Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 961ebb9..bb60c06 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 5.3.1f1 +m_EditorVersion: 5.3.2f1 m_StandardAssetsVersion: 0