示例#1
0
    CrticalStrike LoadCPAddPrefab(string path)
    {
        //ResourceItem objUnit = ResourcesManager.Instance.loadImmediate(path, ResourceType.PREFAB);
        //GameObject obj = GameObject.Instantiate(objUnit.Asset) as GameObject;

        GameObject obj = ObjectPool.Instance.GetGO(res);



        CrticalStrike cpadd = obj.GetComponent <CrticalStrike>();

        return(cpadd);
    }
示例#2
0
 void Awake()
 {
     Instance = this;
     for (int i = 0; i < index; i++)
     {
         CrticalStrike addui = LoadCPAddPrefab(res);
         addui.gameObject.transform.parent        = transform;
         addui.gameObject.transform.localScale    = Vector3.one;
         addui.gameObject.transform.localPosition = Vector3.zero;
         addui.gameObject.SetActive(false);
         CrticalStrikeList.Add(addui);
     }
 }