コード例 #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;
        }
コード例 #2
0
 public void SwitchDirections()
 {
     if (currentDestination == pointA)
     {
         currentDestination = pointB;
     }
     else
     {
         currentDestination = pointA;
     }
 }