온라인 구현
This commit is contained in:
6119
Assets/Photon/PhotonChat/Demos/Demo Chat/Chat-Scene.unity
Normal file
6119
Assets/Photon/PhotonChat/Demos/Demo Chat/Chat-Scene.unity
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34000188cb69376469c1894be10c5bc2
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Chat-Scene.unity
|
||||
uploadId: 817708
|
||||
8
Assets/Photon/PhotonChat/Demos/Demo Chat/Code.meta
Normal file
8
Assets/Photon/PhotonChat/Demos/Demo Chat/Code.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7eb0bd8aaf2d990469e7842113c31ac3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
namespace Photon.Chat.DemoChat
|
||||
{
|
||||
public class ChannelSelector : MonoBehaviour, IPointerClickHandler
|
||||
{
|
||||
public string Channel;
|
||||
|
||||
public void SetChannel(string channel)
|
||||
{
|
||||
this.Channel = channel;
|
||||
Text t = GetComponentInChildren<Text>();
|
||||
t.text = this.Channel;
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
ChatNewGui handler = GameObject.FindFirstObjectByType<ChatNewGui>();
|
||||
#else
|
||||
ChatNewGui handler = FindObjectOfType<ChatNewGui>();
|
||||
#endif
|
||||
handler.ShowChannel(this.Channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48caa72710147fc4f9389b0b5ec6137d
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Code/ChannelSelector.cs
|
||||
uploadId: 817708
|
||||
651
Assets/Photon/PhotonChat/Demos/Demo Chat/Code/ChatNewGui.cs
Normal file
651
Assets/Photon/PhotonChat/Demos/Demo Chat/Code/ChatNewGui.cs
Normal file
@@ -0,0 +1,651 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
namespace Photon.Chat.DemoChat
|
||||
{
|
||||
/// <summary>
|
||||
/// This simple Chat UI demonstrate basics usages of the Chat Api
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The ChatClient basically lets you create any number of channels.
|
||||
///
|
||||
/// some friends are already set in the Chat demo "DemoChat-Scene", 'Joe', 'Jane' and 'Bob', simply log with them so that you can see the status changes in the Interface
|
||||
///
|
||||
/// Workflow:
|
||||
/// Create ChatClient, Connect to a server with your AppID, Authenticate the user (apply a unique name,)
|
||||
/// and subscribe to some channels.
|
||||
/// Subscribe a channel before you publish to that channel!
|
||||
///
|
||||
///
|
||||
/// Note:
|
||||
/// Don't forget to call ChatClient.Service() on Update to keep the Chatclient operational.
|
||||
/// </remarks>
|
||||
public class ChatNewGui : MonoBehaviour, IChatClientListener
|
||||
{
|
||||
public string[] ChannelsToJoinOnConnect; // set in inspector. Demo channels to join automatically.
|
||||
|
||||
public string[] FriendsList; // this is a hidden inspector field! use debug mode to see and edit it
|
||||
|
||||
public int HistoryLengthToFetch; // set in inspector. Up to a certain degree, previously sent messages can be fetched for context
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
private string selectedChannelName; // mainly used for GUI/input
|
||||
|
||||
public ChatClient chatClient;
|
||||
|
||||
public GameObject ConnectingLabel;
|
||||
|
||||
public RectTransform ChatPanel; // set in inspector (to enable/disable panel)
|
||||
public GameObject UserIdFormPanel;
|
||||
public InputField InputFieldChat; // set in inspector
|
||||
public Text CurrentChannelText; // set in inspector
|
||||
public Toggle ChannelToggleToInstantiate; // set in inspector
|
||||
|
||||
|
||||
public GameObject FriendListUiItemtoInstantiate;
|
||||
|
||||
private readonly Dictionary<string, Toggle> channelToggles = new Dictionary<string, Toggle>();
|
||||
|
||||
private readonly Dictionary<string, FriendItem> friendListItemLUT = new Dictionary<string, FriendItem>();
|
||||
|
||||
public bool ShowState = true;
|
||||
public GameObject Title;
|
||||
public Text StateText; // set in inspector
|
||||
public Text UserIdText; // set in inspector
|
||||
|
||||
// private static string WelcomeText = "Welcome to chat. Type \\help to list commands.";
|
||||
private static string HelpText = "\n -- HELP --\n" +
|
||||
"To subscribe to channel(s):\n" +
|
||||
"\t<color=#E07B00>\\subscribe</color> <color=green><list of channelnames></color>\n" +
|
||||
"\tor\n" +
|
||||
"\t<color=#E07B00>\\s</color> <color=green><list of channelnames></color>\n" +
|
||||
"\n" +
|
||||
"To leave channel(s):\n" +
|
||||
"\t<color=#E07B00>\\unsubscribe</color> <color=green><list of channelnames></color>\n" +
|
||||
"\tor\n" +
|
||||
"\t<color=#E07B00>\\u</color> <color=green><list of channelnames></color>\n" +
|
||||
"\n" +
|
||||
"To switch the active channel\n" +
|
||||
"\t<color=#E07B00>\\join</color> <color=green><channelname></color>\n" +
|
||||
"\tor\n" +
|
||||
"\t<color=#E07B00>\\j</color> <color=green><channelname></color>\n" +
|
||||
"\n" +
|
||||
"To send a private message:\n" +
|
||||
"\t\\<color=#E07B00>msg</color> <color=green><username></color> <color=green><message></color>\n" +
|
||||
"\n" +
|
||||
"To add friend(s):\n" +
|
||||
"\t\\<color=#E07B00>friend</color> <color=green><username></color> [<color=green><username></color>]\n" +
|
||||
"\n" +
|
||||
"To remove friend(s):\n" +
|
||||
"\t\\<color=#E07B00>unfriend</color> <color=green><username></color> [<color=green><username></color>]\n" +
|
||||
"\n" +
|
||||
"To change status:\n" +
|
||||
"\t\\<color=#E07B00>state</color> <color=green><stateIndex></color> <color=green><message></color>\n" +
|
||||
"<color=green>0</color> = Offline " +
|
||||
"<color=green>1</color> = Invisible " +
|
||||
"<color=green>2</color> = Online " +
|
||||
"<color=green>3</color> = Away \n" +
|
||||
"<color=green>4</color> = Do not disturb " +
|
||||
"<color=green>5</color> = Looking For Group " +
|
||||
"<color=green>6</color> = Playing" +
|
||||
"\n\n" +
|
||||
"To clear the current chat tab (private chats get closed):\n" +
|
||||
"\t<color=#E07B00>\\clear</color>";
|
||||
|
||||
|
||||
public void Start()
|
||||
{
|
||||
DontDestroyOnLoad(gameObject);
|
||||
|
||||
|
||||
UserIdText.text = "";
|
||||
StateText.text = "";
|
||||
StateText.gameObject.SetActive(true);
|
||||
UserIdText.gameObject.SetActive(true);
|
||||
Title.SetActive(true);
|
||||
ChatPanel.gameObject.SetActive(false);
|
||||
ConnectingLabel.SetActive(false);
|
||||
|
||||
if (string.IsNullOrEmpty(UserName))
|
||||
{
|
||||
UserName = "user" + Environment.TickCount % 99; //made-up username
|
||||
}
|
||||
|
||||
this.UserIdFormPanel.gameObject.SetActive(true);
|
||||
|
||||
if (string.IsNullOrEmpty(ChatSettings.Instance.AppId))
|
||||
{
|
||||
Debug.LogError("You need to set the chat app ID in the PhotonServerSettings file in order to continue.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void Connect()
|
||||
{
|
||||
this.UserIdFormPanel.gameObject.SetActive(false);
|
||||
|
||||
this.chatClient = new ChatClient(this);
|
||||
|
||||
#if UNITY_WEBGL
|
||||
this.chatClient.UseBackgroundWorkerForSending = false;
|
||||
#else
|
||||
this.chatClient.UseBackgroundWorkerForSending = true;
|
||||
#endif
|
||||
|
||||
this.chatClient.Connect(ChatSettings.Instance.AppId, "1.0", new AuthenticationValues(UserName));
|
||||
|
||||
this.ChannelToggleToInstantiate.gameObject.SetActive(false);
|
||||
Debug.Log("Connecting as: " + UserName);
|
||||
|
||||
ConnectingLabel.SetActive(true);
|
||||
}
|
||||
|
||||
/// <summary>To avoid that the Editor becomes unresponsive, disconnect all Photon connections in OnDestroy.</summary>
|
||||
public void OnDestroy()
|
||||
{
|
||||
if (this.chatClient != null)
|
||||
{
|
||||
this.chatClient.Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>To avoid that the Editor becomes unresponsive, disconnect all Photon connections in OnApplicationQuit.</summary>
|
||||
public void OnApplicationQuit()
|
||||
{
|
||||
if (this.chatClient != null)
|
||||
{
|
||||
this.chatClient.Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (this.chatClient != null)
|
||||
{
|
||||
this.chatClient.Service(); // make sure to call this regularly! it limits effort internally, so calling often is ok!
|
||||
}
|
||||
|
||||
// check if we are missing context, which means we got kicked out to get back to the Photon Demo hub.
|
||||
if (this.StateText == null)
|
||||
{
|
||||
Destroy(this.gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
this.StateText.gameObject.SetActive(ShowState); // this could be handled more elegantly, but for the demo it's ok.
|
||||
}
|
||||
|
||||
|
||||
public void OnEnterSend()
|
||||
{
|
||||
if (Input.GetKey(KeyCode.Return) || Input.GetKey(KeyCode.KeypadEnter))
|
||||
{
|
||||
SendChatMessage(this.InputFieldChat.text);
|
||||
this.InputFieldChat.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
public void OnClickSend()
|
||||
{
|
||||
if (this.InputFieldChat != null)
|
||||
{
|
||||
SendChatMessage(this.InputFieldChat.text);
|
||||
this.InputFieldChat.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int TestLength = 2048;
|
||||
private byte[] testBytes = new byte[2048];
|
||||
|
||||
private void SendChatMessage(string inputLine)
|
||||
{
|
||||
if (string.IsNullOrEmpty(inputLine))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ("test".Equals(inputLine))
|
||||
{
|
||||
if (this.TestLength != this.testBytes.Length)
|
||||
{
|
||||
this.testBytes = new byte[this.TestLength];
|
||||
}
|
||||
|
||||
this.chatClient.SendPrivateMessage(this.chatClient.AuthValues.UserId, testBytes, true);
|
||||
}
|
||||
|
||||
|
||||
bool doingPrivateChat = this.chatClient.PrivateChannels.ContainsKey(this.selectedChannelName);
|
||||
string privateChatTarget = string.Empty;
|
||||
if (doingPrivateChat)
|
||||
{
|
||||
// the channel name for a private conversation is (on the client!!) always composed of both user's IDs: "this:remote"
|
||||
// so the remote ID is simple to figure out
|
||||
|
||||
string[] splitNames = this.selectedChannelName.Split(new char[] { ':' });
|
||||
privateChatTarget = splitNames[1];
|
||||
}
|
||||
//UnityEngine.Debug.Log("selectedChannelName: " + selectedChannelName + " doingPrivateChat: " + doingPrivateChat + " privateChatTarget: " + privateChatTarget);
|
||||
|
||||
|
||||
if (inputLine[0].Equals('\\'))
|
||||
{
|
||||
string[] tokens = inputLine.Split(new char[] { ' ' }, 2);
|
||||
if (tokens[0].Equals("\\help"))
|
||||
{
|
||||
PostHelpToCurrentChannel();
|
||||
}
|
||||
|
||||
if (tokens[0].Equals("\\state"))
|
||||
{
|
||||
int newState = 0;
|
||||
|
||||
|
||||
List<string> messages = new List<string>();
|
||||
messages.Add("i am state " + newState);
|
||||
string[] subtokens = tokens[1].Split(new char[] { ' ', ',' });
|
||||
|
||||
if (subtokens.Length > 0)
|
||||
{
|
||||
newState = int.Parse(subtokens[0]);
|
||||
}
|
||||
|
||||
if (subtokens.Length > 1)
|
||||
{
|
||||
messages.Add(subtokens[1]);
|
||||
}
|
||||
|
||||
this.chatClient.SetOnlineStatus(newState, messages.ToArray()); // this is how you set your own state and (any) message
|
||||
}
|
||||
else if ((tokens[0].Equals("\\subscribe") || tokens[0].Equals("\\s")) && !string.IsNullOrEmpty(tokens[1]))
|
||||
{
|
||||
this.chatClient.Subscribe(tokens[1].Split(new char[] { ' ', ',' }));
|
||||
}
|
||||
else if ((tokens[0].Equals("\\unsubscribe") || tokens[0].Equals("\\u")) && !string.IsNullOrEmpty(tokens[1]))
|
||||
{
|
||||
this.chatClient.Unsubscribe(tokens[1].Split(new char[] { ' ', ',' }));
|
||||
}
|
||||
else if (tokens[0].Equals("\\clear"))
|
||||
{
|
||||
if (doingPrivateChat)
|
||||
{
|
||||
this.chatClient.PrivateChannels.Remove(this.selectedChannelName);
|
||||
}
|
||||
else
|
||||
{
|
||||
ChatChannel channel;
|
||||
if (this.chatClient.TryGetChannel(this.selectedChannelName, doingPrivateChat, out channel))
|
||||
{
|
||||
channel.ClearMessages();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (tokens[0].Equals("\\msg") && !string.IsNullOrEmpty(tokens[1]))
|
||||
{
|
||||
string[] subtokens = tokens[1].Split(new char[] { ' ', ',' }, 2);
|
||||
if (subtokens.Length < 2)
|
||||
return;
|
||||
|
||||
string targetUser = subtokens[0];
|
||||
string message = subtokens[1];
|
||||
this.chatClient.SendPrivateMessage(targetUser, message);
|
||||
}
|
||||
else if ((tokens[0].Equals("\\join") || tokens[0].Equals("\\j")) && !string.IsNullOrEmpty(tokens[1]))
|
||||
{
|
||||
string[] subtokens = tokens[1].Split(new char[] { ' ', ',' }, 2);
|
||||
|
||||
// If we are already subscribed to the channel we directly switch to it, otherwise we subscribe to it first and then switch to it implicitly
|
||||
if (channelToggles.ContainsKey(subtokens[0]))
|
||||
{
|
||||
ShowChannel(subtokens[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.chatClient.Subscribe(new string[] { subtokens[0] });
|
||||
}
|
||||
}
|
||||
else if (tokens[0].Equals("\\friend") && !string.IsNullOrEmpty(tokens[1]))
|
||||
{
|
||||
string[] friends = tokens[1].Split(new char[] { ' ', ',' });
|
||||
|
||||
Debug.Log("Adding friends (" + friends.Length + "): " + string.Join(",", friends));
|
||||
this.chatClient.AddFriends(friends);
|
||||
foreach (string _friend in friends)
|
||||
{
|
||||
if (this.FriendListUiItemtoInstantiate != null && _friend != this.UserName)
|
||||
{
|
||||
this.InstantiateFriendButton(_friend);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (tokens[0].Equals("\\unfriend") && !string.IsNullOrEmpty(tokens[1]))
|
||||
{
|
||||
string[] friends = tokens[1].Split(new char[] { ' ', ',' });
|
||||
|
||||
Debug.Log("Removing friends (" + friends.Length + "): " + string.Join(",", friends));
|
||||
this.chatClient.RemoveFriends(friends);
|
||||
foreach (string _friend in friends)
|
||||
{
|
||||
if (this.FriendListUiItemtoInstantiate != null && _friend != this.UserName)
|
||||
{
|
||||
this.DestroyFriendButton(_friend);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("The command '" + tokens[0] + "' is invalid.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (doingPrivateChat)
|
||||
{
|
||||
this.chatClient.SendPrivateMessage(privateChatTarget, inputLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.chatClient.PublishMessage(this.selectedChannelName, inputLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void PostHelpToCurrentChannel()
|
||||
{
|
||||
this.CurrentChannelText.text += HelpText;
|
||||
}
|
||||
|
||||
public void DebugReturn(ExitGames.Client.Photon.DebugLevel level, string message)
|
||||
{
|
||||
if (level == ExitGames.Client.Photon.DebugLevel.ERROR)
|
||||
{
|
||||
UnityEngine.Debug.LogError(message);
|
||||
}
|
||||
else if (level == ExitGames.Client.Photon.DebugLevel.WARNING)
|
||||
{
|
||||
UnityEngine.Debug.LogWarning(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
UnityEngine.Debug.Log(message);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnConnected()
|
||||
{
|
||||
if (this.ChannelsToJoinOnConnect != null && this.ChannelsToJoinOnConnect.Length > 0)
|
||||
{
|
||||
this.chatClient.Subscribe(this.ChannelsToJoinOnConnect, this.HistoryLengthToFetch);
|
||||
}
|
||||
|
||||
ConnectingLabel.SetActive(false);
|
||||
|
||||
UserIdText.text = "Connected as " + this.UserName;
|
||||
|
||||
this.ChatPanel.gameObject.SetActive(true);
|
||||
|
||||
if (FriendsList != null && FriendsList.Length > 0)
|
||||
{
|
||||
this.chatClient.AddFriends(FriendsList); // Add some users to the server-list to get their status updates
|
||||
|
||||
// add to the UI as well
|
||||
foreach (string _friend in FriendsList)
|
||||
{
|
||||
if (this.FriendListUiItemtoInstantiate != null && _friend != this.UserName)
|
||||
{
|
||||
this.InstantiateFriendButton(_friend);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.FriendListUiItemtoInstantiate != null)
|
||||
{
|
||||
this.FriendListUiItemtoInstantiate.SetActive(false);
|
||||
}
|
||||
|
||||
|
||||
this.chatClient.SetOnlineStatus(ChatUserStatus.Online); // You can set your online state (without a mesage).
|
||||
}
|
||||
|
||||
public void OnDisconnected()
|
||||
{
|
||||
ConnectingLabel.SetActive(false);
|
||||
}
|
||||
|
||||
public void OnChatStateChange(ChatState state)
|
||||
{
|
||||
// use OnConnected() and OnDisconnected()
|
||||
// this method might become more useful in the future, when more complex states are being used.
|
||||
|
||||
this.StateText.text = state.ToString();
|
||||
}
|
||||
|
||||
public void OnSubscribed(string[] channels, bool[] results)
|
||||
{
|
||||
// in this demo, we simply send a message into each channel. This is NOT a must have!
|
||||
foreach (string channel in channels)
|
||||
{
|
||||
this.chatClient.PublishMessage(channel, "says 'hi'."); // you don't HAVE to send a msg on join but you could.
|
||||
|
||||
if (this.ChannelToggleToInstantiate != null)
|
||||
{
|
||||
this.InstantiateChannelButton(channel);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log("OnSubscribed: " + string.Join(", ", channels));
|
||||
|
||||
/*
|
||||
// select first subscribed channel in alphabetical order
|
||||
if (this.chatClient.PublicChannels.Count > 0)
|
||||
{
|
||||
var l = new List<string>(this.chatClient.PublicChannels.Keys);
|
||||
l.Sort();
|
||||
string selected = l[0];
|
||||
if (this.channelToggles.ContainsKey(selected))
|
||||
{
|
||||
ShowChannel(selected);
|
||||
foreach (var c in this.channelToggles)
|
||||
{
|
||||
c.Value.isOn = false;
|
||||
}
|
||||
this.channelToggles[selected].isOn = true;
|
||||
AddMessageToSelectedChannel(WelcomeText);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Switch to the first newly created channel
|
||||
ShowChannel(channels[0]);
|
||||
}
|
||||
|
||||
private void InstantiateChannelButton(string channelName)
|
||||
{
|
||||
if (this.channelToggles.ContainsKey(channelName))
|
||||
{
|
||||
Debug.Log("Skipping creation for an existing channel toggle.");
|
||||
return;
|
||||
}
|
||||
|
||||
Toggle cbtn = (Toggle)GameObject.Instantiate(this.ChannelToggleToInstantiate);
|
||||
cbtn.gameObject.SetActive(true);
|
||||
cbtn.GetComponentInChildren<ChannelSelector>().SetChannel(channelName);
|
||||
cbtn.transform.SetParent(this.ChannelToggleToInstantiate.transform.parent, false);
|
||||
|
||||
this.channelToggles.Add(channelName, cbtn);
|
||||
}
|
||||
|
||||
private void InstantiateFriendButton(string friendId)
|
||||
{
|
||||
GameObject fbtn = (GameObject)GameObject.Instantiate(this.FriendListUiItemtoInstantiate);
|
||||
fbtn.gameObject.SetActive(true);
|
||||
FriendItem _friendItem = fbtn.GetComponent<FriendItem>();
|
||||
|
||||
_friendItem.FriendId = friendId;
|
||||
|
||||
fbtn.transform.SetParent(this.FriendListUiItemtoInstantiate.transform.parent, false);
|
||||
|
||||
this.friendListItemLUT[friendId] = _friendItem;
|
||||
}
|
||||
|
||||
private void DestroyFriendButton(string friendId)
|
||||
{
|
||||
if (this.friendListItemLUT.ContainsKey(friendId))
|
||||
{
|
||||
Destroy(this.friendListItemLUT[friendId].gameObject);
|
||||
this.friendListItemLUT.Remove(friendId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void OnUnsubscribed(string[] channels)
|
||||
{
|
||||
foreach (string channelName in channels)
|
||||
{
|
||||
if (this.channelToggles.ContainsKey(channelName))
|
||||
{
|
||||
Toggle t = this.channelToggles[channelName];
|
||||
Destroy(t.gameObject);
|
||||
|
||||
this.channelToggles.Remove(channelName);
|
||||
|
||||
Debug.Log("Unsubscribed from channel '" + channelName + "'.");
|
||||
|
||||
// Showing another channel if the active channel is the one we unsubscribed from before
|
||||
if (channelName == selectedChannelName && channelToggles.Count > 0)
|
||||
{
|
||||
IEnumerator<KeyValuePair<string, Toggle>> firstEntry = channelToggles.GetEnumerator();
|
||||
firstEntry.MoveNext();
|
||||
|
||||
ShowChannel(firstEntry.Current.Key);
|
||||
|
||||
firstEntry.Current.Value.isOn = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Can't unsubscribe from channel '" + channelName + "' because you are currently not subscribed to it.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnGetMessages(string channelName, string[] senders, object[] messages)
|
||||
{
|
||||
if (channelName.Equals(this.selectedChannelName))
|
||||
{
|
||||
// update text
|
||||
ShowChannel(this.selectedChannelName);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPrivateMessage(string sender, object message, string channelName)
|
||||
{
|
||||
// as the ChatClient is buffering the messages for you, this GUI doesn't need to do anything here
|
||||
// you also get messages that you sent yourself. in that case, the channelName is determinded by the target of your msg
|
||||
this.InstantiateChannelButton(channelName);
|
||||
|
||||
byte[] msgBytes = message as byte[];
|
||||
if (msgBytes != null)
|
||||
{
|
||||
Debug.Log("Message with byte[].Length: " + msgBytes.Length);
|
||||
}
|
||||
|
||||
if (this.selectedChannelName.Equals(channelName))
|
||||
{
|
||||
ShowChannel(channelName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// New status of another user (you get updates for users set in your friends list).
|
||||
/// </summary>
|
||||
/// <param name="user">Name of the user.</param>
|
||||
/// <param name="status">New status of that user.</param>
|
||||
/// <param name="gotMessage">True if the status contains a message you should cache locally. False: This status update does not include a
|
||||
/// message (keep any you have).</param>
|
||||
/// <param name="message">Message that user set.</param>
|
||||
public void OnStatusUpdate(string user, int status, bool gotMessage, object message)
|
||||
{
|
||||
|
||||
Debug.LogWarning("status: " + string.Format("{0} is {1}. Msg:{2}", user, status, message));
|
||||
|
||||
if (friendListItemLUT.ContainsKey(user))
|
||||
{
|
||||
FriendItem _friendItem = friendListItemLUT[user];
|
||||
if (_friendItem != null)
|
||||
_friendItem.OnFriendStatusUpdate(status, gotMessage, message);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnUserSubscribed(string channel, string user)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnUserUnsubscribed(string channel, string user)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnReceiveBroadcastMessage(string channel, byte[] message)
|
||||
{
|
||||
}
|
||||
|
||||
public void AddMessageToSelectedChannel(string msg, int msgId)
|
||||
{
|
||||
ChatChannel channel = null;
|
||||
bool found = this.chatClient.TryGetChannel(this.selectedChannelName, out channel);
|
||||
if (!found)
|
||||
{
|
||||
Debug.Log("AddMessageToSelectedChannel failed to find channel: " + this.selectedChannelName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (channel != null)
|
||||
{
|
||||
channel.Add("Bot", msg, msgId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ShowChannel(string channelName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(channelName))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ChatChannel channel = null;
|
||||
bool found = this.chatClient.TryGetChannel(channelName, out channel);
|
||||
if (!found)
|
||||
{
|
||||
Debug.Log("ShowChannel failed to find channel: " + channelName);
|
||||
return;
|
||||
}
|
||||
|
||||
this.selectedChannelName = channelName;
|
||||
this.CurrentChannelText.text = channel.ToStringMessages();
|
||||
Debug.Log("ShowChannel: " + this.selectedChannelName);
|
||||
|
||||
foreach (KeyValuePair<string, Toggle> pair in channelToggles)
|
||||
{
|
||||
pair.Value.isOn = pair.Key == channelName ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenDashboard()
|
||||
{
|
||||
Application.OpenURL("https://dashboard.photonengine.com");
|
||||
}
|
||||
|
||||
public void OpenChatDocs()
|
||||
{
|
||||
Application.OpenURL("https://doc.photonengine.com/chat");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8626678ad1db422409a1803edb7f6d72
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Code/ChatNewGui.cs
|
||||
uploadId: 817708
|
||||
@@ -0,0 +1,90 @@
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
|
||||
namespace Photon.Chat.DemoChat
|
||||
{
|
||||
/// <summary>
|
||||
/// Utility class to provide an instance with the Chat AppId to use by the demo. Can use PUN PhotonServerSettings or work as standalone.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the Instance getter for the different implementations (with and without PUN).
|
||||
/// </remarks>
|
||||
public class ChatSettings : ScriptableObject
|
||||
{
|
||||
[Tooltip("Your Chat AppId from Photon Dashboard")]
|
||||
public string AppId;
|
||||
|
||||
[HideInInspector]
|
||||
public bool WizardDone;
|
||||
|
||||
|
||||
// backing field for property
|
||||
private static ChatSettings instance;
|
||||
|
||||
// provides access to instance of ChatSettings. file gets created if not available
|
||||
public static ChatSettings Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
#if PUN_2_OR_NEWER
|
||||
if (instance == null)
|
||||
{
|
||||
instance = ScriptableObject.CreateInstance<ChatSettings>();
|
||||
}
|
||||
|
||||
instance.AppId = Photon.Pun.PhotonNetwork.PhotonServerSettings.AppSettings.AppIdChat;
|
||||
return instance;
|
||||
|
||||
#else
|
||||
|
||||
if (instance == null)
|
||||
{
|
||||
instance = Load();
|
||||
}
|
||||
|
||||
return instance;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// loads existing "ChatSettingsFile" of type ChatSettings from a Resources folder
|
||||
public static ChatSettings Load()
|
||||
{
|
||||
ChatSettings settings = (ChatSettings)Resources.Load("ChatSettingsFile", typeof(ChatSettings));
|
||||
if (settings != null)
|
||||
{
|
||||
return settings;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Create();
|
||||
}
|
||||
}
|
||||
|
||||
// creates an instance of ChatSettings and in Editor, stores it in a default path
|
||||
private static ChatSettings Create()
|
||||
{
|
||||
ChatSettings settings = (ChatSettings)ScriptableObject.CreateInstance("ChatSettings");
|
||||
#if UNITY_EDITOR
|
||||
if (!Directory.Exists("Assets/Resources"))
|
||||
{
|
||||
AssetDatabase.CreateFolder("Assets", "Resources");
|
||||
AssetDatabase.ImportAsset("Assets/Resources");
|
||||
}
|
||||
|
||||
AssetDatabase.CreateAsset(settings, "Assets/Resources/ChatSettingsFile.asset");
|
||||
EditorUtility.SetDirty(settings);
|
||||
|
||||
settings = (ChatSettings)Resources.Load("ChatSettingsFile", typeof(ChatSettings));
|
||||
#endif
|
||||
return settings;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8078fb5ca219c34ea80805fec36beae
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Code/ChatSettings.cs
|
||||
uploadId: 817708
|
||||
79
Assets/Photon/PhotonChat/Demos/Demo Chat/Code/FriendItem.cs
Normal file
79
Assets/Photon/PhotonChat/Demos/Demo Chat/Code/FriendItem.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
namespace Photon.Chat.DemoChat
|
||||
{
|
||||
/// <summary>
|
||||
/// Friend UI item used to represent the friend status as well as message.
|
||||
/// It aims at showing how to share health for a friend that plays on a different room than you for example.
|
||||
/// But of course the message can be anything and a lot more complex.
|
||||
/// </summary>
|
||||
public class FriendItem : MonoBehaviour
|
||||
{
|
||||
[HideInInspector]
|
||||
public string FriendId
|
||||
{
|
||||
set { NameLabel.text = value; }
|
||||
get { return NameLabel.text; }
|
||||
}
|
||||
|
||||
public Text NameLabel;
|
||||
public Text StatusLabel;
|
||||
public Text Health;
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
Health.text = string.Empty;
|
||||
}
|
||||
|
||||
public void OnFriendStatusUpdate(int status, bool gotMessage, object message)
|
||||
{
|
||||
string _status;
|
||||
|
||||
// status string for the remote-user status code to show in ui
|
||||
switch (status)
|
||||
{
|
||||
case 1:
|
||||
_status = "Invisible";
|
||||
break;
|
||||
case 2:
|
||||
_status = "Online";
|
||||
break;
|
||||
case 3:
|
||||
_status = "Away";
|
||||
break;
|
||||
case 4:
|
||||
_status = "Do not disturb";
|
||||
break;
|
||||
case 5:
|
||||
_status = "Looking For Game/Group";
|
||||
break;
|
||||
case 6:
|
||||
_status = "Playing";
|
||||
break;
|
||||
default:
|
||||
_status = "Offline";
|
||||
break;
|
||||
}
|
||||
|
||||
StatusLabel.text = _status;
|
||||
|
||||
|
||||
if (gotMessage)
|
||||
{
|
||||
string _health = string.Empty;
|
||||
if (message != null)
|
||||
{
|
||||
string[] _messages = message as string[];
|
||||
if (_messages != null && _messages.Length >= 2)
|
||||
{
|
||||
_health = (string)_messages[1] + "%";
|
||||
}
|
||||
}
|
||||
|
||||
Health.text = _health;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a3cc2bf2597946e3a355de2affc40b5
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Code/FriendItem.cs
|
||||
uploadId: 817708
|
||||
@@ -0,0 +1,61 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
namespace Photon.Chat.DemoChat
|
||||
{
|
||||
[RequireComponent(typeof(ChatNewGui))]
|
||||
public class NamePickNewGui : MonoBehaviour
|
||||
{
|
||||
private const string UserNamePlayerPref = "NamePickUserName";
|
||||
|
||||
public ChatNewGui chatNewComponent;
|
||||
|
||||
public InputField idInput;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
InitChatNewComponent();
|
||||
|
||||
string prefsName = PlayerPrefs.GetString(NamePickNewGui.UserNamePlayerPref);
|
||||
if (!string.IsNullOrEmpty(prefsName))
|
||||
{
|
||||
this.idInput.text = prefsName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// new UI will fire "EndEdit" event also when loosing focus. So check "enter" key and only then StartChat.
|
||||
public void EndEditOnEnter()
|
||||
{
|
||||
if (Input.GetKey(KeyCode.Return) || Input.GetKey(KeyCode.KeypadEnter))
|
||||
{
|
||||
this.StartChat();
|
||||
}
|
||||
}
|
||||
|
||||
public void StartChat()
|
||||
{
|
||||
if (!InitChatNewComponent())
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.chatNewComponent.UserName = this.idInput.text.Trim();
|
||||
this.chatNewComponent.Connect();
|
||||
this.enabled = false;
|
||||
|
||||
PlayerPrefs.SetString(NamePickNewGui.UserNamePlayerPref, this.chatNewComponent.UserName);
|
||||
}
|
||||
|
||||
public bool InitChatNewComponent()
|
||||
{
|
||||
#if UNITY_6000_0_OR_NEWER
|
||||
this.chatNewComponent = GameObject.FindFirstObjectByType<ChatNewGui>();
|
||||
#else
|
||||
this.chatNewComponent = FindObjectOfType<ChatNewGui>();
|
||||
#endif
|
||||
|
||||
return this.chatNewComponent != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5e77b98bc3c7be4d838fbfe21004ce3
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Code/NamePickNewGui.cs
|
||||
uploadId: 817708
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8195fd485f4b78e41a66d4ab2e62ff99
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace Photon.Chat.DemoChat.Utilities
|
||||
{
|
||||
/// <summary>
|
||||
/// This is used in the Editor Splash to properly inform the developer about the chat AppId requirement.
|
||||
/// </summary>
|
||||
[ExecuteInEditMode]
|
||||
public class ChatIdCheckerUI : MonoBehaviour
|
||||
{
|
||||
public GameObject VisibilityRoot; // must be set in inspector
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (this.VisibilityRoot != null)
|
||||
{
|
||||
this.VisibilityRoot.SetActive(string.IsNullOrEmpty(ChatSettings.Instance.AppId));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49f8b1206d1f448aca7d730f027d8c09
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Code/Utilities/ChatIdCheckerUI.cs
|
||||
uploadId: 817708
|
||||
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace Photon.Chat.DemoChat.Utilities
|
||||
{
|
||||
/// <summary>This component will destroy the Target GameObject (or the one it is attached to).</summary>
|
||||
public class DestroyOnStart : MonoBehaviour
|
||||
{
|
||||
[Tooltip("If null, this game object gets destroyed in this Start().")]
|
||||
public GameObject Target; // set in inspector
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (this.Target == null)
|
||||
{
|
||||
this.Target = this.gameObject;
|
||||
}
|
||||
|
||||
GameObject.Destroy(this.Target);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a2895d30d4d2c3f4cb5d2c92fcd9125f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Code/Utilities/DestroyOnStart.cs
|
||||
uploadId: 817708
|
||||
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace Photon.Chat.DemoChat.Utilities
|
||||
{
|
||||
/// <summary>This component will enable (setactive) the Target GameObject (or the one it is attached to).</summary>
|
||||
public class EnableOnStart : MonoBehaviour
|
||||
{
|
||||
[Tooltip("If null, this game object becomes active in this Start().")]
|
||||
public GameObject Target; // set in inspector
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (this.Target == null)
|
||||
{
|
||||
this.Target = this.gameObject;
|
||||
}
|
||||
|
||||
this.Target.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8555b4060b53841439f2c0c6f10db6ff
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Code/Utilities/EnableOnStart.cs
|
||||
uploadId: 817708
|
||||
@@ -0,0 +1,14 @@
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace Photon.Chat.DemoChat.Utilities
|
||||
{
|
||||
// small script to avoid clicks picking inactive UI elements
|
||||
public class IgnoreUiRaycastWhenInactive : MonoBehaviour, ICanvasRaycastFilter
|
||||
{
|
||||
public bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera)
|
||||
{
|
||||
return gameObject.activeInHierarchy;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ba4c747f6975ea46bcc0a55ffe3bfe8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Code/Utilities/IgnoreUiRaycastWhenInactive.cs
|
||||
uploadId: 817708
|
||||
@@ -0,0 +1,43 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="TextButtonTransition.cs" company="Exit Games GmbH">
|
||||
// </copyright>
|
||||
// <summary>
|
||||
// Use this on Button texts to have some color transition on the text as well without corrupting button's behaviour.
|
||||
// </summary>
|
||||
// <author>developer@exitgames.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Photon.Chat.DemoChat.Utilities
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Use this on Button texts to have some color transition on the text as well without corrupting button's behaviour.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Text))]
|
||||
public class TextButtonTransition : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler {
|
||||
|
||||
Text _text;
|
||||
|
||||
public Color NormalColor= Color.white;
|
||||
public Color HoverColor = Color.black;
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
_text = GetComponent<Text>();
|
||||
}
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
_text.color = HoverColor;
|
||||
}
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
_text.color = NormalColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a2169250a70845ffa2a9d25e9cd84cd
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Code/Utilities/TextButtonTransition.cs
|
||||
uploadId: 817708
|
||||
@@ -0,0 +1,64 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="TextToggleIsOnTransition.cs" company="Exit Games GmbH">
|
||||
// </copyright>
|
||||
// <summary>
|
||||
// Use this on Button texts to have some color transition on the text as well without corrupting button's behaviour.
|
||||
// </summary>
|
||||
// <author>developer@exitgames.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
namespace Photon.Chat.DemoChat.Utilities
|
||||
{
|
||||
/// <summary>
|
||||
/// Use this on toggles texts to have some color transition on the text depending on the isOnState.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Text))]
|
||||
public class TextToggleIsOnTransition : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
public Toggle toggle;
|
||||
|
||||
Text _text;
|
||||
|
||||
public Color NormalOnColor = Color.white;
|
||||
public Color NormalOffColor = Color.black;
|
||||
public Color HoverOnColor = Color.black;
|
||||
public Color HoverOffColor = Color.black;
|
||||
|
||||
bool isHover;
|
||||
|
||||
public void OnEnable()
|
||||
{
|
||||
_text = GetComponent<Text>();
|
||||
|
||||
toggle.onValueChanged.AddListener(OnValueChanged);
|
||||
}
|
||||
|
||||
public void OnDisable()
|
||||
{
|
||||
toggle.onValueChanged.RemoveListener(OnValueChanged);
|
||||
}
|
||||
|
||||
public void OnValueChanged(bool isOn)
|
||||
{
|
||||
_text.color = isOn ? (isHover ? HoverOnColor : HoverOffColor) : (isHover ? NormalOnColor : NormalOffColor);
|
||||
}
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
isHover = true;
|
||||
_text.color = toggle.isOn ? HoverOnColor : HoverOffColor;
|
||||
}
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
isHover = false;
|
||||
_text.color = toggle.isOn ? NormalOnColor : NormalOffColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f64fb930d3f24c5ebc31aa95dba1c0b
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Code/Utilities/TextToggleIsOnTransition.cs
|
||||
uploadId: 817708
|
||||
2
Assets/Photon/PhotonChat/Demos/Demo Chat/Resources.meta
Normal file
2
Assets/Photon/PhotonChat/Demos/Demo Chat/Resources.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb03069818b452447a87b341c634c9ef
|
||||
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d853fa7d5f479434e8c272b2dfa71983
|
||||
TrueTypeFontImporter:
|
||||
serializedVersion: 2
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 1
|
||||
characterPadding: 0
|
||||
includeFontData: 1
|
||||
use2xBehaviour: 0
|
||||
fontNames: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Resources/Jura-Medium.ttf
|
||||
uploadId: 817708
|
||||
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c50aca096225b41dfb0a1010884a72b9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3132b20ffdf43924da403021f95590ae
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Resources/OpenSans/Apache License.txt
|
||||
uploadId: 817708
|
||||
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c2d622bc4892ff441aee9289a6006707
|
||||
TrueTypeFontImporter:
|
||||
serializedVersion: 2
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 1
|
||||
characterPadding: 0
|
||||
includeFontData: 1
|
||||
use2xBehaviour: 0
|
||||
fontNames: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Resources/OpenSans/OpenSans-Bold.ttf
|
||||
uploadId: 817708
|
||||
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6aa145e5b99127428ecde3a5acbf68b
|
||||
TrueTypeFontImporter:
|
||||
serializedVersion: 2
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 1
|
||||
characterPadding: 0
|
||||
includeFontData: 1
|
||||
use2xBehaviour: 0
|
||||
fontNames: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Resources/OpenSans/OpenSans-Light.ttf
|
||||
uploadId: 817708
|
||||
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 439afd3f954cea94c8e910eef29cd81f
|
||||
TrueTypeFontImporter:
|
||||
serializedVersion: 2
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 1
|
||||
characterPadding: 0
|
||||
includeFontData: 1
|
||||
use2xBehaviour: 0
|
||||
fontNames: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Resources/OpenSans/OpenSans-Regular.ttf
|
||||
uploadId: 817708
|
||||
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23ccffaf915b101419d098a118141d9a
|
||||
TrueTypeFontImporter:
|
||||
serializedVersion: 2
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 1
|
||||
characterPadding: 0
|
||||
includeFontData: 1
|
||||
use2xBehaviour: 0
|
||||
fontNames: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Resources/OpenSans/OpenSans-Semibold.ttf
|
||||
uploadId: 817708
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,95 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32d648ef894184c88902b4e50fcba2c1
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: 16
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 2, y: 2, z: 2, w: 2}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 1024
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: e03d953f5d936b947bd9172007ab8835
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Resources/OutlinedSquaredBox.png
|
||||
uploadId: 817708
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 465 KiB |
@@ -0,0 +1,147 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f07e121dff858b46be11c81416b617b
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 0
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 0
|
||||
alphaUsage: 0
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Windows Store Apps
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Resources/chat-background.png
|
||||
uploadId: 817708
|
||||
BIN
Assets/Photon/PhotonChat/Demos/Demo Chat/Resources/chat-logo.png
Normal file
BIN
Assets/Photon/PhotonChat/Demos/Demo Chat/Resources/chat-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,147 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 354a413d966364de49f604d541f56c31
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 512
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 512
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Windows Store Apps
|
||||
maxTextureSize: 512
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 512
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 512
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 119922
|
||||
packageName: PUN 2 - FREE
|
||||
packageVersion: 2.52
|
||||
assetPath: Assets/Photon/PhotonChat/Demos/Demo Chat/Resources/chat-logo.png
|
||||
uploadId: 817708
|
||||
Reference in New Issue
Block a user