コード例 #1
0
 public LineSegment(Vec2 pStart, Vec2 pEnd, GameObject owner, uint pColor = 0xffffffff, uint pLineWidth = 1, bool pGlobalCoords = false)
 {
     _owner = owner;
     Start = pStart;
     End = pEnd;
     Color = pColor;
     LineWidth = pLineWidth;
     UseGlobalCoords = pGlobalCoords;
 }
コード例 #2
0
ファイル: Game.cs プロジェクト: mtesseracttech/NeonArkanoid
 //------------------------------------------------------------------------------------------------------------------------
 //                                                        Remove()
 //------------------------------------------------------------------------------------------------------------------------
 internal void Remove(GameObject gameObject)
 {
     if (_gameObjectsContained.Contains (gameObject)) {
         _updateManager.Remove (gameObject);
         _collisionManager.Remove (gameObject);
         _gameObjectsContained.Remove (gameObject);
     }
 }
コード例 #3
0
ファイル: Game.cs プロジェクト: mtesseracttech/NeonArkanoid
 //------------------------------------------------------------------------------------------------------------------------
 //                                                        GetGameObjectCollisions()
 //------------------------------------------------------------------------------------------------------------------------
 internal GameObject[] GetGameObjectCollisions(GameObject gameObject)
 {
     return _collisionManager.GetCurrentCollisions(gameObject);
 }
コード例 #4
0
ファイル: Game.cs プロジェクト: mtesseracttech/NeonArkanoid
 //------------------------------------------------------------------------------------------------------------------------
 //                                                        Add()
 //------------------------------------------------------------------------------------------------------------------------
 internal void Add(GameObject gameObject)
 {
     if (!_gameObjectsContained.Contains (gameObject)) {
         _updateManager.Add (gameObject);
         _collisionManager.Add (gameObject);
         _gameObjectsContained.Add (gameObject);
     }
 }
コード例 #5
0
ファイル: Game.cs プロジェクト: mtesseracttech/NeonArkanoid
 //------------------------------------------------------------------------------------------------------------------------
 //                                                        Contains()
 //------------------------------------------------------------------------------------------------------------------------
 public Boolean Contains(GameObject gameObject)
 {
     return _gameObjectsContained.Contains(gameObject);
 }
コード例 #6
0
 //------------------------------------------------------------------------------------------------------------------------
 //                                                        removeChild()
 //------------------------------------------------------------------------------------------------------------------------
 private void removeChild(GameObject child)
 {
     _children.Remove(child);
 }
コード例 #7
0
 //------------------------------------------------------------------------------------------------------------------------
 //                                                        addChild()
 //------------------------------------------------------------------------------------------------------------------------
 private void addChild(GameObject child)
 {
     if (child.HasChild(this)) return; //no recursive adding
     _children.Add(child);
     return;
 }
コード例 #8
0
 //------------------------------------------------------------------------------------------------------------------------
 //                                                        SetChildIndex()
 //------------------------------------------------------------------------------------------------------------------------
 /// <summary>
 /// Inserts the specified object in this object's child list at given location.
 /// This will alter the position of other objects as well.
 /// You can use this to determine the layer order (z-order) of child objects.
 /// </summary>
 /// <param name='child'>
 /// Child.
 /// </param>
 /// <param name='index'>
 /// Index.
 /// </param>
 public void SetChildIndex(GameObject child, int index)
 {
     if (child.parent != this) AddChild(child);
     if (index < 0) index = 0;
     if (index >= _children.Count) index = _children.Count - 1;
     _children.Remove(child);
     _children.Insert(index, child);
 }
コード例 #9
0
 //------------------------------------------------------------------------------------------------------------------------
 //                                                        RemoveChild()
 //------------------------------------------------------------------------------------------------------------------------
 /// <summary>
 /// Removes the specified child GameObject from this object.
 /// </summary>
 /// <param name='child'>
 /// Child object to remove.
 /// </param>
 public void RemoveChild(GameObject child)
 {
     if (child.parent == this) {
         child.parent = null;
     }
 }
コード例 #10
0
 //------------------------------------------------------------------------------------------------------------------------
 //                                                        HitTest()
 //------------------------------------------------------------------------------------------------------------------------
 /// <summary>
 /// Tests if this object overlaps the one specified. 
 /// </summary>
 /// <returns>
 /// <c>true</c>, if test was hit, <c>false</c> otherwise.
 /// </returns>
 /// <param name='other'>
 /// Other.
 /// </param>
 public virtual bool HitTest(GameObject other)
 {
     return _collider != null && other._collider != null && _collider.HitTest (other._collider);
 }
コード例 #11
0
 //------------------------------------------------------------------------------------------------------------------------
 //                                                        HasChild()
 //------------------------------------------------------------------------------------------------------------------------
 /// <summary>
 /// Returns 'true' if the specified object is a child of this object.
 /// </summary>
 /// <param name='gameObject'>
 /// The GameObject that should be tested.
 /// </param>
 public bool HasChild(GameObject gameObject)
 {
     GameObject par = gameObject;
     while (par != null) {
         if (par == this) return true;
         par = par.parent;
     }
     return false;
 }
コード例 #12
0
 //------------------------------------------------------------------------------------------------------------------------
 //                                                        AddChild()
 //------------------------------------------------------------------------------------------------------------------------
 /// <summary>
 /// Adds the specified GameObject as a child to this one.
 /// </summary>
 /// <param name='child'>
 /// Child object to add.
 /// </param>
 public void AddChild(GameObject child)
 {
     child.parent = this;
 }