Commit 58119954 authored by wanqing's avatar wanqing

修改流体逻辑

parent 3e12e14b
......@@ -20,6 +20,9 @@ public class FruitItemView : MonoBehaviour
private Color m_strawberryColor = new Color(1.0f, 57.0f / 255.0f, 30.0f / 255.0f, 160.0f / 255.0f);
private Color m_lemonColor = new Color(1.0f, 220.0f / 255.0f, 0.0f, 160.0f / 255.0f);
private Color m_orangeColor = new Color(1.0f, 151.0f / 255.0f, 22.0f / 255.0f, 160.0f / 255.0f);
private Vector3 m_liquidStartPos;
private Quaternion m_liquidStartQua;
private Vector3 m_liquidStartScale;
private void Awake()
{
m_size = transform.localScale;
......@@ -35,6 +38,9 @@ public class FruitItemView : MonoBehaviour
if (m_container)
{
m_liquidContainer = m_container.gameObject.GetComponent<LiquidContainer>();
m_liquidStartPos = m_container.transform.localPosition;
m_liquidStartQua = m_container.transform.localRotation;
m_liquidStartScale = m_container.transform.localScale;
}
}
//变大动画
......@@ -50,8 +56,16 @@ public class FruitItemView : MonoBehaviour
//生成流体特效
public void SetLiquidEffect()
{
//m_container.transform.SetParent(transform);
m_container.gameObject.SetActive(false);
Transform varObj = m_container.transform.Find("LiquidParticles(Clone)");
if(varObj)
{
Destroy(varObj.gameObject);
}
m_container.enabled = true;
if(m_liquidContainer)
m_liquidContainer.FillAmountPercent = 1.0f;
if (m_liquidContainer)
{
if(m_type == FruitType.Strawberry)
{
......@@ -66,6 +80,14 @@ public class FruitItemView : MonoBehaviour
m_liquidContainer.LiquidColor = m_orangeColor;
}
}
m_container.transform.SetParent(null);
Vector3 varVec = transform.position;
varVec.z = 0;
varVec.y += 1.0f;
m_container.transform.localPosition = varVec;
m_container.transform.localRotation = m_liquidStartQua;
m_container.transform.localScale = Vector3.one * 2;
m_container.gameObject.SetActive(true);
Invoke("DelayStopLiquidEffect", 0.5f);
}
//延迟停止流体特效
......
......@@ -314,7 +314,7 @@ public class FruitView : MonoBehaviour
//流体控制
//ShowLiquidEffect(varStrawberryLeftNum, varLemonLeftNum, varOrangeLeftNum, varStrawberryRightNum, varLemonRightNum
// , varOrangeRightNum, varStrawberryNum, varLemonNum, varOrangeNum);
GameServices.timerServices.Push(this, 3.0f, delegate
GameServices.timerServices.Push(this, 1.0f, delegate
{
if (m_glassView)
{
......
......@@ -47,7 +47,7 @@ MeshRenderer:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 814401633786599675}
m_Enabled: 0
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 0
......@@ -316,7 +316,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &4990542984763268105
Transform:
m_ObjectHideFlags: 0
......@@ -325,8 +325,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3770714754173769064}
m_LocalRotation: {x: -0, y: -0, z: -1, w: 0}
m_LocalPosition: {x: -0.7, y: 0.663, z: 0}
m_LocalScale: {x: 2, y: 2, z: 2}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 10, y: 10, z: 10}
m_Children:
- {fileID: 8492637843816295049}
- {fileID: 442257671573955906}
......@@ -352,7 +352,7 @@ MonoBehaviour:
isOpen: 1
inertness: 50
liquidColor: {r: 1, g: 0.22193101, b: 0.11764705, a: 0.627451}
fillAmountPercent: 0
fillAmountPercent: 1
customVolume: 0
--- !u!114 &6961770000721999200
MonoBehaviour:
......@@ -380,7 +380,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3770714754173769064}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d6f65fb23ad160c459d2598442688217, type: 3}
m_Name:
......
......@@ -97,7 +97,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &5580258223393118805
Transform:
m_ObjectHideFlags: 0
......@@ -106,8 +106,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 795427624253935911}
m_LocalRotation: {x: -0, y: -0, z: -1, w: 0}
m_LocalPosition: {x: -0.126, y: 2.61934, z: 0}
m_LocalScale: {x: 0.35999998, y: 0.35999998, z: 0.37}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 10, y: 10, z: 10}
m_Children:
- {fileID: 7914130889153903067}
- {fileID: 3848509755633153631}
......@@ -133,7 +133,7 @@ MonoBehaviour:
isOpen: 1
inertness: 50
liquidColor: {r: 1, g: 0.22193101, b: 0.11764705, a: 0.627451}
fillAmountPercent: 0
fillAmountPercent: 1
customVolume: 0
--- !u!114 &6314391633705275183
MonoBehaviour:
......@@ -161,7 +161,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 795427624253935911}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d6f65fb23ad160c459d2598442688217, type: 3}
m_Name:
......@@ -292,7 +292,7 @@ MeshRenderer:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3782806068881874289}
m_Enabled: 0
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 0
......
......@@ -18,7 +18,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &4103081311078346907
Transform:
m_ObjectHideFlags: 0
......@@ -27,8 +27,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 817001031870075872}
m_LocalRotation: {x: -0, y: -0, z: -1, w: 0}
m_LocalPosition: {x: -0.126, y: 2.61934, z: 0}
m_LocalScale: {x: 0.35999998, y: 0.35999998, z: 0.37}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 7, y: 7, z: 7}
m_Children:
- {fileID: 610015336285617241}
- {fileID: 5685643785392877818}
......@@ -54,7 +54,7 @@ MonoBehaviour:
isOpen: 1
inertness: 50
liquidColor: {r: 1, g: 0.22193101, b: 0.11764705, a: 0.627451}
fillAmountPercent: 0
fillAmountPercent: 1
customVolume: 0
--- !u!114 &9204652029225145220
MonoBehaviour:
......@@ -82,7 +82,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 817001031870075872}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d6f65fb23ad160c459d2598442688217, type: 3}
m_Name:
......@@ -803,7 +803,7 @@ MeshRenderer:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5355082962861727518}
m_Enabled: 0
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 0
......
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