TargetViewManager.cs 505 B

1234567891011121314151617181920212223242526
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class TargetViewManager : MonoBehaviour
  5. {
  6. GameObject robot;
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. }
  11. private void OnEnable() {
  12. robot = GameObject.FindGameObjectWithTag("robot");
  13. }
  14. // Update is called once per frame
  15. void Update()
  16. {
  17. transform.rotation = Quaternion.Euler(0, 0,robot.transform.eulerAngles.y);
  18. }
  19. }