예제 #1
0
 public virtual void SetShipData(IShipModel model)
 {
     if (model != null)
     {
         _clsIShipModel = model;
     }
 }
예제 #2
0
 public virtual void SetShipData(IShipModel model)
 {
     if (model == null)
     {
         return;
     }
     this._clsIShipModel = model;
 }
예제 #3
0
        public void Construct(IShipModel model, IShipView view, IMovingComponent movingComponent)
        {
            _model = model;
            _view  = view;

            _movingComponent                 = movingComponent;
            _movingComponent.onMoving       += OnMoving;
            _movingComponent.onFinishMoving += OnFinishedMoving;
        }
예제 #4
0
 public virtual void SetShipData(ShipModel_BattleResult model)
 {
     _clsIShipModel = model;
     if (model != null)
     {
         _uiShipTex.mainTexture = ShipUtils.LoadBannerTexture(model);
         _uiShipTex.localSize   = ResourceManager.SHIP_TEXTURE_SIZE[(!model.IsDamaged()) ? 1 : 2];
         _uiShipTex.shader      = ((model.DmgStateEnd != DamageState_Battle.Gekichin && !model.IsEscape()) ? SingletonMonoBehaviour <ResourceManager> .Instance.shader.shaderList[1] : SingletonMonoBehaviour <ResourceManager> .Instance.shader.shaderList[0]);
         UpdateDamage(model.DmgStateEnd, model.IsEscape());
     }
 }
예제 #5
0
 public virtual void SetShipData(ShipModel_BattleResult model)
 {
     this._clsIShipModel = model;
     if (model == null)
     {
         return;
     }
     this._uiShipTex.mainTexture = ShipUtils.LoadBannerTexture(model);
     this._uiShipTex.localSize   = ResourceManager.SHIP_TEXTURE_SIZE.get_Item((!model.IsDamaged()) ? 1 : 2);
     this._uiShipTex.shader      = ((model.DmgStateEnd != DamageState_Battle.Gekichin && !model.IsEscape()) ? SingletonMonoBehaviour <ResourceManager> .Instance.shader.shaderList.get_Item(1) : SingletonMonoBehaviour <ResourceManager> .Instance.shader.shaderList.get_Item(0));
     this.UpdateDamage(model.DmgStateEnd, model.IsEscape());
 }
예제 #6
0
 protected virtual void SetShipTexture(ShipModel_BattleResult model)
 {
     this._clsIShipModel = model;
     if (model == null)
     {
         this._uiShipTex.mainTexture = null;
         this._uiShipTex.get_transform().get_localPosition().Zero();
         return;
     }
     this._uiShipTex.mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(model);
     this._uiShipTex.MakePixelPerfect();
 }
예제 #7
0
 protected virtual void SetShipTexture(ShipModel_BattleResult model)
 {
     _clsIShipModel = model;
     if (model == null)
     {
         _uiShipTex.mainTexture = null;
         _uiShipTex.transform.localPosition.Zero();
     }
     else
     {
         _uiShipTex.mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(model);
         _uiShipTex.MakePixelPerfect();
     }
 }
예제 #8
0
 public static Texture2D LoadCardTexture(IShipModel model, bool isDamaged)
 {
     return(LoadTexture(model.MstId, (!isDamaged) ? 3 : 4));
 }
예제 #9
0
 public static Texture2D LoadBannerTexture(IShipModel model, bool isDamaged)
 {
     return(LoadTexture(model.MstId, (!isDamaged) ? 1 : 2));
 }
예제 #10
0
 public void LeaveOrbit(IShipModel orbitingShip) {
     var shipOrbit = gameObject.GetFirstComponentInImmediateChildrenOnly<ShipOrbit>();
     D.Assert(shipOrbit != null, "{0}.{1} is not present.".Inject(FullName, typeof(ShipOrbit).Name));
     var ship = shipOrbit.gameObject.GetSafeInterfacesInChildren<IShipModel>().Single(s => s == orbitingShip);
     var parentFleetTransform = ship.UnitCommand.Transform.parent;
     ship.Transform.parent = parentFleetTransform;
 }
예제 #11
0
 public void AssumeOrbit(IShipModel ship) {
     var shipOrbit = gameObject.GetFirstComponentInImmediateChildrenOnly<ShipOrbit>();
     if (shipOrbit == null) {
         UnitFactory.Instance.MakeShipOrbitInstance(gameObject, ship);
     }
     else {
         UnitFactory.Instance.AttachShipToShipOrbit(ship, ref shipOrbit);
     }
 }
예제 #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Helm" /> class.
 /// </summary>
 /// <param name="ship">The ship.</param>
 public Helm(IShipModel ship) {
     _ship = ship;
     _data = ship.Data;
     _rigidbody = ship.Transform.rigidbody;
     _gameTime = GameTime.Instance;
     _gameSpeedMultiplier = _gameTime.GameSpeed.SpeedMultiplier();   // FIXME where/when to get initial GameSpeed before first GameSpeed change?
     _gameStatus = GameStatus.Instance;
     _engineRoom = new EngineRoom(_data, _rigidbody);
     AssessFrequencyOfCourseProgressChecks();
     Subscribe();
 }
예제 #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShipNavigator" /> class.
 /// </summary>
 /// <param name="ship">The ship.</param>
 public ShipNavigator(IShipModel ship) {
     _ship = ship;
     _data = ship.Data;
     _gameTime = GameTime.Instance;
     _gameSpeedMultiplier = _gameTime.GameSpeed.SpeedMultiplier();   // FIXME where/when to get initial GameSpeed before first GameSpeed change?
     _gameStatus = GameStatus.Instance;
     AssessFrequencyOfCourseProgressChecks();
     Subscribe();
 }
예제 #14
0
 protected virtual void OnDestroy()
 {
     this._uiShipTex     = null;
     this._clsIShipModel = null;
     this.OnUnInit();
 }
예제 #15
0
 protected virtual void OnDestroy()
 {
     _uiShipTex     = null;
     _clsIShipModel = null;
     OnUnInit();
 }