Advertisement
Pro_Unit

CenterInputController

Feb 10th, 2019
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. using DG.Tweening;
  2.  
  3. using System.Collections;
  4. using System.Collections.Generic;
  5.  
  6. using UnityEngine;
  7. namespace CyberBeat
  8. {
  9.     [CreateAssetMenu (fileName = "CenterInputController", menuName = "CyberBeat/InputController/Center")]
  10.     public class CenterInputController : AInputController
  11.     {
  12.  
  13.         float duration { get { return settings.SwipeDuration / 2f; } }
  14.         Rigidbody rb;
  15.         public override void Awake ()
  16.         {
  17.             rightPath = new Vector3[] { Vector3.right * settings.width, Vector3.zero };
  18.             leftPath = new Vector3[] { Vector3.left * settings.width, Vector3.zero };
  19.         }
  20.         //Call In Update
  21.        
  22.         public override void MoveRight ()
  23.         {
  24.             Target.DOLocalPath (rightPath, duration);
  25.         }
  26.         public override void MoveLeft ()
  27.         {
  28.             Target.DOLocalPath (leftPath, duration);
  29.         }
  30.  
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement