Here are the examples of the csharp api UnityEngine.Debug.Log(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1212 Examples
19
Source : ScreenshotTaker.cs
with Apache License 2.0
from activey
with Apache License 2.0
from activey
void OnGUI()
{
EditorGUILayout.LabelField ("Resolution", EditorStyles.boldLabel);
resWidth = EditorGUILayout.IntField ("Width", resWidth);
resHeight = EditorGUILayout.IntField ("Height", resHeight);
EditorGUILayout.Space();
scale = EditorGUILayout.IntSlider ("Scale", scale, 1, 15);
EditorGUILayout.HelpBox("The default mode of screenshot is crop - so choose a proper width and height. The scale is a factor " +
"to multiply or enlarge the renders without loosing quality.",MessageType.None);
EditorGUILayout.Space();
GUILayout.Label ("Save Path", EditorStyles.boldLabel);
EditorGUILayout.BeginHorizontal();
EditorGUILayout.TextField(path,GUILayout.ExpandWidth(false));
if(GUILayout.Button("Browse",GUILayout.ExpandWidth(false)))
path = EditorUtility.SaveFolderPanel("Path to Save Images",path,Application.dataPath);
EditorGUILayout.EndHorizontal();
EditorGUILayout.HelpBox("Choose the folder in which to save the screenshots ",MessageType.None);
EditorGUILayout.Space();
//isTransparent = EditorGUILayout.Toggle(isTransparent,"Transparent Background");
GUILayout.Label ("Select Camera", EditorStyles.boldLabel);
myCamera = EditorGUILayout.ObjectField(myCamera, typeof(Camera), true,null) as Camera;
if(myCamera == null)
{
myCamera = Camera.main;
}
isTransparent = EditorGUILayout.Toggle("Transparent Background", isTransparent);
EditorGUILayout.HelpBox("Choose the camera of which to capture the render. You can make the background transparent using the transparency option.",MessageType.None);
EditorGUILayout.Space();
EditorGUILayout.BeginVertical();
EditorGUILayout.LabelField ("Default Options", EditorStyles.boldLabel);
if(GUILayout.Button("Set To Screen Size"))
{
resHeight = (int)Handles.GetMainGameViewSize().y;
resWidth = (int)Handles.GetMainGameViewSize().x;
}
if(GUILayout.Button("Default Size"))
{
resHeight = 1440;
resWidth = 2560;
scale = 1;
}
EditorGUILayout.EndVertical();
EditorGUILayout.Space();
EditorGUILayout.LabelField ("Screenshot will be taken at " + resWidth*scale + " x " + resHeight*scale + " px", EditorStyles.boldLabel);
if(GUILayout.Button("Take Screenshot",GUILayout.MinHeight(60)))
{
if(path == "")
{
path = EditorUtility.SaveFolderPanel("Path to Save Images",path,Application.dataPath);
Debug.Log("Path Set");
TakeHiResShot();
}
else
{
TakeHiResShot();
}
}
EditorGUILayout.Space();
EditorGUILayout.BeginHorizontal();
if(GUILayout.Button("Open Last Screenshot",GUILayout.MaxWidth(160),GUILayout.MinHeight(40)))
{
if(lastScreenshot != "")
{
Application.OpenURL("file://" + lastScreenshot);
Debug.Log("Opening File " + lastScreenshot);
}
}
if(GUILayout.Button("Open Folder",GUILayout.MaxWidth(100),GUILayout.MinHeight(40)))
{
Application.OpenURL("file://" + path);
}
if(GUILayout.Button("More replacedets",GUILayout.MaxWidth(100),GUILayout.MinHeight(40)))
{
Application.OpenURL("https://www.replacedetstore.unity3d.com/en/#!/publisher/5951");
}
EditorGUILayout.EndHorizontal();
if (takeHiResShot)
{
int resWidthN = resWidth*scale;
int resHeightN = resHeight*scale;
RenderTexture rt = new RenderTexture(resWidthN, resHeightN, 24);
myCamera.targetTexture = rt;
TextureFormat tFormat;
if(isTransparent)
tFormat = TextureFormat.ARGB32;
else
tFormat = TextureFormat.RGB24;
Texture2D screenShot = new Texture2D(resWidthN, resHeightN, tFormat,false);
myCamera.Render();
RenderTexture.active = rt;
screenShot.ReadPixels(new Rect(0, 0, resWidthN, resHeightN), 0, 0);
myCamera.targetTexture = null;
RenderTexture.active = null;
byte[] bytes = screenShot.EncodeToPNG();
string filename = ScreenShotName(resWidthN, resHeightN);
System.IO.File.WriteAllBytes(filename, bytes);
Debug.Log(string.Format("Took screenshot to: {0}", filename));
Application.OpenURL(filename);
takeHiResShot = false;
}
EditorGUILayout.HelpBox("In case of any error, make sure you have Unity Pro as the plugin requires Unity Pro to work.",MessageType.Info);
}
19
Source : ScreenshotTaker.cs
with Apache License 2.0
from activey
with Apache License 2.0
from activey
public void TakeHiResShot() {
Debug.Log("Taking Screenshot");
takeHiResShot = true;
}
19
Source : PostEffectsBase.cs
with Apache License 2.0
from activey
with Apache License 2.0
from activey
bool CheckShader (Shader s)
{
Debug.Log("The shader " + s.ToString () + " on effect "+ ToString () + " is not part of the Unity 3.2+ effects suite anymore. For best performance and quality, please ensure you are using the latest Standard replacedets Image Effects (Pro only) package.");
if (!s.isSupported)
{
NotSupported ();
return false;
}
else
{
return false;
}
}
19
Source : GraphSceneComponents.cs
with Apache License 2.0
from activey
with Apache License 2.0
from activey
public void AddEdgeComponent(EdgeComponent edgeComponent)
{
AbstractGraphEdge edge = edgeComponent.GetGraphEdge ();
NodeComponent edgeStartNode = GetNodeComponent (edge.GetStartGraphNode().GetId());
if (edgeStartNode == null) {
Debug.Log ("Unable to find start node component.");
return;
}
NodeComponent edgeEndNode = GetNodeComponent (edge.GetEndGraphNode().GetId());
if (edgeEndNode == null) {
Debug.Log ("Unable to find end node component.");
return;
}
edgeComponents.Add(edgeComponent);
edgeComponent.UpdateGeometry (edgeStartNode.GetVisualComponent().transform.position, edgeEndNode.GetVisualComponent().transform.position);
}
19
Source : PostEffectsBase.cs
with Apache License 2.0
from activey
with Apache License 2.0
from activey
protected Material CheckShaderAndCreateMaterial ( Shader s, Material m2Create)
{
if (!s)
{
Debug.Log("Missing shader in " + ToString ());
enabled = false;
return null;
}
if (s.isSupported && m2Create && m2Create.shader == s)
return m2Create;
if (!s.isSupported)
{
NotSupported ();
Debug.Log("The shader " + s.ToString() + " on effect "+ToString()+" is not supported on this platform!");
return null;
}
m2Create = new Material (s);
createdMaterials.Add (m2Create);
m2Create.hideFlags = HideFlags.DontSave;
return m2Create;
}
19
Source : PostEffectsBase.cs
with Apache License 2.0
from activey
with Apache License 2.0
from activey
protected Material CreateMaterial (Shader s, Material m2Create)
{
if (!s)
{
Debug.Log ("Missing shader in " + ToString ());
return null;
}
if (m2Create && (m2Create.shader == s) && (s.isSupported))
return m2Create;
if (!s.isSupported)
{
return null;
}
m2Create = new Material (s);
createdMaterials.Add (m2Create);
m2Create.hideFlags = HideFlags.DontSave;
return m2Create;
}
19
Source : PostEffectsHelper.cs
with Apache License 2.0
from activey
with Apache License 2.0
from activey
void OnRenderImage (RenderTexture source, RenderTexture destination)
{
Debug.Log("OnRenderImage in Helper called ...");
}
19
Source : NoiseAndScratches.cs
with Apache License 2.0
from activey
with Apache License 2.0
from activey
protected void Start ()
{
// Disable if we don't support image effects
if (!SystemInfo.supportsImageEffects) {
enabled = false;
return;
}
if ( shaderRGB == null || shaderYUV == null )
{
Debug.Log( "Noise shaders are not set up! Disabling noise effect." );
enabled = false;
}
else
{
if ( !shaderRGB.isSupported ) // disable effect if RGB shader is not supported
enabled = false;
else if ( !shaderYUV.isSupported ) // fallback to RGB if YUV is not supported
rgbFallback = true;
}
}
19
Source : ChatCommandHandler.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void TryHandle(string inputLine)
{
string[] strArray = inputLine.Substring(1).Split(' ');
if (!allCommands.TryGetValue(strArray[0].ToLower(), out ChatCommand cmd))
{
NotFound(strArray[0].ToLower());
return;
}
if (cmd.RequireMC && !PhotonNetwork.IsMasterClient)
{
UI.Chat.Add(ChatCommand.Lang["errMC"]);
return;
}
string[] args = CommandsExtensions.ParseCommandArgs(inputLine, 1);
try
{
if (cmd.Execute(args))
{
cmd.OnSuccess();
}
else
{
cmd.OnFail();
}
}
catch (System.Exception ex)
{
UI.Chat.Add(ChatCommand.Lang.Format("errExecute", cmd.CommandName));
UnityEngine.Debug.Log($"Exception occured while executing command: {cmd.CommandName}\nException message: {ex.Message}\nStackTrace:\n{ex.StackTrace}");
}
cmd.OnFinalize();
}
19
Source : DiscordSDK.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void DiscordLogCallback(SDK.LogLevel level, string message)
{
Debug.Log($"Discord:{level.ToString()} : {message}");
}
19
Source : Locale.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public string[] GetArray(string key)
{
string[] result;
if (localizedTextArrayCache.TryGetValue(key, out result))
{
return result;
}
try
{
result = localizedText[key].Split(Separator);
localizedTextArrayCache.Add(key, result);
}
catch
{
UnityEngine.Debug.Log("Invalid key: " + key);
throw;
}
return result;
}
19
Source : DiscordSDK.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void UpdateStatus()
{
if (!PhotonNetwork.inRoom)
{
if (PhotonNetwork.InsideLobby)
{
_Activity.State = "In lobby: " + Regex.Replace(PhotonNetwork.ServerAddress, "app\\-|\\.exitgamescloud\\.com|\\:\\d+", "").ToUpper().Replace("WS://", "").Replace("WSS://", "");
_Activity.Party.Size.CurrentSize = 0;
_Activity.Party.Size.MaxSize = 0;
_Activity.replacedets.LargeImage = "anarchyicon";
}
else if (IN_GAME_MAIN_CAMERA.GameType != GameType.Stop)
{
_Activity.State = "Solo: " + FengGameManagerMKII.Level.Name;
_Activity.Party.Size.CurrentSize = 0;
_Activity.Party.Size.MaxSize = 0;
_Activity.replacedets.LargeImage = FengGameManagerMKII.Level.DiscordName;
_Activity.replacedets.LargeText = FengGameManagerMKII.Level.Name;
}
else
{
_Activity.State = "In menu";
_Activity.Party.Size.CurrentSize = 0;
_Activity.Party.Size.MaxSize = 0;
_Activity.replacedets.LargeImage = "anarchyicon";
}
}
else
{
var text = PhotonNetwork.room.Name.Split('`')[0].RemoveHex();
_Activity.State = "Multiplayer: " + ((text.Length > 30) ? (text.Remove(27) + "...") : text);
_Activity.Party.Size.CurrentSize = PhotonNetwork.room.PlayerCount;
_Activity.Party.Size.MaxSize = PhotonNetwork.room.MaxPlayers;
_Activity.replacedets.LargeImage = FengGameManagerMKII.Level.DiscordName;
_Activity.replacedets.LargeText = FengGameManagerMKII.Level.Name;
}
_ActivityManager.UpdateActivity(_Activity, (result) =>
{
if (result != SDK.Result.Ok)
{
Debug.Log("Failed to update Activity.");
}
});
}
19
Source : AnarchyManager.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void OnApplicationQuit()
{
Antis.AntisThreadManager.OnApplicationQuit();
try
{
User.Save();
Network.BanList.Save();
GameModes.Load();
GameModes.Save();
Settings.Save();
Style.Save();
}
catch(Exception ex)
{
UnityEngine.Debug.Log("Error occured on ApplicationQuit\n" + ex.Message + "\n" + ex.StackTrace);
}
}
19
Source : ServerListPanel.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void OnJoinedLobby(AOTEventArgs args)
{
connected = true;
try
{
head = locale["connected"] + " " + regions[region];
}
catch
{
Debug.Log(locale == null);
Debug.Log(regions == null);
}
UpdateRoomList();
timeToUpdate = UpdateTime;
}
19
Source : AnarchyAssets.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public static Object Load(string name)
{
if (Bundle == null)
{
Debug.Log("Anarchyreplacedets bundle is null");
return null;
}
if (cache.TryGetValue(name, out Object result) && result != null)
{
return result;
}
result = Bundle.Load(name);
if (result != null)
{
cache.Add(name, result);
}
return result;
}
19
Source : ClothFactory.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public static GameObject GetHair(GameObject reference, string name, Material material, Color color)
{
List<GameObject> list;
bool flag = ClothFactory.clothCache.TryGetValue(name, out list);
GameObject result;
if (flag)
{
for (int i = 0; i < list.Count; i++)
{
GameObject gameObject = list[i];
bool flag2 = gameObject == null;
if (flag2)
{
Debug.Log("Hair is null");
list.RemoveAt(i);
i = Mathf.Max(i - 1, 0);
}
else
{
ParentFollow component = gameObject.GetComponent<ParentFollow>();
bool flag3 = !component.isActiveInScene;
if (flag3)
{
component.isActiveInScene = true;
gameObject.renderer.material = material;
gameObject.renderer.material.color = color;
gameObject.GetComponent<Cloth>().enabled = true;
gameObject.GetComponent<SkinnedMeshRenderer>().enabled = true;
gameObject.GetComponent<ParentFollow>().SetParent(reference.transform);
ClothFactory.ReapplyClothBones(reference, gameObject);
return gameObject;
}
}
}
GameObject gameObject2 = ClothFactory.GenerateCloth(reference, name);
gameObject2.renderer.material = material;
gameObject2.renderer.material.color = color;
gameObject2.AddComponent<ParentFollow>().SetParent(reference.transform);
list.Add(gameObject2);
ClothFactory.clothCache[name] = list;
result = gameObject2;
}
else
{
GameObject gameObject2 = ClothFactory.GenerateCloth(reference, name);
gameObject2.renderer.material = material;
gameObject2.renderer.material.color = color;
gameObject2.AddComponent<ParentFollow>().SetParent(reference.transform);
list = new List<GameObject>
{
gameObject2
};
ClothFactory.clothCache.Add(name, list);
result = gameObject2;
}
return result;
}
19
Source : TitanRPC.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
[RPC]
private void loadskinRPC(string body, string eye, PhotonMessageInfo info = null)
{
if (SkinSettings.replacedanSkins != 1)
{
return;
}
if(Anarchy.Network.Antis.IsValidSkinURL(ref body, 1, info.Sender.ID) == false || Anarchy.Network.Antis.IsValidSkinURL(ref eye, 1, info.Sender.ID) == false)
{
return;
}
if (Skin != null)
{
Debug.Log(
$"Trying to change replacedAN.Skin for viewID {BasePV.viewID} by ID {(info == null ? "-1" : info.Sender.ID.ToString())}");
return;
}
//Put antis there
StartCoroutine(loadskinRPCE(body, eye));
}
19
Source : InRoomRoundTimer.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void OnMasterClientSwitched(PhotonPlayer newMasterClient)
{
if (!PhotonNetwork.room.CustomProperties.ContainsKey("st"))
{
Debug.Log("The new master starts a new round, cause we didn't start yet.");
this.StartRoundNow();
}
}
19
Source : TitanRPC.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
[RPC]
private void loadskinRPC(string body, string eye, PhotonMessageInfo info = null)
{
if (SkinSettings.replacedanSkins != 1) return;
if (Skin != null)
{
Debug.Log(
$"Trying to change replacedAN.Skin for viewID {BasePV.viewID} by ID {(info == null ? "-1" : info.Sender.ID.ToString())}");
return;
}
//Put antis there
StartCoroutine(loadskinRPCE(body, eye));
}
19
Source : Test_CSharp.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Start()
{
this.Test();
Debug.Log("Test results:\n" + this.m_InGameLog);
}
19
Source : NGUIDebug.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public static void Log(string text)
{
if (Application.isPlaying)
{
if (NGUIDebug.mLines.Count > 20)
{
NGUIDebug.mLines.RemoveAt(0);
}
NGUIDebug.mLines.Add(text);
if (NGUIDebug.mInstance == null)
{
GameObject gameObject = new GameObject("_NGUI Debug");
NGUIDebug.mInstance = gameObject.AddComponent<NGUIDebug>();
UnityEngine.Object.DontDestroyOnLoad(gameObject);
}
}
else
{
Debug.Log(text);
}
}
19
Source : ConnectAndJoinRandom.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public virtual void OnConnectedToMaster()
{
if (PhotonNetwork.networkingPeer.AvailableRegions != null)
{
Debug.LogWarning(string.Concat(new object[]
{
"List of available regions counts ",
PhotonNetwork.networkingPeer.AvailableRegions.Count,
". First: ",
PhotonNetwork.networkingPeer.AvailableRegions[0],
" \t Current Region: ",
PhotonNetwork.networkingPeer.CloudRegion
}));
}
Debug.Log("OnConnectedToMaster() was called by PUN. Now this client is connected and could join a room. Calling: PhotonNetwork.JoinRandomRoom();");
PhotonNetwork.JoinRandomRoom();
}
19
Source : ConnectAndJoinRandom.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public virtual void OnJoinedLobby()
{
Debug.Log("OnJoinedLobby(). Use a GUI to show existing rooms available in PhotonNetwork.GetRoomList().");
}
19
Source : ConnectAndJoinRandom.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void OnJoinedRoom()
{
Debug.Log("OnJoinedRoom() called by PUN. Now this client is in a room. From here on, your game would be running. For reference, all callbacks are listed in enum: PhotonNetworkingMessage");
}
19
Source : ConnectAndJoinRandom.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public virtual void OnPhotonRandomJoinFailed()
{
Debug.Log("OnPhotonRandomJoinFailed() was called by PUN. No random room available, so we create one. Calling: PhotonNetwork.CreateRoom(null, new RoomOptions() {maxPlayers = 4}, null);");
PhotonNetwork.CreateRoom(null, new RoomOptions
{
maxPlayers = 4
}, null);
}
19
Source : ConnectAndJoinRandom.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public virtual void Update()
{
if (this.ConnectInUpdate && this.AutoConnect && !PhotonNetwork.connected)
{
Debug.Log("Update() was called by Unity. Scene is loaded. Let's connect to the Photon Master Server. Calling: PhotonNetwork.ConnectUsingSettings();");
this.ConnectInUpdate = false;
PhotonNetwork.ConnectUsingSettings("2." + Application.loadedLevel);
}
}
19
Source : OnAwakeUsePhotonView.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
[RPC]
public void OnAwakeRPC(byte myParameter)
{
Debug.Log(string.Concat(new object[]
{
"RPC: 'OnAwakeRPC' Parameter: ",
myParameter,
" PhotonView: ",
BasePV
}));
}
19
Source : OnJoinedInstantiate.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void OnJoinedRoom()
{
if (this.PrefabsToInstantiate != null)
{
foreach (GameObject gameObject in this.PrefabsToInstantiate)
{
Debug.Log("Instantiating: " + gameObject.name);
Vector3 a = Vectors.up;
if (this.SpawnPosition != null)
{
a = this.SpawnPosition.position;
}
Vector3 a2 = UnityEngine.Random.insideUnitSphere;
a2.y = 0f;
a2 = a2.normalized;
Vector3 position = a + this.PositionOffset * a2;
Optimization.Caching.Pool.NetworkEnable(gameObject.name, position, Quaternion.idenreplacedy, 0);
}
}
}
19
Source : PhotonHandler.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void DebugReturn(DebugLevel level, string message)
{
if (level == DebugLevel.ERROR)
{
Debug.LogError(message);
}
else if (level == DebugLevel.WARNING)
{
Debug.LogWarning(message);
}
else if (level == DebugLevel.INFO && PhotonNetwork.logLevel >= PhotonLogLevel.Informational)
{
Debug.Log(message);
}
else if (level == DebugLevel.ALL && PhotonNetwork.logLevel == PhotonLogLevel.Full)
{
Debug.Log(message);
}
}
19
Source : PhotonNetwork.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public static void InternalCleanPhotonMonoFromSceneIfStuck()
{
PhotonHandler[] array = UnityEngine.Object.FindObjectsOfType(typeof(PhotonHandler)) as PhotonHandler[];
if (array != null && array.Length > 0)
{
Debug.Log("Cleaning up hidden PhotonHandler instances in scene. Please save it. This is not an issue.");
foreach (PhotonHandler photonHandler in array)
{
photonHandler.gameObject.hideFlags = HideFlags.None;
if (photonHandler.gameObject != null && photonHandler.gameObject.name == "PhotonMono")
{
UnityEngine.Object.DestroyImmediate(photonHandler.gameObject);
}
UnityEngine.Object.DestroyImmediate(photonHandler);
}
}
}
19
Source : PhotonStatsGui.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void TrafficStatsWindow(int windowID)
{
bool flag = false;
TrafficStatsGameLevel trafficStatsGameLevel = PhotonNetwork.networkingPeer.TrafficStatsGameLevel;
long num = PhotonNetwork.networkingPeer.TrafficStatsElapsedMs / 1000L;
if (num == 0L)
{
num = 1L;
}
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
this.buttonsOn = GUILayout.Toggle(this.buttonsOn, "buttons", new GUILayoutOption[0]);
this.healthStatsVisible = GUILayout.Toggle(this.healthStatsVisible, "health", new GUILayoutOption[0]);
this.trafficStatsOn = GUILayout.Toggle(this.trafficStatsOn, "traffic", new GUILayoutOption[0]);
GUILayout.EndHorizontal();
string text = string.Format("Out|In|Sum:\t{0,4} | {1,4} | {2,4}", trafficStatsGameLevel.TotalOutgoingMessageCount, trafficStatsGameLevel.TotalIncomingMessageCount, trafficStatsGameLevel.TotalMessageCount);
string text2 = string.Format("{0}sec average:", num);
string text3 = string.Format("Out|In|Sum:\t{0,4} | {1,4} | {2,4}", (long)trafficStatsGameLevel.TotalOutgoingMessageCount / num, (long)trafficStatsGameLevel.TotalIncomingMessageCount / num, (long)trafficStatsGameLevel.TotalMessageCount / num);
GUILayout.Label(text, new GUILayoutOption[0]);
GUILayout.Label(text2, new GUILayoutOption[0]);
GUILayout.Label(text3, new GUILayoutOption[0]);
if (this.buttonsOn)
{
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
this.statsOn = GUILayout.Toggle(this.statsOn, "stats on", new GUILayoutOption[0]);
if (GUILayout.Button("Reset", new GUILayoutOption[0]))
{
PhotonNetwork.networkingPeer.TrafficStatsReset();
PhotonNetwork.networkingPeer.TrafficStatsEnabled = true;
}
flag = GUILayout.Button("To Log", new GUILayoutOption[0]);
GUILayout.EndHorizontal();
}
string text4 = string.Empty;
string text5 = string.Empty;
if (this.trafficStatsOn)
{
text4 = "Incoming: " + PhotonNetwork.networkingPeer.TrafficStatsIncoming.ToString();
text5 = "Outgoing: " + PhotonNetwork.networkingPeer.TrafficStatsOutgoing.ToString();
GUILayout.Label(text4, new GUILayoutOption[0]);
GUILayout.Label(text5, new GUILayoutOption[0]);
}
string text6 = string.Empty;
if (this.healthStatsVisible)
{
text6 = string.Format("ping: {6}[+/-{7}]ms\nlongest delta between\nsend: {0,4}ms disp: {1,4}ms\nlongest time for:\nev({3}):{2,3}ms op({5}):{4,3}ms", new object[]
{
trafficStatsGameLevel.LongestDeltaBetweenSending,
trafficStatsGameLevel.LongestDeltaBetweenDispatching,
trafficStatsGameLevel.LongestEventCallback,
trafficStatsGameLevel.LongestEventCallbackCode,
trafficStatsGameLevel.LongestOpResponseCallback,
trafficStatsGameLevel.LongestOpResponseCallbackOpCode,
PhotonNetwork.networkingPeer.RoundTripTime,
PhotonNetwork.networkingPeer.RoundTripTimeVariance
});
GUILayout.Label(text6, new GUILayoutOption[0]);
}
if (flag)
{
string message = string.Format("{0}\n{1}\n{2}\n{3}\n{4}\n{5}", new object[]
{
text,
text2,
text3,
text4,
text5,
text6
});
Debug.Log(message);
}
if (GUI.changed)
{
this.statsRect.height = 100f;
}
GUI.DragWindow();
}
19
Source : PickupItem.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
[RPC]
internal void PunRespawn(Vector3 pos)
{
Debug.Log("PunRespawn with Position.");
this.PunRespawn();
base.gameObject.transform.position = pos;
}
19
Source : PickupItem.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
[RPC]
public void PunPickup(PhotonMessageInfo msgInfo)
{
if (msgInfo.Sender.IsLocal)
{
this.SentPickup = false;
}
if (!base.gameObject.GetActive())
{
Debug.Log(string.Concat(new object[]
{
"Ignored PU RPC, cause item is inactive. ",
base.gameObject,
" SecondsBeforeRespawn: ",
this.SecondsBeforeRespawn,
" TimeOfRespawn: ",
this.TimeOfRespawn,
" respawn in future: ",
this.TimeOfRespawn > PhotonNetwork.time
}));
return;
}
this.PickupIsMine = msgInfo.Sender.IsLocal;
if (this.OnPickedUpCall != null)
{
this.OnPickedUpCall.SendMessage("OnPickedUp", this);
}
if (this.SecondsBeforeRespawn <= 0f)
{
this.PickedUp(0f);
}
else
{
double num = PhotonNetwork.time - msgInfo.Timestamp;
double num2 = (double)this.SecondsBeforeRespawn - num;
if (num2 > 0.0)
{
this.PickedUp((float)num2);
}
}
}
19
Source : PickupItemSyncer.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void SendPickedUpItems(PhotonPlayer targtePlayer)
{
if (targtePlayer == null)
{
Debug.LogWarning("Cant send PickupItem spawn times to unknown targetPlayer.");
return;
}
double time = PhotonNetwork.time;
double num = time + 0.20000000298023224;
PickupItem[] array = new PickupItem[PickupItem.DisabledPickupItems.Count];
PickupItem.DisabledPickupItems.CopyTo(array);
List<float> list = new List<float>(array.Length * 2);
foreach (PickupItem pickupItem in array)
{
if (pickupItem.SecondsBeforeRespawn <= 0f)
{
list.Add((float)pickupItem.ViewID);
list.Add(0f);
}
else
{
double num2 = pickupItem.TimeOfRespawn - PhotonNetwork.time;
if (pickupItem.TimeOfRespawn > num)
{
Debug.Log(string.Concat(new object[]
{
pickupItem.ViewID,
" respawn: ",
pickupItem.TimeOfRespawn,
" timeUntilRespawn: ",
num2,
" (now: ",
PhotonNetwork.time,
")"
}));
list.Add((float)pickupItem.ViewID);
list.Add((float)num2);
}
}
}
Debug.Log(string.Concat(new object[]
{
"Sent count: ",
list.Count,
" now: ",
time
}));
BasePV.RPC("PickupItemInit", targtePlayer, new object[]
{
PhotonNetwork.time,
list.ToArray()
});
}
19
Source : PickupItemSyncer.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void AskForPickupItemSpawnTimes()
{
if (this.IsWaitingForPickupInit)
{
if (PhotonNetwork.playerList.Length < 2)
{
Debug.Log("Cant ask anyone else for PickupItem spawn times.");
this.IsWaitingForPickupInit = false;
return;
}
PhotonPlayer next = PhotonNetwork.masterClient.GetNext();
if (next == null || next.Equals(PhotonNetwork.player))
{
next = PhotonNetwork.player.GetNext();
}
if (next != null && !next.Equals(PhotonNetwork.player))
{
BasePV.RPC("RequestForPickupTimes", next, new object[0]);
}
else
{
Debug.Log("No player left to ask");
this.IsWaitingForPickupInit = false;
}
}
}
19
Source : PickupItemSyncer.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void OnJoinedRoom()
{
Debug.Log(string.Concat(new object[]
{
"Joined Room. isMasterClient: ",
PhotonNetwork.IsMasterClient,
" id: ",
PhotonNetwork.player.ID
}));
this.IsWaitingForPickupInit = !PhotonNetwork.IsMasterClient;
if (PhotonNetwork.playerList.Length >= 2)
{
base.Invoke("AskForPickupItemSpawnTimes", 2f);
}
}
19
Source : PickupItemSyncer.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
[RPC]
public void PickupItemInit(double timeBase, float[] inactivePickupsAndTimes)
{
this.IsWaitingForPickupInit = false;
for (int i = 0; i < inactivePickupsAndTimes.Length / 2; i++)
{
int num = i * 2;
int viewID = (int)inactivePickupsAndTimes[num];
float num2 = inactivePickupsAndTimes[num + 1];
PhotonView photonView = PhotonView.Find(viewID);
PickupItem component = photonView.GetComponent<PickupItem>();
if (num2 <= 0f)
{
component.PickedUp(0f);
}
else
{
double num3 = (double)num2 + timeBase;
Debug.Log(string.Concat(new object[]
{
photonView.viewID,
" respawn: ",
num3,
" timeUntilRespawnBasedOnTimeBase:",
num2,
" SecondsBeforeRespawn: ",
component.SecondsBeforeRespawn
}));
double num4 = num3 - PhotonNetwork.time;
if (num2 <= 0f)
{
num4 = 0.0;
}
component.PickedUp((float)num4);
}
}
}
19
Source : XffectCache.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
protected Transform AddObject(string name)
{
Transform transform = base.transform.Find(name);
if (transform == null)
{
Debug.Log("object:" + name + "doesn't exist!");
return null;
}
Transform transform2 = UnityEngine.Object.Instantiate(transform, Vectors.zero, Quaternion.idenreplacedy) as Transform;
this.ObjectDic[name].Add(transform2);
transform2.gameObject.SetActive(false);
Xffect component = transform2.GetComponent<Xffect>();
if (component != null)
{
component.Initialize();
}
return transform2;
}
19
Source : SupportLogging.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void LogBasics()
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendFormat("SupportLogger Info: PUN {0}: ", PhotonNetwork.versionPUN);
stringBuilder.AppendFormat("AppID: {0}*** GameVersion: {1} ", PhotonNetwork.networkingPeer.mAppId.Substring(0, 8), PhotonNetwork.networkingPeer.mAppVersionPun);
stringBuilder.AppendFormat("Server: {0}. Region: {1} ", PhotonNetwork.ServerAddress, PhotonNetwork.networkingPeer.CloudRegion);
stringBuilder.AppendFormat("HostType: {0} ", PhotonNetwork.PhotonServerSettings.HostType);
Debug.Log(stringBuilder.ToString());
}
19
Source : SupportLogging.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void OnConnectedToPhoton()
{
Debug.Log("SupportLogger OnConnectedToPhoton().");
this.LogBasics();
if (this.LogTrafficStats)
{
PhotonNetwork.NetworkStatisticsEnabled = true;
}
}
19
Source : SupportLogging.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void OnCreatedRoom()
{
Debug.Log(string.Concat(new object[]
{
"SupportLogger OnCreatedRoom(",
PhotonNetwork.room,
"). ",
PhotonNetwork.lobby
}));
}
19
Source : SupportLogging.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void OnJoinedRoom()
{
Debug.Log(string.Concat(new object[]
{
"SupportLogger OnJoinedRoom(",
PhotonNetwork.room,
"). ",
PhotonNetwork.lobby
}));
}
19
Source : SupportLogging.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void OnLeftRoom()
{
Debug.Log("SupportLogger OnLeftRoom().");
}
19
Source : NewBehaviourScript.cs
with MIT License
from akof1314
with MIT License
from akof1314
[ContextMenu("test")]
public void Test()
{
Debug.Log("abcabc");
Debug.Log("a222bcabc");
Debug.Log("abcabc");
Debug.LogError("Opens replacedet in an external editor, \ntexture application or modelling tool depending on what type of replacedet it is. \nIf it is a text file, lineNumber instructs the text editor to go to that line. Returns true if replacedet opened successfully.");
Debug.Log("abcabc");
Debug.LogWarning("Description");
Test1("aaaa1");
}
19
Source : NewBehaviourScript.cs
with MIT License
from akof1314
with MIT License
from akof1314
[ContextMenu("test")]
public void Test()
{
Debug.Log("abcabc");
Debug.Log("a222bcabc");
Debug.Log("abcabc");
Debug.LogError("Opens replacedet in an external editor, \ntexture application or modelling tool depending on what type of replacedet it is. \nIf it is a text file, lineNumber instructs the text editor to go to that line. Returns true if replacedet opened successfully.");
Debug.Log("abcabc");
Debug.LogWarning("Description");
Test1("aaaa11");
}
19
Source : NewBehaviourScript.cs
with MIT License
from akof1314
with MIT License
from akof1314
private void Test2()
{
Debug.Log("more");
}
19
Source : NewBehaviourScript.cs
with MIT License
from akof1314
with MIT License
from akof1314
[ContextMenu("test2")]
public void Test22()
{
Debug.Log("We are <>usually");
Debug.Log("We are <i>usually</i> not amused <b>error</>");
Debug.Log("We are <b>usually</b> not amused");
Debug.Log("We are <i>usually</i> not amused");
//Debug.Log("We are <size=8>usually</size> not amused.");
Debug.Log("We are <color=#00ffff>usually</color> not amused.");
Debug.Log("We are <color=magenta>usually</color> not amused.");
Debug.Log("We are <quad material=1 size=5 x=0.1 y=0.1 width=0.5 height=0.5 />usually not amused.");
}
19
Source : NewBehaviourScript.cs
with MIT License
from akof1314
with MIT License
from akof1314
private void Test2()
{
Debug.Log("more");
string a = "aaaa";
a.LastIndexOf('.', 8, 20);
}
19
Source : NewBehaviourScript.cs
with MIT License
from akof1314
with MIT License
from akof1314
private void Test3()
{
for (int i = 0; i < 9999; i++)
{
Debug.LogError("A variant of Debug.Log that logs an error message to the console.");
Debug.Log("replacedert a condition and logs an error message to the Unity console on failure");
Debug.LogWarning("Clreplaced containing methods to ease debugging while developing a game");
}
}
19
Source : Class1.cs
with MIT License
from akof1314
with MIT License
from akof1314
[ContextMenu("test0")]
public void Test0()
{
Debug.Log("DLLabcabc");
Debug.LogError("DLLabcabc22222222222222");
Test1();
}
See More Examples