[03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC]

Added Change init PortaitInitIndex feature.
master
LH 6 years ago
parent 5de3dc70e6
commit 0cea62327f
  1. 61
      03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait.unity
  2. 38
      03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait/Script/PortraitManager.cs
  3. 1
      03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Packages/manifest.json

@ -1168,6 +1168,63 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 680606863} m_GameObject: {fileID: 680606863}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 0
--- !u!1001 &758593924
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1056807493977812, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_Name
value: ConfigurationServer
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6143453941a05b54582f835773a10d58, type: 3}
--- !u!1 &779577949 --- !u!1 &779577949
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2431,7 +2488,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d8813dde4fb2c304bbcde08119f57d54, type: 3} m_Script: {fileID: 11500000, guid: d8813dde4fb2c304bbcde08119f57d54, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
show_cur: PortaitInitIndex: 0
camera: {fileID: 961139954} camera: {fileID: 961139954}
server: {fileID: 977824800} server: {fileID: 977824800}
mode: 0 mode: 0
@ -5099,7 +5156,7 @@ Transform:
- {fileID: 2135091040} - {fileID: 2135091040}
- {fileID: 274290747} - {fileID: 274290747}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 7 m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1953387457 --- !u!1 &1953387457
GameObject: GameObject:

@ -9,11 +9,16 @@ namespace UltraCombos.Frozen
public class PortraitManager : MonoBehaviour public class PortraitManager : MonoBehaviour
{ {
Dictionary<string, Portrait> portraits; Dictionary<string, Portrait> portraits;
public string show_cur;
[Configuration.Config]
[Range(0, 15)]
public int PortaitInitIndex = 0;
string PortraitKeyCur = "";
public Camera camera; public Camera camera;
public RoyalGallery.RorayGalleryGrpcServer server; public RoyalGallery.RorayGalleryGrpcServer server;
string show_nxt = null; string portraitKeyNxt = null;
[SerializeField, Header("Debug")] [SerializeField, Header("Debug")]
bool mode = false; bool mode = false;
@ -27,6 +32,8 @@ namespace UltraCombos.Frozen
private void Start() private void Start()
{ {
portraits = new Dictionary<string, Portrait>(); portraits = new Dictionary<string, Portrait>();
int i = 0;
foreach (var p in GetComponentsInChildren<Portrait>()) foreach (var p in GetComponentsInChildren<Portrait>())
{ {
if (!p.isActiveAndEnabled) if (!p.isActiveAndEnabled)
@ -35,7 +42,12 @@ namespace UltraCombos.Frozen
} }
portraits.Add(p.id, p); portraits.Add(p.id, p);
// p.isVisible = false; if (i == PortaitInitIndex)
{
PortraitKeyCur = p.id;
}
++i;
} }
if (portraits.Count == 0) if (portraits.Count == 0)
@ -43,14 +55,14 @@ namespace UltraCombos.Frozen
return; return;
} }
if (!portraits.ContainsKey(show_cur)) if (!portraits.ContainsKey(PortraitKeyCur))
{ {
show_cur = ""; PortraitKeyCur = "";
show_nxt = portraits.Keys.GetEnumerator().Current; portraitKeyNxt = portraits.Keys.GetEnumerator().Current;
} }
else else
{ {
show_nxt = show_cur; portraitKeyNxt = PortraitKeyCur;
} }
if (server) if (server)
@ -66,18 +78,18 @@ namespace UltraCombos.Frozen
return; return;
} }
if (show_nxt != null) if (portraitKeyNxt != null)
{ {
if (portraits.ContainsKey(show_cur)) if (portraits.ContainsKey(PortraitKeyCur))
{ {
//portraits[show_cur].isVisible = false; //portraits[show_cur].isVisible = false;
} }
show_cur = show_nxt; PortraitKeyCur = portraitKeyNxt;
show_nxt = null; portraitKeyNxt = null;
Transform tf = camera.GetComponent<Transform>(); Transform tf = camera.GetComponent<Transform>();
Vector2 tar = portraits[show_cur].Positon; Vector2 tar = portraits[PortraitKeyCur].Positon;
camera.GetComponent<Transform>().localPosition = new Vector3(tar.x, tar.y, tf.localPosition.z); camera.GetComponent<Transform>().localPosition = new Vector3(tar.x, tar.y, tf.localPosition.z);
//portraits[show_cur].isVisible = true; //portraits[show_cur].isVisible = true;
@ -107,7 +119,7 @@ namespace UltraCombos.Frozen
painting.UpdateTexture(texture); painting.UpdateTexture(texture);
onPaintingUpdated.Invoke(painting.transform.position); onPaintingUpdated.Invoke(painting.transform.position);
show_nxt = id; portraitKeyNxt = id;
} }
} }

@ -1,5 +1,6 @@
{ {
"dependencies": { "dependencies": {
"com.ultracombos.configuration": "file:<project>/../../../../../_Package/com.ultracombos.configuration",
"com.ultracombos.grpc": "file:<project>/../../../../../_Package/com.ultracombos.grpc", "com.ultracombos.grpc": "file:<project>/../../../../../_Package/com.ultracombos.grpc",
"com.ultracombos.minions-girlsroom-asset": "file:<project>/../../../../../_Package/com.ultracombos.minions-girlsroom-asset", "com.ultracombos.minions-girlsroom-asset": "file:<project>/../../../../../_Package/com.ultracombos.minions-girlsroom-asset",
"com.ultracombos.movie-player": "file:<project>/../../../../../_Package/com.ultracombos.movie-player", "com.ultracombos.movie-player": "file:<project>/../../../../../_Package/com.ultracombos.movie-player",

Loading…
Cancel
Save