private void _UpdateBuildDockData() { if (_docks == null) { _docks = new List <BuildDockModel>(); } Api_Result <List <Mem_kdock> > api_Result = new Api_get_Member().kdock(); if (api_Result.state != 0) { return; } List <Mem_kdock> mem_docks = api_Result.data; int i; for (i = 0; i < mem_docks.Count; i++) { BuildDockModel buildDockModel = _docks.Find((BuildDockModel dock) => dock.Id == mem_docks[i].Rid); if (buildDockModel != null) { buildDockModel.__Update__(mem_docks[i]); } else { _docks.Add(new BuildDockModel(mem_docks[i])); } } }
private void OnDestroy() { _mini1Obj = null; _mini2Obj = null; _mini3Obj = null; _ship1 = null; _ship2 = null; _ship3 = null; _ship = null; _dock = null; }
private void OnDestroy() { this._mini1Obj = null; this._mini2Obj = null; this._mini3Obj = null; this._ship1 = null; this._ship2 = null; this._ship3 = null; this._ship = null; this._dock = null; }
public void init(BuildDockModel _dock) { this.dock = _dock; this._type1Obj = base.get_transform().FindChild("ShipType1").get_gameObject(); this._type2Obj = base.get_transform().FindChild("ShipType2").get_gameObject(); this._ship1 = new UISprite[6]; for (int i = 0; i < 6; i++) { this._ship1[i] = this._type1Obj.get_transform().FindChild("Ship" + (i + 1)).GetComponent <UISprite>(); } this.showInit(); }
public void init(BuildDockModel _dock) { dock = _dock; _type1Obj = base.transform.FindChild("ShipType1").gameObject; _type2Obj = base.transform.FindChild("ShipType2").gameObject; _ship1 = new UISprite[6]; for (int i = 0; i < 6; i++) { _ship1[i] = ((Component)_type1Obj.transform.FindChild("Ship" + (i + 1))).GetComponent <UISprite>(); } showInit(); }
public bool CheckStateEmpty() { if (_dock != null) { _dock = TaskMainArsenalManager.arsenalManager.GetDock(_number + 1); if (_dock.State == KdockStates.CREATE || _dock.State == KdockStates.COMPLETE) { return(false); } return(true); } return(false); }
private void _CheckBuildDockState() { bool flag = false; for (int i = 0; i < this._docks.get_Count(); i++) { BuildDockModel buildDockModel = this._docks.get_Item(i); if (buildDockModel.State == KdockStates.CREATE && buildDockModel.GetTurn() == 0) { flag = true; break; } } if (flag) { this._UpdateBuildDockData(); } }
private void _CheckBuildDockState() { bool flag = false; for (int i = 0; i < _docks.Count; i++) { BuildDockModel buildDockModel = _docks[i]; if (buildDockModel.State == KdockStates.CREATE && buildDockModel.GetTurn() == 0) { flag = true; break; } } if (flag) { _UpdateBuildDockData(); } }
public void set(ShipModelMst ship, BuildDockModel dock, bool isHight) { _ship = ship; _dock = dock; _fullCount = _dock.CompleteTurn - _dock.StartTurn; _nowBuildCount = _fullCount - _dock.GetTurn(); if (_dock.State == KdockStates.COMPLETE) { if (isHight) { SetFirstShip(); } else { SetShipCmp(); } } else { SetShip(); } }
public void set(ShipModelMst ship, BuildDockModel dock, bool isHight) { this._ship = ship; this._dock = dock; this._fullCount = this._dock.CompleteTurn - this._dock.StartTurn; this._nowBuildCount = this._fullCount - this._dock.GetTurn(); if (this._dock.State == KdockStates.COMPLETE) { if (isHight) { this.SetFirstShip(); } else { this.SetShipCmp(); } } else { this.SetShip(); } }
public void _setShow(bool DockOpen) { _dock = TaskMainArsenalManager.arsenalManager.GetDock(_number + 1); _close(); if (dockMode == DockMode.Close) { dockMode = DockMode.Show; } _uiBg.alpha = 1f; _uiBg2.alpha = 1f; _uiBg.mainTexture = (Resources.Load("Textures/Arsenal/dock/kenzo_bg_1") as Texture2D); if (!DockOpen && dockMode != 0) { _lockObj.SetActive(false); } updateSpeedUpIcon(); if (_dock.IsLarge()) { _uiBg2.mainTexture = (Resources.Load("Textures/Arsenal/dock/kenzo_build2_bg") as Texture2D); } else if (_dock.IsTunker()) { _uiBg2.mainTexture = (Resources.Load("Textures/Arsenal/dock/kenzo_build3_bg") as Texture2D); } else { _uiBg2.mainTexture = (Resources.Load("Textures/Arsenal/dock/kenzo_build1_bg") as Texture2D); } if (_dock.State == KdockStates.COMPLETE) { _ship = _dock.Ship; if (IsHight) { _shipSManager.set(_ship, _dock, isHight: true); _uiGetBtn.transform.localScale = Vector3.zero; _uiHighBtn.transform.localScale = Vector3.one; _uiTurnLabel.alpha = 1f; _limit = _dock.GetTurn(); _uiTurnLabel.text = string.Empty + _limit.ToString(); if (IsFirstHight) { PlayFirstHightAnimate(); } else { StartSpeedUpAnimate(); } } else { _shipSManager.set(_ship, _dock, isHight: false); endConstruct(); if (IsHightEnd) { _dockMiniMamager.PlayEndHightAnimate(); } else { _dockMiniMamager.PlayConstCompAnimation(); } } } else if (_dock.State == KdockStates.CREATE) { _ship = _dock.Ship; _shipSManager.set(_ship, _dock, isHight: false); _uiGetBtn.transform.localScale = Vector3.zero; _uiHighBtn.transform.localScale = Vector3.one; _uiTurnLabel.alpha = 1f; _limit = _dock.GetTurn(); _uiTurnLabel.text = string.Empty + _limit.ToString(); _dockMiniMamager.PlayConstStartAnimation(); } else { _dockMiniMamager.StopConstAnimation(); _dockMiniMamager.PlayIdleAnimation(); _uiStartBtn.transform.localScale = Vector3.one; } }
public void _setShow(bool DockOpen) { this._dock = TaskMainArsenalManager.arsenalManager.GetDock(this._number + 1); this._close(); if (this.dockMode == UiArsenalDock.DockMode.Close) { this.dockMode = UiArsenalDock.DockMode.Show; } this._uiBg.alpha = 1f; this._uiBg2.alpha = 1f; this._uiBg.mainTexture = (Resources.Load("Textures/Arsenal/dock/kenzo_bg_1") as Texture2D); if (!DockOpen && this.dockMode != UiArsenalDock.DockMode.Close) { this._lockObj.SetActive(false); } this.updateSpeedUpIcon(); if (this._dock.IsLarge()) { this._uiBg2.mainTexture = (Resources.Load("Textures/Arsenal/dock/kenzo_build2_bg") as Texture2D); } else if (this._dock.IsTunker()) { this._uiBg2.mainTexture = (Resources.Load("Textures/Arsenal/dock/kenzo_build3_bg") as Texture2D); } else { this._uiBg2.mainTexture = (Resources.Load("Textures/Arsenal/dock/kenzo_build1_bg") as Texture2D); } if (this._dock.State == KdockStates.COMPLETE) { this._ship = this._dock.Ship; if (this.IsHight) { this._shipSManager.set(this._ship, this._dock, true); this._uiGetBtn.get_transform().set_localScale(Vector3.get_zero()); this._uiHighBtn.get_transform().set_localScale(Vector3.get_one()); this._uiTurnLabel.alpha = 1f; this._limit = this._dock.GetTurn(); this._uiTurnLabel.text = string.Empty + this._limit.ToString(); if (this.IsFirstHight) { this.PlayFirstHightAnimate(); } else { this.StartSpeedUpAnimate(); } } else { this._shipSManager.set(this._ship, this._dock, false); this.endConstruct(); if (this.IsHightEnd) { this._dockMiniMamager.PlayEndHightAnimate(); } else { this._dockMiniMamager.PlayConstCompAnimation(); } } } else if (this._dock.State == KdockStates.CREATE) { this._ship = this._dock.Ship; this._shipSManager.set(this._ship, this._dock, false); this._uiGetBtn.get_transform().set_localScale(Vector3.get_zero()); this._uiHighBtn.get_transform().set_localScale(Vector3.get_one()); this._uiTurnLabel.alpha = 1f; this._limit = this._dock.GetTurn(); this._uiTurnLabel.text = string.Empty + this._limit.ToString(); this._dockMiniMamager.PlayConstStartAnimation(); } else { this._dockMiniMamager.StopConstAnimation(); this._dockMiniMamager.PlayIdleAnimation(); this._uiStartBtn.get_transform().set_localScale(Vector3.get_one()); } }