public void Relocate() { float x = SpawnableObjectRelocationBoundary.GetRandomX(); float z = SpawnableObjectRelocationBoundary.GetRandomZ(); this.transform.position = new Vector3(player.transform.position.x + x, this.transform.position.y, player.transform.position.z + z); }
/// <summary> /// Repositions and reanimates the obstacle. /// </summary> public void Relocate() { float x = SpawnableObjectRelocationBoundary.GetRandomX(); float z = SpawnableObjectRelocationBoundary.GetRandomZ(); this.transform.position = new Vector3(player.transform.position.x + x, this.transform.position.y, player.transform.position.z + z); Grow(Constants.OBSTACLE_GROW_SPEED, (int)transform.localScale.x); }