Esempio n. 1
0
        // Start is called before the first frame update
        void Start()
        {
            var points = gameObject.GetComponentsInChildren <MovingPlatformDestination>();

            pointA = points[0];
            pointB = points[1];

            platformRB.transform.position = pointA.transform.position;
            currentDestination            = pointB;
        }
Esempio n. 2
0
 public void SwitchDirections()
 {
     if (currentDestination == pointA)
     {
         currentDestination = pointB;
     }
     else
     {
         currentDestination = pointA;
     }
 }