_xiaofang/xiaofang/Assets/Script/Resurrection.cs

36 lines
870 B
C#
Raw Normal View History

2024-10-22 11:57:50 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Resurrection : MonoBehaviour
{
public List<GameObject> re = new List<GameObject>();//ʹ<><CAB9>list<73><EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
private GameObject ga;
// Start is called before the first frame update
void Start()
{
2024-10-22 17:37:42 +08:00
ga =(GameObject)Resources.Load("Character/Vang");//<2F><>resousce<63><65>Դ<EFBFBD>м<EFBFBD><D0BC><EFBFBD>npc
2024-10-22 11:57:50 +08:00
Init();
}
private void Init()
{
2024-10-22 17:37:42 +08:00
for (int i = 0; i < 3; i++)
{
GameObject instance = (GameObject)Instantiate(ga);//ʵ<><CAB5><EFBFBD><EFBFBD>npc
int a = Random.Range(0, 5);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>λ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Vector3 va = re[a].transform.position; //<2F><><EFBFBD><EFBFBD><EFBFBD>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϣ
instance.transform.position = va;
}
2024-10-22 11:57:50 +08:00
}
// Update is called once per frame
void Update()
{
}
}