protected GameObject CreateSimpleLevelItem(LevelItemType type, Vector3 position, Quaternion rotation, Transform parent)
 {
     return(GameObject.Instantiate(
                GameSceneManager.INSTANCE.GetPrefab(type),
                position,
                rotation,
                parent
                ));
 }
 public GameObject GetPrefab(LevelItemType type)
 {
     foreach (LevelItemPrefabStruct lips in prefabMap.lookup)
     {
         if (lips.type == type)
         {
             return(lips.prefab);
         }
     }
     return(null);
 }
Beispiel #3
0
 private SlotType MaxCompatibilityType(RaycastHit h1, SlotType max)
 {
     if (h1.transform != null)
     {
         LevelItemType c = h1.transform.GetComponent <LevelItemType>();
         if (c == null)
         {
             Debug.LogError("Err: missing level  item type" + h1.transform.name, h1.transform);
         }
         else
         {
             max = (SlotType)Mathf.Max((int)max, (int)c.itemPassabilityType);
         }
     }
     return(max);
 }
    protected TriggeringGameItem CreateTGI(LevelItemType type, Vector3 position, Quaternion rotation, Transform parent)
    {
        TriggeringGameItem tgi = GameObject.Instantiate(
            GameSceneManager.INSTANCE.GetPrefab(type),
            position,
            rotation,
            parent
            ).GetComponent <TriggeringGameItem>();

        if (tgi != null)
        {
            tgi.level = this;
        }

        return(tgi);
    }