Example #1
0
 private bool Init()
 {
     if (_uiBillboard == null)
     {
         _uiBillboard = GetComponent <BillboardObject>();
     }
     _uiBillboard.isBillboard = true;
     if (_traPog == null)
     {
         Util.FindParentToChild(ref _traPog, base.transform, "POG");
     }
     if (_traSPPog == null)
     {
         Util.FindParentToChild(ref _traSPPog, base.transform, "SPPog");
     }
     if (_traTorpedoAnchor == null)
     {
         Util.FindParentToChild(ref _traTorpedoAnchor, base.transform, "TorpedoAnchor");
     }
     if (_clsObject3D == null)
     {
         Util.FindParentToChild(ref _clsObject3D, base.transform, "ShipAnchor/Object3D");
     }
     if ((UnityEngine.Object)_animShipAnimation == null)
     {
         _animShipAnimation = GetComponent <Animation>();
     }
     _animShipAnimation.playAutomatically = false;
     _animShipAnimation.Stop();
     _iStandingPositionType = StandingPositionType.Free;
     _dicStandingPos        = new Dictionary <StandingPositionType, Vector3>();
     _iShipDrawType         = ShipDrawType.Normal;
     return(true);
 }
Example #2
0
 private bool Init()
 {
     if (this._uiBillboard == null)
     {
         this._uiBillboard = base.GetComponent <BillboardObject>();
     }
     this._uiBillboard.isBillboard = true;
     if (this._traPog == null)
     {
         Util.FindParentToChild <Transform>(ref this._traPog, base.get_transform(), "POG");
     }
     if (this._traSPPog == null)
     {
         Util.FindParentToChild <Transform>(ref this._traSPPog, base.get_transform(), "SPPog");
     }
     if (this._traTorpedoAnchor == null)
     {
         Util.FindParentToChild <Transform>(ref this._traTorpedoAnchor, base.get_transform(), "TorpedoAnchor");
     }
     if (this._clsObject3D == null)
     {
         Util.FindParentToChild <Object3D>(ref this._clsObject3D, base.get_transform(), "ShipAnchor/Object3D");
     }
     if (this._animShipAnimation == null)
     {
         this._animShipAnimation = base.GetComponent <Animation>();
     }
     this._animShipAnimation.set_playAutomatically(false);
     this._animShipAnimation.Stop();
     this._iStandingPositionType = StandingPositionType.Free;
     this._dicStandingPos        = new Dictionary <StandingPositionType, Vector3>();
     this._iShipDrawType         = ShipDrawType.Normal;
     return(true);
 }
Example #3
0
 public void SetStandingPosition(StandingPositionType iType)
 {
     if (_dicStandingPos.ContainsKey(iType) && base.transform.localPosition != _dicStandingPos[iType])
     {
         _iStandingPositionType       = iType;
         base.transform.localPosition = _dicStandingPos[iType];
     }
 }
Example #4
0
 public void SetStandingPosition(StandingPositionType iType)
 {
     if (this._dicStandingPos.ContainsKey(iType) && base.get_transform().get_localPosition() != this._dicStandingPos.get_Item(iType))
     {
         this._iStandingPositionType = iType;
         base.get_transform().set_localPosition(this._dicStandingPos.get_Item(iType));
     }
 }
Example #5
0
 public void SetStandingPosition(StandingPositionType iType)
 {
     _dicFriendBattleShips.ForEach(delegate(KeyValuePair <int, UIBattleShip> x)
     {
         if (x.Value != null)
         {
             x.Value.SetStandingPosition(iType);
         }
     });
     _dicEnemyBattleShips.ForEach(delegate(KeyValuePair <int, UIBattleShip> x)
     {
         if (x.Value != null)
         {
             x.Value.SetStandingPosition(iType);
         }
     });
 }