Beispiel #1
0
        IEnumerable <NetworkBehaviourInfo> GetNetworkBehaviorInfo(NetworkIdentity identity)
        {
            var behaviourInfos = new List <NetworkBehaviourInfo>();

            NetworkBehaviour[] behaviours = identity.GetComponents <NetworkBehaviour>();
            foreach (NetworkBehaviour behaviour in behaviours)
            {
                behaviourInfos.Add(new NetworkBehaviourInfo
                {
                    Name      = new GUIContent(behaviour.GetType().FullName),
                    Behaviour = behaviour
                });
            }
            return(behaviourInfos);
        }