private void OnEnable()
 {
     dropShip = (DropShip)target;
 }
示例#2
0
    // Use this for initialization
    void Awake()
    {
        m_dropShip = transform.parent.Find("dropship").GetComponent<DropShip>();
        m_edgeRect = transform.Find("EdgeRect").GetComponent<BoxCollider>();

        m_followingCamera = Camera.main.GetComponentInChildren<FollowingCamera>();
        m_followingCamera.SetMainTarget(m_dropShip.gameObject);

        m_dungeon = transform.parent.GetComponent<Dungeon>();
        int dungeonId = m_dungeon.DungeonId;
        m_refWorldMap = RefData.Instance.RefWorldMaps[dungeonId];

        m_prefItemBox = Resources.Load<GameObject>("Pref/ItemBox/ItemBox");
        string[] itemTypeNames = Enum.GetNames(typeof(ItemData.Type));
        for(int i = 0; i < itemTypeNames.Length-1; ++i)
        {
            m_prefItemBoxSkins[i] = Resources.Load<GameObject>("Pref/ItemBox/item_" + itemTypeNames[i] + "_skin");
            if (m_prefItemBoxSkins[i] == null)
                Debug.Log("Pref/ItemBox/item_" + itemTypeNames[i] + "_skin");
        }

        m_stageText = new YGUISystem.GUILable(GameObject.Find("HudGUI/StatusGUI/Stage").gameObject);
        m_waveText = new YGUISystem.GUILable(GameObject.Find("HudGUI/StatusGUI/Wave").gameObject);

        Transform[] goals = transform.Find("GoalPoint").transform.GetComponentsInChildren<Transform>();
        m_goalPoints = new Transform[goals.Length-1];
        for(int i = 0; i < goals.Length-1; ++i)
            m_goalPoints[i] = goals[i+1];
    }