Esempio n. 1
0
 void Awake()
 {
     // Start by moving the new Section onto the Treadmill (as a child of the object)
     treadmill        = GameManager.Instance.treadmill;
     transform.parent = treadmill.transform;
     ReferencePrefabs();
 }
Esempio n. 2
0
    public Treadmill CreateTreadmill(Actor actor)
    {
        Treadmill treadmill = new Treadmill(this, DefaultTreadmillRadius, actor);

        treadmills.Add(treadmill);
        return(treadmill);
    }
 protected void OnCollisionExit(Collision col)
 {
     if (col.collider.tag == "Treadmill")
     {
         curMill = null;
     }
 }
 public static void SetSerialPortName(string serialPortName)
 {
     if (m_woodway == null)
     {
         m_woodway = new Treadmill(serialPortName);
         m_woodway.Start();
     }
 }
 public static void SetSerialPortName(string serialPortName)
 {
     if (m_woodway == null)
     {
         m_woodway = new Treadmill(serialPortName);
         m_woodway.Start();
     }
 }
 protected void OnCollisionStay(Collision col)
 {
     if (curMill != null)
     {
         return;
     }
     if (col.collider.tag == "Treadmill")
     {
         curMill = col.collider.GetComponent <Treadmill>();
     }
 }
Esempio n. 7
0
        override public void runOnce()
        {
            treadmill = input.hen.findNearbyItem <Treadmill>();
            // if (target != null) {
            //  //this scripted movmement can hopefully be replaced by real animations later
            //  float bathSeekAcceleration = 0.02f; //TODO make this change depending on speed stat?

            //  input.hen.transform.LookAt(target.transform);
            //  //TODO keep rotation parallel to ground
            //  float yRot = input.hen.transform.rotation.eulerAngles.y;
            //  input.hen.transform.rotation = Quaternion.Euler(0, yRot, 0);

            //  input.hen.GetComponent<Rigidbody>().velocity += input.hen.transform.forward * bathSeekAcceleration;
            // }

            beforeExercisingPos          = input.hen.transform.position;
            input.hen.transform.position = treadmill.gameObject.transform.position + new Vector3(0, 0.5f, 0);
            input.hen.GetComponent <Rigidbody>().velocity = new Vector3(0, 0, 0);
            input.hen.GetComponent <Animator>().SetTrigger("inWater");
            Object.Instantiate(input.hen.bathingParticles, input.hen.transform.position, input.hen.bathingParticles.transform.rotation, treadmill.gameObject.transform);
        }
Esempio n. 8
0
    /* Search for and assign references to scene objects the GameManager needs to know about.
     */
    void LinkSceneObjects()
    {
        player = GameObject.FindGameObjectWithTag(Tags.PLAYER).GetComponent <Player> ();
        hud    = GameObject.Find(ObjectNames.HUD).GetComponent <HUD> ();
        // Link Player Spawn
        GameObject foundObject = GameObject.Find(ObjectNames.PLAYER_SPAWN);

        if (foundObject != null)
        {
            playerSpawn = (Transform)foundObject.transform;
            // Move spawnpoint to the player's starting point.
            playerSpawn.transform.position = player.transform.position;
        }

        // Link Treadmill
        foundObject = GameObject.Find(ObjectNames.TREADMILL);
        if (foundObject == null)
        {
            Debug.LogError("Cannot find treadmill. This map will not work without a Treadmill object.");
            return;
        }
        treadmill = (Treadmill)foundObject.GetComponent <Treadmill> ();
    }
Esempio n. 9
0
 public void DestroyTreadmill(Treadmill treadmill)
 {
     treadmills.Remove(treadmill);
     treadmill.ReleaseAll();
 }
Esempio n. 10
0
 /*
  * Finds and sets references to objects in the scene.
  */
 void LinkSceneReferences()
 {
     treadmill = GameManager.Instance.treadmill;
 }
Esempio n. 11
0
        public bool treadmillNearby()
        {
            Treadmill nearbyTreadmill = hen.findNearbyItem <Treadmill>();

            return(nearbyTreadmill != null && nearbyTreadmill.active && !nearbyTreadmill.occupied);
        }
Esempio n. 12
0
 public void finishExercise(Treadmill treadmill)
 {
     StartCoroutine(fitness.increase(1 + .5f * InventoryPersist.getTreadmillLevel()));
 }
Esempio n. 13
0
 void Awake()
 {
     treadmill = GameObject.Find (ObjectNames.TREADMILL).GetComponent<Treadmill> ();
 }
Esempio n. 14
0
 /*
  * Finds and sets references to objects in the scene.
  */
 void LinkSceneReferences()
 {
     treadmill = GameManager.Instance.treadmill;
 }
Esempio n. 15
0
 public void finishExercise(Treadmill treadmill)
 {
     StartCoroutine(fitness.increase(1));
 }
Esempio n. 16
0
 void Awake()
 {
     treadmill = GameObject.Find(ObjectNames.TREADMILL).GetComponent <Treadmill> ();
 }