コード例 #1
0
ファイル: LoadManager.cs プロジェクト: kimgywon/run
    // Use this for initialization
    void Start()
    {
        GameObject WaveObj = Resources.Load("Prefab/Wave") as GameObject;
        GameObject Wave    = new GameObject("Wave");

        Wave.transform.parent = transform;

        m_Wave = GameObject.Instantiate <GameObject>(WaveObj);
        m_Wave.transform.parent = Wave.transform;

        m_Memory = MemoryPull.instance;

        m_LastPosition = Vector3.zero;

        int index = 0;

        foreach (var v in m_Memory.m_Listprefep)
        {
            if (index < 9)
            {
                m_Memory.initObject(string.Format("Load_{0}", index), 10);
            }
            else if (index == 9)
            {
                m_Memory.initObject(string.Format("USD"), 30);
            }
            else if (index == 10)
            {
                m_Memory.initObject(string.Format("LoadCresh"), 30);
            }
            else if (index == 11)
            {
                m_Memory.initObject(string.Format("BlockCraesh"), 30);
            }
            index++;
        }


        m_ViewLoad[0] = m_Memory.getObj(string.Format("Load_{0}", 0));

        m_LastPosition.z += m_ViewLoad[0].GetComponent <BoxCollider>().bounds.size.z;

        m_ViewLoad[0].transform.position = m_LastPosition;
        m_ViewLoad[0].GetComponent <Load>().init(m_ViewLoad[0].transform.position - m_ViewLoad[0].GetComponent <BoxCollider>().bounds.size
                                                 , m_ViewLoad[0].transform.position);

        for (int i = 1; i < 6; i++)
        {
            m_ViewLoad[i] = m_Memory.getObj(string.Format("Load_{0}", Random.Range(1, 9)));

            m_LastPosition.z += m_ViewLoad[i].GetComponent <BoxCollider>().bounds.size.z;
            m_ViewLoad[i].transform.position = m_LastPosition;
            m_ViewLoad[i].GetComponent <Load>().init(m_ViewLoad[i].transform.position - m_ViewLoad[i].GetComponent <BoxCollider>().bounds.size
                                                     , m_ViewLoad[i].transform.position);
        }
        m_SpareLoad = m_ViewLoad[4];
        m_Wave.transform.position = new Vector3(m_Wave.transform.position.x, m_Wave.transform.position.y, 0);

        for (int i = 0; i < 5; i++)
        {
            m_HideLoad[i]     = m_Memory.getObj(string.Format("Load_{0}", Random.Range(1, 9)));
            m_LastPosition.z += m_HideLoad[i].GetComponent <BoxCollider>().bounds.size.z;
            m_HideLoad[i].transform.position = m_LastPosition;
        }

        for (int i = 0; i < 5; i++)
        {
            m_HideLoad[i].SetActive(false);
        }
    }
コード例 #2
0
 private void Awake()
 {
     m_Memory = MemoryPull.instance;
     m_Player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAnimate>();
 }
コード例 #3
0
ファイル: MemoryPull.cs プロジェクト: kimgywon/run
 void OnApplicationQuit()
 {
     s_Instance = null;
     //게임종료시 삭제.
 }