Newer
Older
Dreamsturbia-Project-IADE-Unity3D / Assets / Scripts / Puzzles / CargoElevatorScript.cs
@Rackday Rackday on 21 Aug 587 bytes Project Added
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class CargoElevatorScript : MonoBehaviour
  5. {
  6. public Vector3 targetPosition;
  7. public Vector3 basePosition;
  8. public ConditionCkecker condition;
  9. // Start is called before the first frame update
  10. void Start()
  11. {
  12. basePosition = transform.position;
  13. }
  14. // Update is called once per frame
  15. void Update()
  16. {
  17. if (condition.CheckConditions())
  18. transform.position = Vector3.MoveTowards(transform.position, targetPosition,Time.deltaTime);
  19. }
  20. }