bool ThisNodeCanntGo(MapNode _node) { return _node == null || !_node.isMovable; }
public void FindRoundNode(MapNode[] _nodeArr) { this.pos = this.transform.localPosition; this.AnalyticMovable(); // init this.m_Up = this.m_Down = this.m_Left = this.m_Right = null; for (int i = 0; i < _nodeArr.Length; i++) { var b = _nodeArr[i]; var bRelPos = b.transform.localPosition - this.pos; // x-positive //if (this.m_Right == null && Vector3.Distance(bRelPos, X_Pos_Rel_Distance) < Vector3.kEpsilon) if (Vector3.Distance(bRelPos, X_Pos_Rel_Distance) < Vector3.kEpsilon) { this.m_Right = b; if (this.AllNeighborFound()) break; else continue; } // x-negative //else if (this.m_Left == null && Vector3.Distance(bRelPos, X_Neg_Rel_Distance) < Vector3.kEpsilon) else if (Vector3.Distance(bRelPos, X_Neg_Rel_Distance) < Vector3.kEpsilon) { this.m_Left = b; if (this.AllNeighborFound()) break; else continue; } // z-positive //else if (this.m_Up == null && Vector3.Distance(bRelPos, Z_Pos_Rel_Distance) < Vector3.kEpsilon) else if (Vector3.Distance(bRelPos, Z_Pos_Rel_Distance) < Vector3.kEpsilon) { this.m_Up = b; if (this.AllNeighborFound()) break; else continue; } // z-negative //else if (this.m_Down == null && Vector3.Distance(bRelPos, Z_Neg_Rel_Distance) < Vector3.kEpsilon) else if (Vector3.Distance(bRelPos, Z_Neg_Rel_Distance) < Vector3.kEpsilon) { this.m_Down = b; if (this.AllNeighborFound()) break; else continue; } } }
private bool Movable(bool _isBig, ref MapNode _node) { if (_node == null) return false; if (_isBig) return _node.isBigMovable; else return _node.isMovable; }
public void CopyForm(MapNode _ref) { this.pos = _ref.pos; this.up = _ref.up; this.down = _ref.down; this.left = _ref.left; this.right = _ref.right; this.m_Type = _ref.m_Type; this.isMovable = _ref.isMovable; this.isBigMovable = _ref.isBigMovable; }