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(); }
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(); } }
protected void OnCollisionStay(Collision col) { if (curMill != null) { return; } if (col.collider.tag == "Treadmill") { curMill = col.collider.GetComponent <Treadmill>(); } }
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); }
/* 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> (); }
public void DestroyTreadmill(Treadmill treadmill) { treadmills.Remove(treadmill); treadmill.ReleaseAll(); }
/* * Finds and sets references to objects in the scene. */ void LinkSceneReferences() { treadmill = GameManager.Instance.treadmill; }
public bool treadmillNearby() { Treadmill nearbyTreadmill = hen.findNearbyItem <Treadmill>(); return(nearbyTreadmill != null && nearbyTreadmill.active && !nearbyTreadmill.occupied); }
public void finishExercise(Treadmill treadmill) { StartCoroutine(fitness.increase(1 + .5f * InventoryPersist.getTreadmillLevel())); }
void Awake() { treadmill = GameObject.Find (ObjectNames.TREADMILL).GetComponent<Treadmill> (); }
public void finishExercise(Treadmill treadmill) { StartCoroutine(fitness.increase(1)); }
void Awake() { treadmill = GameObject.Find(ObjectNames.TREADMILL).GetComponent <Treadmill> (); }