UAVFactory.cs 496 B

123456789101112131415161718
  1. using UnityEngine;
  2. using System.Collections;
  3. public class UAVFactory
  4. {
  5. public static UAVehicle CreateUAVechile(Craft craft, UAVItem uavItem, Map map)
  6. {
  7. GameObject uavPrefab = Resources.Load<GameObject>(Config.UAV_PREFAB_FOLDER + uavItem.GetData().model);
  8. GameObject uavObj = GameObject.Instantiate<GameObject>(uavPrefab);
  9. UAVehicle uav = uavObj.GetComponent<UAVehicle> ();
  10. uav.Init (map, craft, uavItem);
  11. uav.typeId = MapObjectUtil.TypeId.UAV.GetHashCode();
  12. return uav;
  13. }
  14. }