TestManager.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class TestManager : MonoBehaviour {
  5. public Transform player;
  6. public Transform enemy;
  7. public Camera mainCamera;
  8. // Use this for initialization
  9. void Start () {
  10. //mainCamera = GetComponent<Camera>();
  11. //Vector3 playerWorld = player.position;
  12. //Vector3 enemyWorld = enemy.position;
  13. //print("玩家世界位置 : x = " + playerWorld.x + ", y = " + playerWorld.y + ", z = " + playerWorld.z);
  14. //print("敌人世界位置 : x = " + enemyWorld.x + ", y = " + enemyWorld.y + ", z = " + enemyWorld.z);
  15. //Vector3 playerScreen = Camera.main.WorldToScreenPoint(playerWorld);
  16. //Vector3 enemyScreen = Camera.main.WorldToScreenPoint(enemyWorld);
  17. //print("玩家屏幕位置 : x = " + playerScreen.x + ", y = " + playerScreen.y + ", z = " + playerScreen.z);
  18. //print("敌人屏幕位置 : x = " + enemyScreen.x + ", y = " + enemyScreen.y + ", z = " + enemyScreen.z);
  19. }
  20. // Update is called once per frame
  21. void Update () {
  22. }
  23. }