Commit de33b933 authored by wanqing's avatar wanqing

修改代码

parent 3bcc16c4
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.4410327, g: 0.48977453, b: 0.56986296, a: 1}
m_IndirectSpecularColor: {r: 0.37311926, g: 0.38073996, b: 0.35872698, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &4
LightmapSettings:
......@@ -165,80 +165,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
levelPrefs:
- {fileID: 1411365057041450796, guid: 4c183562b13ee4f419e4c58c74ca5ae7, type: 3}
- {fileID: 8844811367371711361, guid: 4e82526948e0052488262b6410156ade, type: 3}
--- !u!1001 &471229527
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 902116567, guid: 4e82526948e0052488262b6410156ade, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123360, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123360, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123360, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123360, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123360, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123360, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123360, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123360, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123360, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123360, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123360, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9100893407295123361, guid: 4e82526948e0052488262b6410156ade,
type: 3}
propertyPath: m_Name
value: Level2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4e82526948e0052488262b6410156ade, type: 3}
--- !u!1 &543166196
GameObject:
m_ObjectHideFlags: 0
......@@ -445,11 +373,6 @@ PrefabInstance:
propertyPath: m_Name
value: BattleUI
objectReference: {fileID: 0}
- target: {fileID: 6064464677632144689, guid: 919382978f5e2684ba83e6daf6491458,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6064464677632144690, guid: 919382978f5e2684ba83e6daf6491458,
type: 3}
propertyPath: m_LocalPosition.x
......
......@@ -25,14 +25,19 @@ public class SecondLevelTrigger : MonoBehaviour
{
if (other.gameObject.CompareTag("Target"))
{
StorageView varView = BattleCtrl.instance.levelManager.curLevel.storageView;
if (varView)
SetExit(other);
}
}
//设置退出
public void SetExit(Collider other)
{
StorageView varView = BattleCtrl.instance.levelManager.curLevel.storageView;
if (varView)
{
if (m_lst.Contains(other))
{
if (m_lst.Contains(other))
{
varView.ExitTopBox(other.name);
m_lst.Remove(other);
}
varView.ExitTopBox(other.name);
m_lst.Remove(other);
}
}
}
......
......@@ -10,6 +10,7 @@ public class StorageView : MonoBehaviour
public BoxCollider m_triggerTopBox;
public Material m_redMat;//红色材质球
public GameObject m_planeObj;//地板
public Transform m_fixedTrans;//内置物体
private MeshCollider m_curTargetTrans;//当前抓的目标
public MeshCollider curTargetTrans => m_curTargetTrans;
private Vector3 m_offset;//偏移值
......@@ -37,6 +38,7 @@ public class StorageView : MonoBehaviour
private string m_modelCompassStr = "Compass";
private string m_modelTorchStr = "Torch";
private string m_modelBinocularStr = "Binocular";
private string m_modelBallStr = "Ball";
private Vector3 m_hitBoxPoint = Vector3.zero;//碰到箱子的点
private bool m_bControlCollisionBox = true;
private int m_insideBoxNum = 0;
......@@ -44,6 +46,8 @@ public class StorageView : MonoBehaviour
private bool m_bResult = true;
private int m_hitTopBoxNum = 0;
public int hitTopBoxNum => m_hitTopBoxNum;
private Rigidbody[] m_fixedRigidBody;
private int m_TotalNum = 4;//总的道具数量
// Start is called before the first frame update
void Start()
{
......@@ -60,6 +64,10 @@ public class StorageView : MonoBehaviour
m_camera = Camera.main;
GameServices.inputService.pad.onTouchUp += OnTouchUp;
m_animator = GetComponent<Animator>();
if(m_fixedTrans)
{
m_fixedRigidBody = m_fixedTrans.GetComponentsInChildren<Rigidbody>();
}
}
void CancelInvoke()
{
......@@ -140,13 +148,13 @@ public class StorageView : MonoBehaviour
// varBody.isKinematic = true;
//}
m_insideBoxNum++;
BattleCtrl.instance.battleUI.SetTakeBtnState(m_insideBoxNum >= 3);
BattleCtrl.instance.battleUI.SetTakeBtnState(m_insideBoxNum >= m_TotalNum);
}
//从箱子拿出
public void ExitBox()
{
m_insideBoxNum--;
BattleCtrl.instance.battleUI.SetTakeBtnState(m_insideBoxNum >= 3);
BattleCtrl.instance.battleUI.SetTakeBtnState(m_insideBoxNum >= m_TotalNum);
}
//碰到顶部盒子
public void EnterTopBox(string name)
......@@ -160,6 +168,7 @@ public class StorageView : MonoBehaviour
break;
}
}
//Debug.LogError(m_hitTopBoxNum);
}
//退出顶部盒子
public void ExitTopBox(string name)
......@@ -173,6 +182,7 @@ public class StorageView : MonoBehaviour
break;
}
}
//Debug.LogError(m_hitTopBoxNum);
}
//退出箱子碰到处理
void UpdateExitBox()
......@@ -213,6 +223,13 @@ public class StorageView : MonoBehaviour
//设置结果动画
public void SetResultAnimator(bool value)
{
if(m_fixedRigidBody != null)
{
for(int i = 0;i< m_fixedRigidBody.Length;i++)
{
m_fixedRigidBody[i].isKinematic = false;
}
}
if(value)
{
//for (int i = 0; i < m_targetTrans.Length; i++)
......@@ -251,7 +268,14 @@ public class StorageView : MonoBehaviour
float varX = (Input.mousePosition.x - Screen.width / 2f) / (Screen.width / GlobalConfig.NormalWidth);
float varY = (Input.mousePosition.y - Screen.height / 2f) / (Screen.width / GlobalConfig.NormalWidth);
BattleCtrl.instance.battleUI.SetSymbolPos(varX, varY);
m_curTargetTrans.transform.localScale = Vector3.Lerp(m_curTargetTrans.transform.localScale,Vector3.one*10,0.2f);
if(string.Equals(m_curTargetTrans.name, m_modelBallStr))
{
m_curTargetTrans.transform.localScale = Vector3.Lerp(m_curTargetTrans.transform.localScale, Vector3.one * 4, 0.2f);
}
else
{
m_curTargetTrans.transform.localScale = Vector3.Lerp(m_curTargetTrans.transform.localScale, Vector3.one * 10, 0.2f);
}
}
}
}
......@@ -463,7 +487,11 @@ public class StorageView : MonoBehaviour
m_curTargetTrans.GetComponent<MeshRenderer>().sharedMaterial = m_dicMat[m_curTargetTrans];
}
RotateInvoke();
SecondLevelTrigger varTrigger = m_triggerTopBox.GetComponent<SecondLevelTrigger>();
if (varTrigger)
{
varTrigger.SetExit(m_curTargetTrans);
}
break;
}
}
......
......@@ -2169,7 +2169,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 4
m_Text: '?'
--- !u!1 &2347244091049526850
GameObject:
m_ObjectHideFlags: 0
......@@ -3615,7 +3615,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 3
m_Text: '?'
--- !u!1 &2347244091852835720
GameObject:
m_ObjectHideFlags: 0
......@@ -5427,7 +5427,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 5
m_Text: '?'
--- !u!1 &2347244092514737476
GameObject:
m_ObjectHideFlags: 0
......@@ -6209,7 +6209,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &2347244092771967611
RectTransform:
m_ObjectHideFlags: 0
......@@ -6439,7 +6439,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &2347244092896141821
RectTransform:
m_ObjectHideFlags: 0
......@@ -6739,7 +6739,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &2347244092983598579
RectTransform:
m_ObjectHideFlags: 0
......@@ -10586,7 +10586,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6064464677159922112}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
......@@ -10640,7 +10640,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6064464677159922112}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a8ba38326c7546e449f8c538a5c9b48f, type: 3}
m_Name:
......@@ -10919,7 +10919,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6064464677418123800}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a8ba38326c7546e449f8c538a5c9b48f, type: 3}
m_Name:
......@@ -10933,7 +10933,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6064464677418123800}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
......@@ -11841,7 +11841,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6064464677995419504}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a8ba38326c7546e449f8c538a5c9b48f, type: 3}
m_Name:
......@@ -11855,7 +11855,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6064464677995419504}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
......
This diff is collapsed.
This diff is collapsed.
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