added player and danger platfroms
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using VContainer;
|
||||
|
||||
@@ -5,13 +6,30 @@ public class PlatformManager : MonoBehaviour
|
||||
{
|
||||
private GameObject currentPlatfrom;
|
||||
[Inject] private PlatformPool pool;
|
||||
|
||||
[Inject] private InputReader inputReader;
|
||||
private int yPos=0;
|
||||
|
||||
public int rotspeed = 1;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
ShowInitialPlatforms();
|
||||
}
|
||||
private void OnEnable()
|
||||
{
|
||||
inputReader.OnDragValueChanged += DragPerformed;
|
||||
}
|
||||
private void OnDisable()
|
||||
{
|
||||
inputReader.OnDragValueChanged -= DragPerformed;
|
||||
}
|
||||
|
||||
private void DragPerformed(Vector2 drag)
|
||||
{
|
||||
float rotAmount = -drag.normalized.x * rotspeed;
|
||||
transform.Rotate(0, rotAmount, 0);
|
||||
}
|
||||
|
||||
public void ShowInitialPlatforms()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user