Commit 2a45c62b authored by Unicorn369's avatar Unicorn369

输入QQ换头像

parent af71becb
......@@ -792,7 +792,7 @@ public static class UIHelper
{
if (fileInfos[i].Name.Length > 4)
{
if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".png")
if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".png" || fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".jpg")
{
string name = fileInfos[i].Name.Substring(0, fileInfos[i].Name.Length - 4);
if (!faces.ContainsKey(name))
......
......@@ -54,6 +54,10 @@ public class HttpDldFile
}
catch (Exception)
{
if (File.Exists(filename + ".tmp"))
{
File.Delete(filename + ".tmp");
}
flag = false;
}
return flag;
......
using UnityEngine;
using System;
using System.Collections.Generic;
using System.IO;
using YGOSharp.OCGWrapper.Enums;
public class Servant
......@@ -391,8 +392,12 @@ public class Servant
public string currentMShash;
public string nameFace;
private GameObject currentMSwindow = null;
private GameObject currentMSwindow_Face = null;
public class messageSystemValue
{
public string value = "";
......@@ -779,10 +784,32 @@ public class Servant
true,
new Vector3(((float)Screen.height) / 700f, ((float)Screen.height) / 700f, ((float)Screen.height) / 700f)
);
nameFace = name;
currentMSwindow_Face = currentMSwindow;
UIHelper.InterGameObject(currentMSwindow);
UIHelper.getByName<UITexture>(currentMSwindow, "face_").mainTexture = UIHelper.getFace(name);
UIHelper.registEvent(currentMSwindow, "yes_", ES_RMSpremono, new messageSystemValue());
UIHelper.registEvent(currentMSwindow, "exit_", ES_RMSpremono, new messageSystemValue());
UIHelper.registEvent(currentMSwindow, "yes_", DownloadFace);
}
public void DownloadFace()
{
//获取QQ号
UIInput inputHttp = UIHelper.getByName<UIInput>(currentMSwindow_Face, "input_");
//如果使用自定义url,而不是QQ头像,请修改url,改为:string url = inputHttp.value;
string url = "http://q1.qlogo.cn/headimg_dl?dst_uin=" + inputHttp.value + "&spec=100";
string face = "texture/face/" + nameFace + ".jpg";
//开始下载
HttpDldFile df = new HttpDldFile();
df.Download(url, face);
//刷新头像
if (File.Exists(face))
{
Texture2D Face = UIHelper.getTexture2D(face);
UIHelper.faces.Remove(nameFace);//防止bug,先删除再添加
UIHelper.faces.Add(nameFace, Face);
UIHelper.getByName<UITexture>(currentMSwindow_Face, "face_").mainTexture = Face;
}
}
#endregion
}
......@@ -141,12 +141,12 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 169062}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3, y: 45, z: 0}
m_LocalPosition: {x: 0, y: 75, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 433660}
m_Father: {fileID: 455166}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &414702
Transform:
......@@ -155,7 +155,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 182122}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 3, y: -25, z: 0}
m_LocalPosition: {x: 0, y: -60, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 455166}
......@@ -207,7 +207,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 195852}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -277, y: -23, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 424418}
......@@ -222,7 +222,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 186888}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3, y: -87, z: 0}
m_LocalPosition: {x: 0, y: -105, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 455166}
......@@ -241,7 +241,9 @@ Transform:
- {fileID: 414702}
- {fileID: 425056}
- {fileID: 449418}
- {fileID: 4915580299265642}
- {fileID: 401280}
- {fileID: 4473934484648920}
m_Father: {fileID: 436514}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -255,7 +257,7 @@ BoxCollider:
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 525, y: 330, z: 0}
m_Size: {x: 525, y: 360, z: 0}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &6577206
BoxCollider:
......@@ -335,12 +337,12 @@ MonoBehaviour:
mColor: {r: 1, g: 1, b: 1, a: 1}
mPivot: 4
mWidth: 477
mHeight: 282
mHeight: 312
mDepth: -100
autoResizeBoxCollider: 0
hideIfOffScreen: 0
keepAspectRatio: 0
aspectRatio: 1.6914893
aspectRatio: 1.5288461
mType: 0
mFillDirection: 4
mFillAmount: 1
......@@ -403,7 +405,7 @@ MonoBehaviour:
keepCrispWhenShrunk: 1
mTrueTypeFont: {fileID: 12800000, guid: f775853fdfd14bb47934543e95c3bae3, type: 3}
mFont: {fileID: 0}
mText: "\u786E\u8BA4"
mText: "\u5237\u65B0\u5934\u50CF"
mFontSize: 27
mFontStyle: 0
mAlignment: 2
......@@ -510,12 +512,12 @@ MonoBehaviour:
mColor: {r: 0, g: 0, b: 0, a: 0.8627451}
mPivot: 4
mWidth: 525
mHeight: 330
mHeight: 360
mDepth: 0
autoResizeBoxCollider: 1
hideIfOffScreen: 0
keepAspectRatio: 0
aspectRatio: 1.5909091
aspectRatio: 1.4583334
mType: 1
mFillDirection: 4
mFillAmount: 1
......@@ -733,7 +735,7 @@ MonoBehaviour:
anchorOffset: 0
softBorderPadding: 1
renderQueue: 0
startingRenderQueue: 3003
startingRenderQueue: 3004
mClipTexture: {fileID: 2800000, guid: b1f30c8a0354cd94dade78759be28008, type: 3}
mAlpha: 1
mClipping: 1
......@@ -753,3 +755,382 @@ Prefab:
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 195852}
m_IsPrefabParent: 1
--- !u!1 &1642922839665042
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4915580299265642}
- component: {fileID: 65634783695434124}
- component: {fileID: 114358291720897726}
- component: {fileID: 111051051454467058}
- component: {fileID: 114922062941107210}
- component: {fileID: 114504665694144644}
m_Layer: 5
m_Name: exit_
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1659176517360734
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4473934484648920}
- component: {fileID: 114190629566592836}
- component: {fileID: 65021167359904882}
- component: {fileID: 114071124676308600}
m_Layer: 5
m_Name: input_
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1720769508036278
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4895653614194050}
- component: {fileID: 114632771777790222}
m_Layer: 5
m_Name: Label
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4473934484648920
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1659176517360734}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -15, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4895653614194050}
m_Father: {fileID: 455166}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4895653614194050
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1720769508036278}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -140, y: 12, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4473934484648920}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4915580299265642
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1642922839665042}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 220, y: 143, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 455166}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &65021167359904882
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1659176517360734}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 280, y: 40, z: 0}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &65634783695434124
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1642922839665042}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 30, y: 30, z: 0}
m_Center: {x: 0, y: 0, z: 0}
--- !u!111 &111051051454467058
Animation:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1642922839665042}
m_Enabled: 0
serializedVersion: 3
m_Animation: {fileID: 7400000, guid: e8c465e83c3e18040884ef096f01647b, type: 2}
m_Animations:
- {fileID: 7400000, guid: e8c465e83c3e18040884ef096f01647b, type: 2}
m_WrapMode: 0
m_PlayAutomatically: 1
m_AnimatePhysics: 0
m_CullingType: 0
--- !u!114 &114071124676308600
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1659176517360734}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1b3dc54f924693f41b5cbecb267e647a, type: 3}
m_Name:
m_EditorClassIdentifier:
leftAnchor:
target: {fileID: 0}
relative: 0
absolute: 60
rightAnchor:
target: {fileID: 0}
relative: 1
absolute: -60
bottomAnchor:
target: {fileID: 0}
relative: 0
absolute: -178
topAnchor:
target: {fileID: 0}
relative: 1
absolute: -126
updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 1}
mPivot: 4
mWidth: 280
mHeight: 40
mDepth: 30
autoResizeBoxCollider: 1
hideIfOffScreen: 0
keepAspectRatio: 0
aspectRatio: 7
mType: 1
mFillDirection: 4
mFillAmount: 1
mInvert: 0
mFlip: 0
centerType: 1
leftType: 1
rightType: 1
bottomType: 1
topType: 1
mAtlas: {fileID: 11422656, guid: 1b5c469d95cc74b4e9f655da6f9dd392, type: 2}
mSpriteName: line
mFillCenter: 1
--- !u!114 &114190629566592836
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1659176517360734}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ac5060295fbd39b4a88d20d0c83d925e, type: 3}
m_Name:
m_EditorClassIdentifier:
label: {fileID: 114632771777790222}
inputType: 0
onReturnKey: 0
keyboardType: 0
hideInput: 0
validation: 1
characterLimit: 0
savedAs:
selectOnTab: {fileID: 0}
activeTextColor: {r: 1, g: 1, b: 1, a: 1}
caretColor: {r: 1, g: 1, b: 1, a: 0.8}
selectionColor: {r: 0.20588237, g: 0.40851915, b: 1, a: 0.5}
onSubmit:
- mTarget: {fileID: 114190629566592836}
mMethodName: RemoveFocus
mParameters: []
oneShot: 0
onChange: []
mValue:
--- !u!114 &114358291720897726
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1642922839665042}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1fdca5042b1d12a4890ec1bd4f04290d, type: 3}
m_Name:
m_EditorClassIdentifier:
tweenTarget: {fileID: 1642922839665042}
hover: {r: 1, g: 1, b: 1, a: 1}
pressed: {r: 1, g: 1, b: 1, a: 1}
disabledColor: {r: 1, g: 1, b: 1, a: 1}
duration: 0.2
dragHighlight: 0
hoverSprite:
pressedSprite:
disabledSprite:
hoverSprite2D: {fileID: 0}
pressedSprite2D: {fileID: 0}
disabledSprite2D: {fileID: 0}
pixelSnap: 0
onClick: []
mTextureOutNormal:
mTextureOutPressed:
--- !u!114 &114504665694144644
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1642922839665042}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1b3dc54f924693f41b5cbecb267e647a, type: 3}
m_Name:
m_EditorClassIdentifier:
leftAnchor:
target: {fileID: 0}
relative: 1
absolute: -44
rightAnchor:
target: {fileID: 0}
relative: 1
absolute: -14
bottomAnchor:
target: {fileID: 0}
relative: 1
absolute: -52
topAnchor:
target: {fileID: 0}
relative: 1
absolute: -22
updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 1}
mPivot: 4
mWidth: 30
mHeight: 30
mDepth: 1
autoResizeBoxCollider: 1
hideIfOffScreen: 0
keepAspectRatio: 0
aspectRatio: 1
mType: 0
mFillDirection: 4
mFillAmount: 1
mInvert: 0
mFlip: 0
centerType: 1
leftType: 1
rightType: 1
bottomType: 1
topType: 1
mAtlas: {fileID: 11422656, guid: 1b5c469d95cc74b4e9f655da6f9dd392, type: 2}
mSpriteName: close
mFillCenter: 1
--- !u!114 &114632771777790222
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1720769508036278}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e9d0b5f3bbe925a408bd595c79d0bf63, type: 3}
m_Name:
m_EditorClassIdentifier:
leftAnchor:
target: {fileID: 4473934484648920}
relative: 0
absolute: 0
rightAnchor:
target: {fileID: 4473934484648920}
relative: 1
absolute: 0
bottomAnchor:
target: {fileID: 4473934484648920}
relative: 0
absolute: 0
topAnchor:
target: {fileID: 4473934484648920}
relative: 1
absolute: -8
updateAnchors: 1
mColor: {r: 1, g: 1, b: 1, a: 0.40392157}
mPivot: 0
mWidth: 280
mHeight: 32
mDepth: 21
autoResizeBoxCollider: 0
hideIfOffScreen: 0
keepAspectRatio: 0
aspectRatio: 8.75
keepCrispWhenShrunk: 1
mTrueTypeFont: {fileID: 12800000, guid: f775853fdfd14bb47934543e95c3bae3, type: 3}
mFont: {fileID: 0}
mText: "\u5728\u6B64\u8F93\u5165QQ\u53F7"
mFontSize: 27
mFontStyle: 0
mAlignment: 2
mEncoding: 0
mMaxLineCount: 1
mEffectStyle: 0
mEffectColor: {r: 0, g: 0, b: 0, a: 1}
mSymbols: 1
mEffectDistance: {x: 1, y: 1}
mOverflow: 1
mMaterial: {fileID: 0}
mApplyGradient: 1
mGradientTop: {r: 1, g: 1, b: 1, a: 1}
mGradientBottom: {r: 0.7, g: 0.7, b: 0.7, a: 1}
mSpacingX: 0
mSpacingY: 0
mUseFloatSpacing: 0
mFloatSpacingX: 0
mFloatSpacingY: 0
mOverflowEllipsis: 0
mShrinkToFit: 0
mMaxLineWidth: 0
mMaxLineHeight: 0
mLineWidth: 0
mMultiline: 1
--- !u!114 &114922062941107210
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1642922839665042}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3f093ad5830afe44aba6efa8b8a5d5b9, type: 3}
m_Name:
m_EditorClassIdentifier:
target: {fileID: 111051051454467058}
animator: {fileID: 0}
clipName:
trigger: 1
playDirection: 1
resetOnPlay: 0
clearSelection: 0
ifDisabledOnPlay: 0
disableWhenFinished: 0
onFinished: []
eventReceiver: {fileID: 0}
callWhenFinished:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment