update.
This commit is contained in:
commit
8bf1d021d7
20 changed files with 153 additions and 0 deletions
BIN
MoCha/Assets/Resources/circle_eye_image.prefab
Normal file
BIN
MoCha/Assets/Resources/circle_eye_image.prefab
Normal file
Binary file not shown.
10
MoCha/Assets/Resources/circle_eye_image.prefab.meta
Normal file
10
MoCha/Assets/Resources/circle_eye_image.prefab.meta
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4a4fde6f4bcd870428fb25f66c76feda
|
||||||
|
timeCreated: 1524762805
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 100100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
MoCha/Assets/Resources/circle_head_image.prefab
Normal file
BIN
MoCha/Assets/Resources/circle_head_image.prefab
Normal file
Binary file not shown.
10
MoCha/Assets/Resources/circle_head_image.prefab.meta
Normal file
10
MoCha/Assets/Resources/circle_head_image.prefab.meta
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 17e057f002b6d4d4abe4ccae6e998c00
|
||||||
|
timeCreated: 1524762803
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 100100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
MoCha/Assets/Resources/crazy_hair_image.prefab
Normal file
BIN
MoCha/Assets/Resources/crazy_hair_image.prefab
Normal file
Binary file not shown.
10
MoCha/Assets/Resources/crazy_hair_image.prefab.meta
Normal file
10
MoCha/Assets/Resources/crazy_hair_image.prefab.meta
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a1ad8d38f08702348b0e63b8c49b482f
|
||||||
|
timeCreated: 1524762812
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 100100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
MoCha/Assets/Resources/crown_image.prefab
Normal file
BIN
MoCha/Assets/Resources/crown_image.prefab
Normal file
Binary file not shown.
10
MoCha/Assets/Resources/crown_image.prefab.meta
Normal file
10
MoCha/Assets/Resources/crown_image.prefab.meta
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4d1dba5ba5d31be4f87d19fb4146e82b
|
||||||
|
timeCreated: 1524762810
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 100100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
MoCha/Assets/Resources/gap_mouth_image.prefab
Normal file
BIN
MoCha/Assets/Resources/gap_mouth_image.prefab
Normal file
Binary file not shown.
10
MoCha/Assets/Resources/gap_mouth_image.prefab.meta
Normal file
10
MoCha/Assets/Resources/gap_mouth_image.prefab.meta
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c3a3cdcad44ece64eacba6510fed2d60
|
||||||
|
timeCreated: 1524762814
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 100100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
MoCha/Assets/Resources/pig_nose_image.prefab
Normal file
BIN
MoCha/Assets/Resources/pig_nose_image.prefab
Normal file
Binary file not shown.
10
MoCha/Assets/Resources/pig_nose_image.prefab.meta
Normal file
10
MoCha/Assets/Resources/pig_nose_image.prefab.meta
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d9ed6d35f30959f49b8b8d1efd33c997
|
||||||
|
timeCreated: 1524762808
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 100100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Binary file not shown.
Binary file not shown.
|
@ -4,6 +4,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
//Pretty much a copy of GetData...
|
//Pretty much a copy of GetData...
|
||||||
namespace PedometerU.Tests {
|
namespace PedometerU.Tests {
|
||||||
|
@ -11,6 +12,8 @@ namespace PedometerU.Tests {
|
||||||
public class GetGoals : MonoBehaviour {
|
public class GetGoals : MonoBehaviour {
|
||||||
|
|
||||||
public Image background;
|
public Image background;
|
||||||
|
private string[] items = { "circle_eye", "crazy_hair", "circle_head", "gap_mouth", "pig_nose", "crown" };
|
||||||
|
|
||||||
public Text goalText;
|
public Text goalText;
|
||||||
public string currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy");
|
public string currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy");
|
||||||
public string goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy");
|
public string goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy");
|
||||||
|
@ -159,6 +162,12 @@ public class GetGoals : MonoBehaviour {
|
||||||
savedPoints += stepsGoal*10;
|
savedPoints += stepsGoal*10;
|
||||||
PlayerPrefs.SetInt("totalPoints", savedPoints);
|
PlayerPrefs.SetInt("totalPoints", savedPoints);
|
||||||
pointsText.text = "Points: " + PlayerPrefs.GetInt("totalPoints").ToString ();
|
pointsText.text = "Points: " + PlayerPrefs.GetInt("totalPoints").ToString ();
|
||||||
|
|
||||||
|
//Random item
|
||||||
|
StringBuilder invList = new StringBuilder ();
|
||||||
|
invList.Append(PlayerPrefs.GetString ("inventory"));
|
||||||
|
invList.Append(items[(int)Math.Round(UnityEngine.Random.value*6.0f)]).Append(" ");
|
||||||
|
PlayerPrefs.SetString ("inventory", invList.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
//only applies if "daily" goal
|
//only applies if "daily" goal
|
||||||
|
|
34
MoCha/Assets/Scripts/MonsterDraw.cs
Normal file
34
MoCha/Assets/Scripts/MonsterDraw.cs
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class MonsterDraw : MonoBehaviour {
|
||||||
|
|
||||||
|
public GameObject anchorPoint;
|
||||||
|
|
||||||
|
|
||||||
|
private Vector2 anchorPos;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
anchorPos = new Vector2 (anchorPoint.transform.position.x, anchorPoint.transform.position.y);
|
||||||
|
loadMonster();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadMonster ()
|
||||||
|
{
|
||||||
|
string equippedString = PlayerPrefs.GetString("Equipped");
|
||||||
|
string[] equipped = equippedString.Split (' ');
|
||||||
|
|
||||||
|
for (int i = 0; i < equipped.Length - 1; i++) {
|
||||||
|
string savedString = PlayerPrefs.GetString(equipped[i]);
|
||||||
|
string[] values = savedString.Split ();
|
||||||
|
GameObject instance = (GameObject)Instantiate(Resources.Load(equipped[i]));
|
||||||
|
//instance.rectTransform.anchoredPosition = new Vector2(float.Parse(values[0]), float.Parse(values[1]));
|
||||||
|
instance.name = equipped [i];
|
||||||
|
//instance.GetComponent<DragAndDrop> ().inventory = inv;
|
||||||
|
instance.transform.position = new Vector2(float.Parse(values[0]), float.Parse(values[1]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
13
MoCha/Assets/Scripts/MonsterDraw.cs.meta
Normal file
13
MoCha/Assets/Scripts/MonsterDraw.cs.meta
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 709c87110c75f4e4c83650b83f4b96ae
|
||||||
|
timeCreated: 1524754933
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
24
MoCha/Assets/Scripts/StatsUpdate.cs
Normal file
24
MoCha/Assets/Scripts/StatsUpdate.cs
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
public class StatsUpdate : MonoBehaviour {
|
||||||
|
|
||||||
|
public Text score;
|
||||||
|
public Text steps;
|
||||||
|
public Text distance;
|
||||||
|
|
||||||
|
// Use this for initialization
|
||||||
|
void Start () {
|
||||||
|
steps.text = PlayerPrefs.GetInt("currentSteps").ToString();
|
||||||
|
score.text = PlayerPrefs.GetInt("totalPoints").ToString();
|
||||||
|
distance.text = ((float)PlayerPrefs.GetInt("currentSteps")/2000.0f).ToString() + " mi.";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update () {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
13
MoCha/Assets/Scripts/StatsUpdate.cs.meta
Normal file
13
MoCha/Assets/Scripts/StatsUpdate.cs.meta
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7edf082a74403478192a66b0b815e18b
|
||||||
|
timeCreated: 1524763129
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Binary file not shown.
Reference in a new issue