40 lines
No EOL
1.8 KiB
C#
40 lines
No EOL
1.8 KiB
C#
using UnityEngine;
|
||
using System.Collections;
|
||
using System;
|
||
using PedometerU.Tests;
|
||
|
||
namespace Assets.SimpleAndroidNotifications
|
||
{
|
||
public class RunningMan : MonoBehaviour
|
||
{
|
||
public float m_Speed = 100f;
|
||
public float faster = 1f;
|
||
|
||
private Vector3 m_RotationDirection = Vector3.forward;
|
||
|
||
public void Start()
|
||
{
|
||
NotificationManager.SendWithAppIcon(TimeSpan.FromSeconds(1), "Monster Chase", "You're almost there!", new Color(81f/255f, 128f/255f, 1), NotificationIcon.Heart);
|
||
}
|
||
|
||
public void ToggleRotationDirection()
|
||
{
|
||
Debug.Log ("Toggling rotation direction");
|
||
|
||
if (m_RotationDirection == Vector3.up)
|
||
{
|
||
m_RotationDirection = Vector3.down;
|
||
}
|
||
else
|
||
{
|
||
m_RotationDirection = Vector3.up;
|
||
}
|
||
}
|
||
|
||
void Update()
|
||
{
|
||
Time.timeScale = 5;
|
||
transform.Rotate(m_RotationDirection * (Mathf.Sin(Time.time) / 20f) * m_Speed);
|
||
}
|
||
}
|
||
} |