| 148 | } |
| 149 | |
| 150 | void Script::SetOrderInParent(int32 index) |
| 151 | { |
| 152 | if (!_parent) |
| 153 | return; |
| 154 | |
| 155 | // Cache data |
| 156 | auto& parentScripts = _parent->Scripts; |
| 157 | const int32 currentIndex = parentScripts.Find(this); |
| 158 | ASSERT(currentIndex != INVALID_INDEX); |
| 159 | |
| 160 | // Check if index will change |
| 161 | if (currentIndex != index) |
| 162 | { |
| 163 | parentScripts.RemoveAtKeepOrder(currentIndex); |
| 164 | |
| 165 | // Check if index is invalid |
| 166 | if (index < 0 || index >= parentScripts.Count()) |
| 167 | { |
| 168 | // Append at the end |
| 169 | parentScripts.Add(this); |
| 170 | } |
| 171 | else |
| 172 | { |
| 173 | // Change order |
| 174 | parentScripts.Insert(index, this); |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | void Script::SetupType() |
| 180 | { |
nothing calls this directly
no test coverage detected