فهرست منبع

增加PlazaRomm功能

LiuQilin 8 سال پیش
والد
کامیت
61ef0b714a

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
Assets/Resource/Animations/人物动画/stand_ske.json


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
Assets/Resource/Animations/人物动画/stand_tex.json


BIN
Assets/Resource/Animations/人物动画/stand_texture.png


+ 42 - 0
Assets/Resource/Prefab/Object/PlazaRoom.prefab

@@ -27,6 +27,22 @@ GameObject:
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
   m_IsActive: 1
+--- !u!1 &1115051532171458
+GameObject:
+  m_ObjectHideFlags: 0
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  serializedVersion: 5
+  m_Component:
+  - component: {fileID: 4421693630246596}
+  - component: {fileID: 65286698438109658}
+  m_Layer: 0
+  m_Name: Collider
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
 --- !u!1 &1306314131659996
 GameObject:
   m_ObjectHideFlags: 0
@@ -118,6 +134,19 @@ Transform:
   m_Father: {fileID: 4518027564363394}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!4 &4421693630246596
+Transform:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1115051532171458}
+  m_LocalRotation: {x: 0.1996245, y: 0, z: 0, w: 0.97987247}
+  m_LocalPosition: {x: 0, y: -1.7, z: -4.64}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 4518027564363394}
+  m_RootOrder: 5
+  m_LocalEulerAnglesHint: {x: 23.03, y: 0, z: 0}
 --- !u!4 &4436083492004806
 Transform:
   m_ObjectHideFlags: 1
@@ -172,6 +201,7 @@ Transform:
   - {fileID: 4465118849283348}
   - {fileID: 4493473737233732}
   - {fileID: 4800422243721380}
+  - {fileID: 4421693630246596}
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -188,6 +218,18 @@ Transform:
   m_Father: {fileID: 4518027564363394}
   m_RootOrder: 4
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!65 &65286698438109658
+BoxCollider:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1115051532171458}
+  m_Material: {fileID: 0}
+  m_IsTrigger: 0
+  m_Enabled: 1
+  serializedVersion: 2
+  m_Size: {x: 27, y: 2.8027709, z: 0.1}
+  m_Center: {x: 0, y: -0.09860494, z: -0.00000115484}
 --- !u!212 &212016355275133796
 SpriteRenderer:
   m_ObjectHideFlags: 1

+ 15 - 0
Assets/Resource/Prefab/PrefabUI/MainCamera.prefab

@@ -24,6 +24,7 @@ GameObject:
   - component: {fileID: 124303997679295990}
   - component: {fileID: 81742010955080160}
   - component: {fileID: 114707783965843618}
+  - component: {fileID: 114581702705820628}
   m_Layer: 0
   m_Name: MainCamera
   m_TagString: MainCamera
@@ -92,6 +93,20 @@ Behaviour:
   m_PrefabInternal: {fileID: 100100000}
   m_GameObject: {fileID: 1424904125323438}
   m_Enabled: 1
+--- !u!114 &114581702705820628
+MonoBehaviour:
+  m_ObjectHideFlags: 1
+  m_PrefabParentObject: {fileID: 0}
+  m_PrefabInternal: {fileID: 100100000}
+  m_GameObject: {fileID: 1424904125323438}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: -768656878, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_EventMask:
+    serializedVersion: 2
+    m_Bits: 4294967295
 --- !u!114 &114707783965843618
 MonoBehaviour:
   m_ObjectHideFlags: 1

+ 2 - 0
Assets/Script/Manage/Initializer.cs

@@ -184,6 +184,8 @@ public class Initializer : MonoBehaviour
 
         ManaCenter.LoginCallbackInitial(new JsonData());
 
+        GardenSmartFoxManager.GardenSmartFox.PlazaRoomManager.SyncClose();
+
         StringFilter.Init();
 
         GameObject.Find("I_Lab").GetComponent<Text>().text = "Error code : 8";

+ 0 - 2
Assets/Script/Manage/ManaCenter.cs

@@ -1006,8 +1006,6 @@ public class ManaCenter : Regist
             return;
         }
 
-        GardenSmartFoxManager.GardenSmartFox.PlazaRoomManager.SyncClose();
-
         ManaServer.PackTypeRequest();
 
         if (ManaServer.Connect)

+ 81 - 0
Assets/Script/Object/Player.cs

@@ -562,6 +562,65 @@ public class Player : Regist , IPointerClickHandler
                 JumpTimer = 0;
             }
         }
+
+        //if (GardenSmartFoxManager.GardenSmartFox.PlazaRoomManager.InPlazaRoom)
+        //{
+        //    MoveThread();
+        //}
+    }
+
+    //public bool IsMoving = false;
+    //public float MoveSpeed = 1;
+    //public float Accuracy = 0.1f;
+    //public Vector3 Destination;
+    public void MoveThread()
+    {
+        //if (!IsMoving)
+        //    return;
+
+        //transform.position = Vector3.Lerp(transform.position, Destination, Time.deltaTime);
+
+        //if (Vector3.Magnitude(Destination - transform.position) < Accuracy)
+        //{
+        //    StopMove();
+        //}
+    }
+
+    public float Speed = 1;
+    public void MoveTo(Vector3 destination)
+    {
+        if (destination.Equal(transform.position))
+        {
+            return;
+        }
+
+        if (destination.x > transform.position.x)
+        {
+            Flip(PlayerDirection.Right);
+        }
+        else
+        {
+            Flip(PlayerDirection.Left);
+        }
+
+        float duration = Mathf.Clamp(Vector3.Magnitude(destination - transform.position)/1.5f, 0.25f, 10f)/Speed;
+
+        TweenRoot tweenRoot = transform.CreateTweenVec3D(destination, duration, false, true, true, Curve.EaseOutQuad);
+
+        tweenRoot.StartForward();
+        tweenRoot.AddEventOnetime(EventType.ForwardFinish, StopMove);
+
+        //IsMoving = true;
+        //Destination = destination;
+
+        PlayAnim("newAnimation2");
+    }
+
+    public void StopMove()
+    {
+        //IsMoving = false;
+
+        PlayAnim("newAnimation");
     }
 
 
@@ -885,6 +944,26 @@ public class Player : Regist , IPointerClickHandler
 
     #region 换装
 
+    public void CorrectPivot()
+    {
+        List<Transform> children = new List<Transform>();
+
+        while (transform.childCount > 0)
+        {
+            children.Add(transform.GetChild(0));
+
+            children.Back(0).parent = null;
+        }
+
+        ManaReso.Get("PlayerPosTra").position -= UAC.transform.FindChild("Pivot").position - transform.position;
+        transform.position += UAC.transform.FindChild("Pivot").position - transform.position;
+
+        for (int i = 0; i < children.Count; i++)
+        {
+            children[i].parent = transform;
+        }
+    }
+
     public UnityArmatureComponent Build()
     {
         if (!ManaPlayer.Complete)
@@ -945,6 +1024,8 @@ public class Player : Regist , IPointerClickHandler
         ChangeClose(BodyPart.Mouse, "嘴巴1", false);
         ChangeClose(BodyPart.Headwear, "头饰品1", false);
 
+        CorrectPivot();
+
         return UAC;
     }
 

+ 12 - 0
Assets/Script/Object/PlazaRoom.cs

@@ -0,0 +1,12 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.EventSystems;
+
+public class PlazaRoom : MonoBehaviour, IPointerClickHandler
+{
+    public void OnPointerClick(PointerEventData eventData)
+    {
+        GardenSmartFoxManager.GardenSmartFox.PlazaRoomManager.SelfInstance.MoveTo(eventData.pointerCurrentRaycast.worldPosition);
+    }
+}

+ 12 - 0
Assets/Script/Object/PlazaRoom.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 3a72684d43d2fe641a85f4a1f33ad77e
+timeCreated: 1505721024
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 0
Assets/Script/SFS/Manager/GardenSmartFoxManager.cs

@@ -100,6 +100,7 @@ public class GardenSmartFoxManager : Regist
     {
         PlazaRoom = ManaReso.Get("PlazaRoom", Folder.Discard, true, null, true);
         PlazaRoom.SetActive(false);
+        PlazaRoom.AddComponent<PlazaRoom>();
     }
 
 

+ 3 - 0
Assets/Script/SFS/Manager/Loggor.cs

@@ -4,6 +4,7 @@ using UnityEngine;
 
 using Sfs2X.Entities;
 using Sfs2X.Requests;
+using Random = UnityEngine.Random;
 
 [Serializable]
 public class Loggor : BaseLoggor
@@ -20,6 +21,8 @@ public class Loggor : BaseLoggor
     {
         Debug.Log("Send login request");
 
+        UserName = Random.Range(0f, 100f).ToString("0.0000000");
+
         GardenSmartFox.SmartFox.Send(new LoginRequest(UserName, Password));
     }
 

+ 33 - 25
Assets/Script/Tool/Auxiliary.cs

@@ -158,6 +158,8 @@ public class Auxiliary : Regist
 
         if (Input.GetKeyDown(KeyCode.X))
         {
+            ManaPlayer.Player.PlayAnim("newAnimation2");
+
             //StartCoroutine(ManaServer.DownloadAllAsset(new List<string>() { "http://or5zgoeui.bkt.clouddn.com/game_icon.png", "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3853411417,2245648913&fm=26&gp=0.jpg" }, ManaServer.DownloadAllTexture));
 
             //ManaMiniGame.GameTimer = 45;
@@ -175,6 +177,8 @@ public class Auxiliary : Regist
 
         if (Input.GetKeyDown(KeyCode.C))
         {
+            ManaPlayer.Player.PlayAnim("newAnimation3");
+
             //ManaReso.Get("C_Notify").TweenForCG();
 
             //ManaMiniGame.Score += 400;
@@ -189,43 +193,47 @@ public class Auxiliary : Regist
         //    Debug.Log(ManaGarden.Slot);
         //}
 
-        if (Input.GetKeyDown(KeyCode.N))
+        if (Input.GetKeyDown(KeyCode.V))
         {
-            //ManaCenter.Coin = 0;
-            //ManaCenter.Diamond = 0;
+            ManaPlayer.Player.Flip(PlayerDirection.Right);
 
-            foreach (var VARIABLE in ManaGarden.FlowerInfoDic)
-            {
-                VARIABLE.Value.Unlock = true;
-            }
+            //ManaServer.MailReward mailReward = new ManaServer.MailReward("1", "pack", "4");
+            //ManaServer.MailReward mailReward1 = new ManaServer.MailReward("1", "close", "2");
+
+            //ManaServer.GetMainReward(mailReward);
+            //ManaServer.GetMainReward(mailReward1);
+
+            //ManaGarden.ElfTimer = 0;
+
+            //ManaServer.Time = new DateTime(2007, 1, 1);
+        }
+
+        if (Input.GetKeyDown(KeyCode.B))
+        {
+            ManaPlayer.Player.Flip(PlayerDirection.Left);
 
-            //foreach (var VARIABLE in ManaGarden.FlowerInfoDic)
+            //foreach (var VARIABLE in ManaPlayer.CloseUnitDic)
             //{
-            //    VARIABLE.Value.Unlock = false;
+            //    VARIABLE.Value.Unlock();
             //}
-
-            //ManaGarden.FlowerInfoDic.First().Value.Unlock = true;
         }
 
-        //if (Input.GetKeyDown(KeyCode.B))
+        //if (Input.GetKeyDown(KeyCode.N))
         //{
-        //    foreach (var VARIABLE in ManaPlayer.CloseUnitDic)
+        //    ManaCenter.Coin = 0;
+        //    ManaCenter.Diamond = 0;
+
+        //    foreach (var VARIABLE in ManaGarden.FlowerInfoDic)
         //    {
-        //        VARIABLE.Value.Unlock();
+        //        VARIABLE.Value.Unlock = true;
         //    }
-        //}
 
-        //if (Input.GetKeyDown(KeyCode.V))
-        //{
-        //    ManaServer.MailReward mailReward = new ManaServer.MailReward("1", "pack", "4");
-        //    ManaServer.MailReward mailReward1 = new ManaServer.MailReward("1", "close", "2");
-
-        //    ManaServer.GetMainReward(mailReward);
-        //    ManaServer.GetMainReward(mailReward1);
-
-        //    ManaGarden.ElfTimer = 0;
+        //    foreach (var VARIABLE in ManaGarden.FlowerInfoDic)
+        //    {
+        //        VARIABLE.Value.Unlock = false;
+        //    }
 
-        //    ManaServer.Time = new DateTime(2007, 1, 1);
+        //    ManaGarden.FlowerInfoDic.First().Value.Unlock = true;
         //}
 
         //if (Input.GetKeyDown(KeyCode.P))

+ 1 - 1
ProjectSettings/ProjectSettings.asset

@@ -68,7 +68,7 @@ PlayerSettings:
   disableDepthAndStencilBuffers: 0
   defaultIsFullScreen: 1
   defaultIsNativeResolution: 1
-  runInBackground: 0
+  runInBackground: 1
   captureSingleScreen: 0
   muteOtherAudioSources: 0
   Prepare IOS For Recording: 0

+ 9 - 0
ToDoList.txt

@@ -1,6 +1,15 @@
+摄像机控制
+
+退出房间时不需要再移动
+
+动画过渡
+
+
 开一次游戏音乐Bgm都会自动开起来
 
 
+使用的随机用户名
+
 访问点赞延迟的情况
 
 在别人花园点击访问时红色桃心马上被刷白了

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است