PlaneManager.cs 1002 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class PlaneManager : MonoBehaviour {
  5. public static PlaneManager instance;
  6. private GameObject airplane;
  7. public int PlayerHP;
  8. private GameObject bigbang;
  9. // Use this for initialization
  10. private void Awake()
  11. {
  12. instance = this;
  13. }
  14. void Start () {
  15. // CreateAirPlane();
  16. }
  17. public void CreateAirPlane()
  18. {
  19. //生成飞机 找到飞机预设物 实例化 给飞机设定坐标
  20. airplane = Resources.Load<GameObject>("Prefabs/AirPlane");
  21. GameObject go = Instantiate(airplane);
  22. go.transform.position = new Vector3(-0.02f,0.595f,6.29f);
  23. }
  24. public void CreateBigBang()
  25. {
  26. bigbang = Resources.Load<GameObject>("Prefabs/bigbang");
  27. GameObject go = Instantiate(bigbang);
  28. go.transform.position = new Vector3(0f,0.595f,0.6f);
  29. }
  30. // Update is called once per frame
  31. void Update () {
  32. }
  33. }