浮标点和相机停靠点外置,用resources加载图片,删除脚本文件夹分类
This commit is contained in:
22
Assets/Scripts/LookAtWorkerCam.cs
Normal file
22
Assets/Scripts/LookAtWorkerCam.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class LookAtWorkerCam : MonoBehaviour
|
||||
{
|
||||
public Transform WorldIcons;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
for (int i = 0; i < WorldIcons.childCount; i++)
|
||||
{
|
||||
WorldIcons.GetChild(i).transform.LookAt(WorldIcons.GetChild(i).transform.position + transform.forward);//¿´Ïà»ú
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user