37 lines
746 B
C#
37 lines
746 B
C#
using FlappyBird.Core;
|
|
using FlappyBird.Pipes;
|
|
using UnityEngine;
|
|
using Zenject;
|
|
|
|
namespace FlappyBird.Ground
|
|
{
|
|
public class GroundView : MonoBehaviour, Core.IPoolable
|
|
{
|
|
private Transform _cachedTransform;
|
|
|
|
public float XPosition => _cachedTransform.position.x;
|
|
|
|
private void Awake()
|
|
{
|
|
_cachedTransform = transform;
|
|
}
|
|
|
|
public void SetPosition(Vector3 position)
|
|
{
|
|
_cachedTransform.position = position;
|
|
}
|
|
|
|
public void MoveLeft(float distance)
|
|
{
|
|
_cachedTransform.position += Vector3.left * distance;
|
|
}
|
|
|
|
public void OnSpawned()
|
|
{
|
|
}
|
|
|
|
public void OnDespawned()
|
|
{
|
|
}
|
|
}
|
|
} |