public BranchIndex(int Level, int Index, int BottomVerticesIndex, int TopVerticesIndex, Vector3 Rotation, BranchIndex From, BranchIndex Previous, GameObject _GameObject, int Age = 0) : base(Index, OrganType.Branch, From, _GameObject, Age) { m_Level = Level; m_BottomVerticesIndex = BottomVerticesIndex; m_TopVerticesIndex = TopVerticesIndex; m_Rotation = Rotation; m_Previous = Previous; }
public bool IsMatch(BranchIndex _BranchIndex) { if (!IsTheLevelTheSame(_BranchIndex)) { return(false); //不属于同一级的枝干 } switch (Convert.ToInt32(IsFirstBranchInBranch()) + Convert.ToInt32(_BranchIndex.IsFirstBranchInBranch())) { case 0: return(IsTheSameIndex(_BranchIndex)); case 1: return(false); case 2: return(IsTheSameRelativeRotationAngles(_BranchIndex)); default: throw new Exception("Unknown Exception."); } }
public bool IsTheSameRelativeRotationAngles(BranchIndex _BranchIndex) { return(this.RelativeRotation.Equals(_BranchIndex.RelativeRotation)); }