Exemplo n.º 1
0
 public void UpdateInfo(int ret)
 {
     _isBtnMaruUp = false;
     _clsRepair   = rep.now_clsRepair();
     sm           = _clsRepair.GetDockData(ret).GetShip();
     csb.SetShipData(sm);
     iTween.ScaleTo(base.gameObject, new Vector3(0.6f, 0.6f, 0.6f), 0f);
     ele_l      = GameObject.Find("dialog2_top/dialog2/label_shipname").GetComponent <UILabel>();
     ele_l.text = sm.Name;
     ele_l      = GameObject.Find("dialog2_top/dialog2/label_lv").GetComponent <UILabel>();
     ele_l.text = string.Empty + sm.Level;
     GameObject.Find("dialog2/label_param_1").GetComponent <UILabel>().text = _clsRepair.GetDockData(ret).RemainingTurns.ToString();
     GameObject.Find("dialog2/label_param_2").GetComponent <UILabel>().text = rep.now_repairkit().ToString();
     GameObject.Find("dialog2/label_param_3").GetComponent <UILabel>().text = (rep.now_repairkit() - 1).ToString();
     shipid = sm.MstId;
 }
Exemplo n.º 2
0
        public void _init_repair()
        {
            rep              = GameObject.Find("Repair Root").GetComponent <repair>();
            csb              = GameObject.Find("dialog_top/dialog/Banner/CommonShipBanner2").GetComponent <CommonShipBanner>();
            bd3              = GameObject.Find("board3_top/board3").GetComponent <board3>();
            _Button_Yes      = GameObject.Find("dialog_top/dialog/btn_yes").GetComponent <UIButton>();
            _Button_No       = GameObject.Find("dialog_top/dialog/btn_no").GetComponent <UIButton>();
            btn_obj[0]       = _Button_No.gameObject;
            btn_obj[1]       = _Button_Yes.gameObject;
            _uiOverlayButton = GameObject.Find("dialog_top/dialog/OverlayBtn").GetComponent <UIButton>();
            EventDelegate.Add(_uiOverlayButton.onClick, _onClickOverlayButton);
            UIButtonMessage component = _Button_Yes.GetComponent <UIButtonMessage>();

            component.target       = base.gameObject;
            component.functionName = "Pressed_Button_Yes";
            component.trigger      = UIButtonMessage.Trigger.OnClick;
            UIButtonMessage component2 = _Button_No.GetComponent <UIButtonMessage>();

            component2.target       = base.gameObject;
            component2.functionName = "Pressed_Button_No";
            component2.trigger      = UIButtonMessage.Trigger.OnClick;
            _clsRepair                       = rep.now_clsRepair();
            dockSelectController             = new KeyControl(0, 1);
            dockSelectController.isLoopIndex = false;
            dockSelectController.setChangeValue(0f, 1f, 0f, -1f);
            sw = GameObject.Find("sw01").GetComponent <sw>();
            sw.setSW(stat: false);
            _bVector = Vector3.one;
        }
Exemplo n.º 3
0
        public void UpdateInfo(int dockNo)
        {
            selected_dock = dockNo;
            _isBtnMaruUp  = false;
            _clsRepair    = rep.now_clsRepair();
            iTween.ScaleTo(base.gameObject, new Vector3(0.6f, 0.6f, 0.6f), 0f);
            int numOfKeyPossessions = _clsRepair.NumOfKeyPossessions;

            GameObject.Find("dialog3_top/dialog3/Text_b").GetComponent <UILabel>().text = numOfKeyPossessions.ToString();
            GameObject.Find("dialog3_top/dialog3/Text_a").GetComponent <UILabel>().text = (numOfKeyPossessions - 1).ToString();
        }
Exemplo n.º 4
0
 public void board2_appear(bool boardStart, bool isSirent)
 {
     if (boardStart)
     {
         base.gameObject.isStatic = false;
         base.gameObject.GetComponent <UIPanel>().enabled = true;
         SortButton.SetActive(isActive: true);
         rep_p.Initialize(ships);
         for (int i = 0; i < 4; i++)
         {
             if (bd.get_HS_anime(i))
             {
                 rep.now_clsRepair().ChangeRepairSpeed(i);
                 bd.set_anime(i, stat: false);
                 bd.set_HS_anime(i, stat: false);
             }
         }
         set_board2_anime(value: true);
         TweenPosition tweenPosition = TweenPosition.Begin(base.gameObject, 0.35f, new Vector3(162f, 123f, -1f));
         tweenPosition.animationCurve = UtilCurves.TweenEaseOutExpo;
         tweenPosition.SetOnFinished(CompleteHandler);
         rep.set_mode(-2);
         rep.setmask(1, value: true);
         rep.set_mode(2);
     }
     else
     {
         set_board2_anime(value: true);
         TweenPosition tweenPosition2 = TweenPosition.Begin(base.gameObject, 0.3f, new Vector3(840f, 123f, -1f));
         tweenPosition2.animationCurve = UtilCurves.TweenEaseOutExpo;
         tweenPosition2.SetOnFinished(CompleteHandlerStaticOn);
         rep.setmask(1, value: false);
         rep.set_mode(1);
     }
     if (!isSirent)
     {
         SoundUtils.PlaySE(SEFIleInfos.CommonEnter1);
     }
 }
Exemplo n.º 5
0
 public void StartUP()
 {
     rep = GameObject.Find("Repair Root").GetComponent <repair>();
     rep.set_mode(-1);
     if (!_isStartUpDone)
     {
         _isStartUpDone = true;
         bd2            = ((Component)rep.transform.FindChild("board2_top/board2")).GetComponent <board2>();
         bd3            = ((Component)rep.transform.FindChild("board3_top/board3")).GetComponent <board3>();
         dia            = GameObject.Find("dialog").GetComponent <dialog>();
         dia2           = GameObject.Find("dialog2").GetComponent <dialog2>();
         dia3           = GameObject.Find("dialog3").GetComponent <dialog3>();
         for (int i = 0; i < 4; i++)
         {
             GameObject[] array = shutter;
             int          num   = i;
             int          num2  = i;
             array[num] = GameObject.Find("board1_top/board/Grid/0" + num2.ToString() + "/Shutter");
         }
         _clsRepair = rep.now_clsRepair();
         now_kit    = _clsRepair.Material.RepairKit;
         _ANI       = ((Component)rep.transform.FindChild("info")).GetComponent <Animation>();
         int num3 = _clsRepair.MapArea.NDockCount;
         if (num3 == _clsRepair.MapArea.NDockMax)
         {
             num3--;
         }
         dockSelectController = new KeyControl(0, num3);
         dock_flag_init();
         dockSelectController.setChangeValue(-1f, 0f, 1f, 0f);
         dockSelectController.isLoopIndex = false;
         _first_key     = false;
         _go_kosoku     = 0;
         _go_kosoku_m   = -1;
         _select_dock   = 0;
         _select_dock_m = -1;
         _dock_exist    = false;
         redraw();
         bd2.StartUp();
         bd3.StartUp();
     }
 }
Exemplo n.º 6
0
 public void StartUp()
 {
     if (!_startup)
     {
         _startup = true;
         bd       = GameObject.Find("board1_top/board").GetComponent <board>();
         bd3      = GameObject.Find("board3_top/board3").GetComponent <board3>();
         rep      = ((Component)base.gameObject.transform.parent.parent).GetComponent <repair>();
         rep_p    = ((Component)rep.transform.FindChild("board2_top/board2/UIScrollListRepair")).GetComponent <UIScrollListRepair>();
         Camera component = ((Component)rep.transform.FindChild("Camera")).GetComponent <Camera>();
         _clsScroll      = new KeyScrollControl(6, 6, scb);
         _clsRepair      = rep.now_clsRepair();
         damage_flag     = 0;
         _debug_shipping = false;
         TweenPosition.Begin(base.gameObject, 0.01f, new Vector3(840f, 123f, -1f));
         ships = _clsRepair.GetShipList();
         dockSelectController = new KeyControl();
         dockSelectController.setChangeValue(0f, 0f, 0f, 0f);
         rep_p.SetCamera(component);
         rep_p.SetKeyController(dockSelectController);
         rep_p.ResumeControl();
         rep_p.SetOnSelectedListener(delegate(UIScrollListRepairChild child)
         {
             rep_p.keyController.ClearKeyAll();
             rep_p.LockControl();
             rep.set_mode(-2);
             if (child.GetModel() != null)
             {
                 bd3.UpdateInfo(child.GetModel());
                 bd3.board3_appear(bstat: true);
                 rep.setmask(2, value: true);
                 rep.set_mode(3);
             }
         });
         redraw();
     }
 }
Exemplo n.º 7
0
        public void DockStatus(int MapArea, int TargetDock)
        {
            _first_key = true;
            rep.GetMstManager();
            rep.GetMst_ship();
            rep.update_portframe();
            _clsRepair = rep.now_clsRepair();
            dock_count = _clsRepair.GetDocks().Length;
            for (int i = 0; i < dock_count; i++)
            {
                int num = i;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num.ToString() + "/bg/BackGround").GetComponent <UISprite>();
                bds2.spriteName = "list_bg";
                int num2 = i;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num2.ToString() + "/bg/BackGround3").GetComponent <UISprite>();
                bds2.spriteName = "cardArea_YB";
                int num3 = i;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num3.ToString() + "/bg/BackGround2").GetComponent <UISprite>();
                bds2.spriteName = AreaIdToSeaSpriteName(rep.NowArea());
                int num4 = i;
                GameObject.Find("board1_top/board/Grid/0" + num4.ToString() + "/Shutter/BGKey").transform.localScaleZero();
                int num5 = i;
                GameObject.Find("board1_top/board/Grid/0" + num5.ToString() + "/Shutter/BGMes").transform.localScaleZero();
                if (TargetDock == -1)
                {
                    shutter[i].transform.localScale = Vector3.zero;
                }
                dock_cursor[i] = GameObject.Find("board1_top/board/Grid/" + dock[i].name + "/bg/BackGround");
                btn_Stk[i].SetActive(true);
            }
            int nDockMax = _clsRepair.MapArea.NDockMax;

            for (int j = dock_count; j < nDockMax; j++)
            {
                if (TargetDock != -1 && TargetDock != j)
                {
                    continue;
                }
                int num6 = j;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num6.ToString() + "/bg/BackGround").GetComponent <UISprite>();
                bds2.spriteName = "list_bg_bar_closed";
                int num7 = j;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num7.ToString() + "/bg/BackGround3").GetComponent <UISprite>();
                bds2.spriteName = null;
                int num8 = j;
                bds2            = GameObject.Find("board1_top/board/Grid/0" + num8.ToString() + "/bg/BackGround2").GetComponent <UISprite>();
                bds2.spriteName = null;
                if (_first_key)
                {
                    if (_clsRepair.IsValidOpenNewDock())
                    {
                        int num9 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num9.ToString() + "/Shutter/BGMes").GetComponent <UISprite>().spriteName = "huki_r_02";
                        int num10 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num10.ToString() + "/Shutter/BGKey").GetComponent <UISprite>().spriteName = "btn_addDock";
                    }
                    else
                    {
                        int num11 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num11.ToString() + "/Shutter/BGMes").GetComponent <UISprite>().spriteName = "huki_r_01";
                        int num12 = j;
                        GameObject.Find("board1_top/board/Grid/0" + num12.ToString() + "/Shutter/BGKey").GetComponent <UISprite>().spriteName = "btn_addDock";
                    }
                    int num13 = j;
                    GameObject.Find("board1_top/board/Grid/0" + num13.ToString() + "/Shutter/BGKey").transform.localScaleOne();
                    _first_key = false;
                }
                else
                {
                    int num14 = j;
                    GameObject.Find("board1_top/board/Grid/0" + num14.ToString() + "/Shutter/BGKey").transform.localScaleZero();
                    int num15 = j;
                    GameObject.Find("board1_top/board/Grid/0" + num15.ToString() + "/Shutter/BGMes").transform.localScaleZero();
                }
                shutter[j].transform.localScale = Vector3.one;
                dock_cursor[j] = GameObject.Find("board1_top/board/Grid/" + dock[j].name + "/Shutter/ShutterALL");
                dock_cursor[j].transform.localScale = Vector3.one;
                btn_Stk[j].SetActive((j <= dock_count) ? true : false);
                r_now[j].SetActive(false);
            }
            for (int k = nDockMax; k < 4; k++)
            {
                if (TargetDock == -1 || TargetDock == k)
                {
                    int num16 = k;
                    bds2            = GameObject.Find("board1_top/board/Grid/0" + num16.ToString() + "/bg/BackGround").GetComponent <UISprite>();
                    bds2.spriteName = null;
                    int num17 = k;
                    bds2            = GameObject.Find("board1_top/board/Grid/0" + num17.ToString() + "/bg/BackGround3").GetComponent <UISprite>();
                    bds2.spriteName = null;
                    int num18 = k;
                    bds2            = GameObject.Find("board1_top/board/Grid/0" + num18.ToString() + "/bg/BackGround2").GetComponent <UISprite>();
                    bds2.spriteName = null;
                    int num19 = k;
                    GameObject.Find("board1_top/board/Grid/0" + num19.ToString() + "/Shutter/BGKey").transform.localScaleZero();
                    int num20 = k;
                    GameObject.Find("board1_top/board/Grid/0" + num20.ToString() + "/Shutter/BGMes").transform.localScaleZero();
                    shutter[k].transform.localScale = Vector3.zero;
                    btn_Stk[k].SetActive(false);
                    r_now[k].SetActive(false);
                }
            }
            for (int l = 0; l < dock_count; l++)
            {
                crane_anime component = GameObject.Find("board/Grid/0" + l.ToString() + "/Anime").GetComponent <crane_anime>();
                ShipModel   ship      = _clsRepair.GetDockData(l).GetShip();
                if (TargetDock != -1 && TargetDock != l)
                {
                    continue;
                }
                if (_clsRepair.GetDockData(l).ShipId != 0 && _clsRepair.GetDockData(l).RemainingTurns != 0)
                {
                    r_now[l].SetActive(true);
                    btn_Stk[l].SetActive(false);
                    int num21 = l;
                    tex = GameObject.Find("board/Grid/0" + num21.ToString() + "/repair_now/ship_banner").GetComponent <UITexture>();
                    if (ship.DamageStatus == DamageState.Taiha)
                    {
                        tex.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(ship.MstId, 2);
                    }
                    else if (ship.DamageStatus == DamageState.Tyuuha)
                    {
                        tex.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(ship.MstId, 2);
                    }
                    else
                    {
                        tex.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(ship.MstId, 1);
                    }
                    int num22 = l;
                    lab      = GameObject.Find("board/Grid/0" + num22.ToString() + "/repair_now/text_ship_name").GetComponent <UILabel>();
                    lab.text = ship.Name;
                    int num23 = l;
                    lab      = GameObject.Find("board/Grid/0" + num23.ToString() + "/repair_now/text_level").GetComponent <UILabel>();
                    lab.text = string.Empty + ship.Level;
                    int num24 = l;
                    lab      = GameObject.Find("board/Grid/0" + num24.ToString() + "/repair_now/text_hp").GetComponent <UILabel>();
                    lab.text = ship.NowHp + "/" + ship.MaxHp;
                    MaxHP[l] = ship.MaxHp;
                    int num25 = l;
                    ele_d       = GameObject.Find("board/Grid/0" + num25.ToString() + "/repair_now/HP_Gauge/panel/HP_bar_meter2").GetComponent <UISprite>();
                    ele_d.width = (int)((float)ship.NowHp * 210f / (float)ship.MaxHp);
                    ele_d.color = Util.HpGaugeColor2(ship.MaxHp, ship.NowHp);
                    int num26 = l;
                    ele_d       = GameObject.Find("board/Grid/0" + num26.ToString() + "/repair_now/HP_Gauge/panel/HP_bar_meter").GetComponent <UISprite>();
                    ele_d.width = (int)((float)ship.NowHp * 210f / (float)ship.MaxHp);
                    ele_d.color = Util.HpGaugeColor2(ship.MaxHp, ship.NowHp);
                    int num27 = l;
                    lab      = GameObject.Find("board/Grid/0" + num27.ToString() + "/repair_now/text_least_time").GetComponent <UILabel>();
                    lab.text = string.Empty + _clsRepair.GetDockData(l).RemainingTurns;
                    int num28 = l;
                    uibutton = GameObject.Find("board/Grid/0" + num28.ToString() + "/repair_now/btn_high_repair").GetComponent <UIButton>();
                    if (_clsRepair.Material.RepairKit > 0)
                    {
                        uibutton.isEnabled = true;
                    }
                    else
                    {
                        uibutton.isEnabled = false;
                    }
                    set_anime(l, stat: false);
                    component.start_anime(l);
                }
                else
                {
                    r_now[l].SetActive(false);
                    btn_Stk[l].SetActive(true);
                    component.stop_anime(l);
                    set_anime(l, stat: false);
                }
            }
            swsw = GameObject.Find("board3_top/board3/sw01").GetComponent <sw>();
            swsw.set_sw_stat((_clsRepair.Material.RepairKit > 0) ? true : false);
            _dock_exist = true;
        }
Exemplo n.º 8
0
 public void UpdateInfo()
 {
     _clsRepair = rep.now_clsRepair();
     iTween.ScaleTo(base.gameObject, new Vector3(0.6f, 0.6f, 0.6f), 0f);
 }