UnityEngine.NetworkViewID.ToString C# (CSharp) Method

ToString() public method

Returns a formatted string with details on this NetworkViewID.

public ToString ( ) : string
return string
        public override string ToString()
        {
            return Internal_GetString(this);
        }
    }

Usage Example

        public static int GetNetworkViewID(UnityEngine.NetworkViewID viewID)
        {
            string str = viewID.ToString();
            int    id;

            var sceneID = Regex.Match(str, @"SceneID\: ([0-9]+)");

            if (sceneID.Success && Int32.TryParse(sceneID.Groups[1].Value, out id))
            {
                return(id);
            }

            var allocatedID = Regex.Match(str, @"AllocatedID\: ([0-9]+)");

            if (allocatedID.Success && Int32.TryParse(allocatedID.Groups[1].Value, out id))
            {
                return(id);
            }

            return(0);
        }
All Usage Examples Of UnityEngine.NetworkViewID::ToString