示例#1
0
    public override void Initialize()
    {
        Debug.Log("Initialize");
        if (m_bInitialized == false)
        {
            base.Initialize();

            m_bmSnoozeType.ButtonRefresh(DataManagerAlarm.Instance.STR_SNOOZE_ARR.Length);

            for (int i = 0; i < DataManagerAlarm.Instance.STR_SNOOZE_ARR.Length; i++)
            {
                GameObject obj = PrefabManager.Instance.MakeObject("prefab/BannerSnooze", m_Grid.gameObject);
                obj.name = string.Format("{0}", i);
                BannerSnooze script = obj.GetComponent <BannerSnooze> ();
                script.Initialize(DataManagerAlarm.Instance.STR_SNOOZE_ARR [i], false);
                m_BannerSnoozeList.Add(script);
                m_bmSnoozeType.AddButtonBase(i, obj);
            }
            m_Grid.enabled = true;
            m_bmSnoozeType.ButtonInit();
        }

        int iCount = 0;

        foreach (BannerSnooze snooze in m_BannerSnoozeList)
        {
            snooze.Initialize(DataManagerAlarm.Instance.STR_SNOOZE_ARR [iCount], iCount == GameMain.Instance.EditingAlarmParam.snooze);
        }

        m_bInitialized = true;
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        m_eStep    = STEP.APPEAR;
        m_eStepPre = STEP.MAX;

        m_ButtonManager.ButtonInit();
        m_ButtonManager.TriggerClearAll();

        if (!DataManager.Instance.kvs_data.HasKey(DataManager.Instance.KEY_SCRIPT_ID) || DataManager.Instance.kvs_data.ReadInt(DataManager.Instance.KEY_SCRIPT_ID) == 0)
        {
            m_goContinue.SetActive(false);
        }
    }
示例#3
0
    public override void Initialize()
    {
        if (m_bSubStarted == false)
        {
            subStart();
            m_bSubStarted = true;
        }
        m_TabButtonManager.ButtonInit();
        m_TabButtonManager.TriggerClearAll();
        m_iTabIndex = m_TabButtonManager.Index;
        tab_switch(m_iTabIndex);

        m_eStep    = STEP.IDLE;
        m_eStepPre = STEP.MAX;
    }
示例#4
0
    public override void Initialize()
    {
        if (m_bSubStarted == false)
        {
            subStart();
            m_bSubStarted = true;
        }
        m_TabButtonManager.ButtonInit();
        m_btnList  = m_TabButtonManager.GetButtonBase(0).gameObject.GetComponent <FooterButton> ();
        m_btnStore = m_TabButtonManager.GetButtonBase(1).gameObject.GetComponent <FooterButton> ();

        m_TabButtonManager.TriggerClearAll();
        m_iTabIndex = m_TabButtonManager.Index;
        tab_switch(m_iTabIndex);

        m_eStep    = STEP.IDLE;
        m_eStepPre = STEP.MAX;
    }
示例#5
0
 public override void PageStart()
 {
     m_eStep    = STEP.SCREENSHOT;
     m_eStepPre = STEP.MAX;
     base.PageStart();
     m_lbText.text     = "シェアしてリンゴ出現!";
     m_lbTextDesc.text = "シェアするとリンゴが出現してストーリーを進めることができます";
     m_closeButton     = PrefabManager.Instance.MakeObject("prefab/CloseButton", m_goDispRoot).GetComponent <ButtonBase>();
     m_btnManager.ButtonRefresh();
     foreach (string strText in BUTTON_LIST)
     {
         GameObject obj = PrefabManager.Instance.MakeObject("prefab/ShareButton", m_gridButton.gameObject);
         obj.GetComponent <ShareButton> ().Initialize(strText);
         m_btnManager.AddButtonBase(obj);
     }
     m_gridButton.enabled = true;
     m_btnManager.ButtonInit();
 }
示例#6
0
    public override void PageStart()
    {
        m_eStep    = STEP.IDLE;
        m_eStepPre = STEP.MAX;
        base.PageStart();
        m_lbTitle.text = "チャプター選択";
        m_closeButton  = PrefabManager.Instance.MakeObject("prefab/CloseButton", gameObject).GetComponent <ButtonBase>();
        m_closeButton.TriggerClear();
        if (m_btnManager == null)
        {
            m_btnManager = gameObject.AddComponent <ButtonManager> ();
        }
        m_btnManager.ButtonRefresh();

        foreach (CsvChapterParam param in DataManager.Instance.csv_chapter.list)
        {
            ChapterBanner script = PrefabManager.Instance.MakeScript <ChapterBanner> ("prefab/ChapterBanner", m_grid.gameObject);
            script.Initialize(param);
            m_btnManager.AddButtonBase(script.gameObject);
        }
        m_btnManager.ButtonInit();
        NendAdInterstitial.Instance.Show();
    }
示例#7
0
    override protected void initialize()
    {
        bool          bBuyAble      = true;
        CtrlFieldItem moveFieldItem = null;

        if (m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.NORMAL)
        {
            // 道路のみ特殊処理
            // 道のみシリアルがあるものから利用
            // あとあとを見越して、同じitem_idがあれば反応できるようにしておく
            if (GameMain.Instance.m_iSettingItemId == Define.ITEM_ID_ROAD)
            {
                List <DataItem> same_list = GameMain.dbItem.Select(string.Format(" item_id = {0} and status = {1} ", GameMain.Instance.m_iSettingItemId, (int)Define.Item.Status.NONE));
                if (0 < same_list.Count)
                {
                    GameMain.Instance.m_iSettingItemSerial = same_list [0].item_serial;
                }
                else
                {
                    GameMain.Instance.m_iSettingItemSerial = 0;
                }
            }
        }
        else if (m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.MOVE)
        {
            // そのまま使う
            // 自分を一度消す
            int iRemoveIndex = 0;
            foreach (CtrlFieldItem item in GameMain.ParkRoot.m_fieldItemList)
            {
                if (item.m_dataItem.item_serial == GameMain.Instance.m_iSettingItemSerial)
                {
                    //item.Remove ();
                    moveFieldItem = item;
                    GameMain.Instance.m_iSettingItemId = moveFieldItem.m_dataItem.item_id;                              // 別にここでやる必要はない
                    GameMain.ParkRoot.m_fieldItemList.RemoveAt(iRemoveIndex);
                    break;
                }
                iRemoveIndex += 1;
            }

            DataItem dataItem = GameMain.dbItem.Select(GameMain.Instance.m_iSettingItemSerial);
            // 消す予定のところに新しい土地を設置する
            for (int x = dataItem.x; x < dataItem.x + dataItem.width; x++)
            {
                for (int y = dataItem.y; y < dataItem.y + dataItem.height; y++)
                {
                    GameObject obj = PrefabManager.Instance.MakeObject("prefab/PrefFieldItem", GameMain.ParkRoot.gameObject);
                    obj.name = "fielditem_" + x.ToString() + "_" + y.ToString();
                    CtrlFieldItem script = obj.GetComponent <CtrlFieldItem> ();
                    script.Init(x, y, 0);
                    GameMain.ParkRoot.m_fieldItemList.Add(script);
                }
            }
        }
        else
        {
        }

        //Debug.LogError (GameMain.Instance.m_iSettingItemSerial);
        if (m_parkMain.m_pageHeader == null)
        {
            m_parkMain.m_pageHeader = m_parkMain.makeHeader("header_item", "Setting1");
        }

        m_editItemMaster = GameMain.dbItemMaster.Select(GameMain.Instance.m_iSettingItemId);
        m_DontSetGridList.Clear();

        Release(m_goBuyType);
        if (GameMain.Instance.m_iSettingItemId == Define.ITEM_ID_ROAD && GameMain.Instance.m_iSettingItemSerial == 0 && GameMain.Instance.PreSettingItemId == Define.ITEM_ID_ROAD)
        {
            m_goBuyType = PrefabManager.Instance.MakeObject("prefab/PrefBuyType", gameObject);
            m_goBuyType.transform.localPosition = new Vector3(190.0f, 268.0f, 0.0f);
            BuyItemButton buy_type   = m_goBuyType.GetComponent <BuyItemButton> ();
            string        strBuyType = "[FF0000]購入[-]";
            if (0 < GameMain.Instance.m_iSettingItemSerial)
            {
                strBuyType = "保管庫";
            }
            buy_type.SetText(strBuyType);
            buy_type.SetText(string.Format("{0}G", m_editItemMaster.need_coin));
        }

        if (m_YesNoButtonManager == null)
        {
            GameObject goButtonManager = PrefabManager.Instance.MakeObject("prefab/PrefYesNoButton", gameObject);
            goButtonManager.transform.localPosition = new Vector3(0.0f, -400.0f, 0.0f);
            m_YesNoButtonManager = goButtonManager.GetComponent <ButtonManager> ();
            m_YesNoButtonManager.ButtonInit();
            m_YesNoButtonManager.TriggerClearAll();
        }
        CtrlYesNoButton yes_no_button = m_YesNoButtonManager.gameObject.GetComponent <CtrlYesNoButton> ();

        m_eStep    = STEP.IDLE;
        m_eStepPre = STEP.MAX;

        GameMain.Instance.m_bStartSetting = false;
        // ゾンビアイコンを00の位置に表示する
        m_iEditItemX = 3;
        m_iEditItemY = 3;

        GameMain.GetGrid(new Vector2(Screen.width / 2, Screen.height / 2), out m_iEditItemX, out m_iEditItemY);

        ParkMain.EDIT_MODE eEditMode = ParkMain.EDIT_MODE.NORMAL;
        Debug.Log(m_parkMain.m_eEditMode);
        if (m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.NORMAL)
        {
            GameObject prefab = PrefabManager.Instance.PrefabLoadInstance("prefab/PrefFieldItem");
            GameObject obj    = PrefabManager.Instance.MakeObject(prefab, m_parkMain.goParkRoot);
            m_editItem = obj.GetComponent <CtrlFieldItem> ();
        }
        else if (m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.MOVE)
        {
            eEditMode  = ParkMain.EDIT_MODE.MOVE;
            m_editItem = moveFieldItem;            //GameMain.ParkRoot.GetFieldItem (GameMain.Instance.m_iSettingItemSerial);

            m_iEditItemX = m_editItem.m_dataItem.x;
            m_iEditItemY = m_editItem.m_dataItem.y;
            Debug.Log(m_editItem.m_dataItem.item_id);
        }
        m_editItem.InitEdit(m_iEditItemX, m_iEditItemY, GameMain.Instance.m_iSettingItemId, eEditMode);
        //Debug.LogError( string.Format( "x:{0} y:{1}" , m_iEditItemX , m_iEditItemY ));


        // お金が足りる
        // 実際には道路しかひっかからないはず
        if (m_editItemMaster.need_coin <= DataManager.user.m_iGold)
        {
            bBuyAble = true;
            ;            //OK
        }
        else
        {
            bBuyAble = false;
        }

        if (bBuyAble == false && 0 == GameMain.Instance.m_iSettingItemSerial)
        {
            yes_no_button.EnableButtonYes(false);
        }

        string strWhere = " status != 0 ";

        if (m_parkMain.m_eEditMode == ParkMain.EDIT_MODE.MOVE)
        {
            strWhere = string.Format(" status != {0} and item_serial != {1} ", (int)Define.Item.Status.NONE, GameMain.Instance.m_iSettingItemSerial);
        }
        DataManager.Instance.m_ItemDataList = GameMain.dbItem.Select(strWhere);
        Grid.SetUsingGrid(ref m_DontSetGridList, DataManager.Instance.m_ItemDataList);
        foreach (Grid dont in m_DontSetGridList)
        {
            //Debug.Log (string.Format ("x={0} y={1} ", dont.x, dont.y));
        }
        bool bAbleSet = Grid.AbleSettingItem(m_editItemMaster, m_iEditItemX, m_iEditItemY, m_DontSetGridList);

        m_editItem.SetEditAble(bAbleSet);

        return;
    }