void Awake() { Debug.Log("FEATUREPEDOMETER:AWAKE"); if (instance == null) { instance = this; } // keep object alive in all scenes DontDestroyOnLoad(gameObject); }
public void registerSteps() { DAO database = new DAO(); Pedometer ped = database.GetPedometerInfo(FacebookManager.Instance().user_ID); ped.Total_step += FeaturePedometer.Instance().stepCnt; pedometersteps += FeaturePedometer.Instance().stepCnt; Augmon aug = database.GetAugmonInfo(FacebookManager.Instance().user_ID); aug.Lvl += (int)(FeaturePedometer.Instance().stepCnt / 100); FeaturePedometer.Instance().stepCnt = 0; //update database database.UpdateAugmon(aug); database.UpdatePedometer(ped); }
// Update is called once per frame void Update() { float length = Mathf.Abs(endPosition - startPosition); int delta = FeaturePedometer.Instance().stepCnt; steptext.text = "Steps - " + ((pedometersteps + delta) % 100) + "%"; length = length * (((pedometersteps + delta) % 100) / 100); if ((int)startPosition > (int)endPosition) { rTrans.anchoredPosition = new Vector2(startPosition - length, rTrans.anchoredPosition.y); } if ((int)startPosition < (int)endPosition) { rTrans.anchoredPosition = new Vector2(startPosition + length, rTrans.anchoredPosition.y); } NavDrawerConfig config = GameObject.Find("Nav Drawer").GetComponent <NavDrawerConfig> (); if (config.isClosed() && !isClosed) { stepsOnClick(); } }
// Use this for initialization void Start() { // This line works because the instance is initialized in the // Splash scene no need for if clause fp = FeaturePedometer.Instance(); }
// Update is called once per frame void Update() { profile.sprite = FacebookManager.Instance().ProfilePic; header.text = FacebookManager.Instance().FullName; subtitle.text = "Step Count: " + ((int)HealthBarScript.pedometersteps + FeaturePedometer.Instance().stepCnt); }