var selection = Selection.objects.OfType<GameObject>().ToList(); tempTransforms = selection;
selection is List and tempTransform is Transform And I want to assign the selection to the tempTransform.
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
For simple C# syntax questions that don't require game development expertise, don't forget to search our general programming sister site StackOverflow first - they'll often have more coverage of topics like these.
// Store intermediate selection as an array so we can use the ConvertAll method. var selection = Selection.objects.OfType<GameObject>().ToArray(); // Provide a lambda to look up the corresponding Transform, given a GameObject. tempTransform = Array.ConvertAll(selection, item => item.transform);