From ba49cb4da7cae683585cc34b7adba46429c22af9 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 19 Apr 2022 22:56:15 +0800 Subject: + topdown transform --- AlienSurvival/Assets/Test/Scripts/TestPeaceMakerGrenade.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'AlienSurvival/Assets/Test/Scripts/TestPeaceMakerGrenade.cs') diff --git a/AlienSurvival/Assets/Test/Scripts/TestPeaceMakerGrenade.cs b/AlienSurvival/Assets/Test/Scripts/TestPeaceMakerGrenade.cs index 109e47b..cd12c1e 100644 --- a/AlienSurvival/Assets/Test/Scripts/TestPeaceMakerGrenade.cs +++ b/AlienSurvival/Assets/Test/Scripts/TestPeaceMakerGrenade.cs @@ -15,7 +15,6 @@ public class TestPeaceMakerGrenade : MonoBehaviour private Vector3 m_Velocity; // x, y, fakeHeight - /// /// 设置初始参数,都在fake空间下 /// @@ -25,10 +24,7 @@ public class TestPeaceMakerGrenade : MonoBehaviour public void Set(Vector3 initPosition, Vector3 initDirection, float initSpeed) { m_Coords = GetComponent(); - - m_Coords.x = initPosition.x; - m_Coords.y = initPosition.y; - m_Coords.height = initPosition.z; + m_Coords.position = initPosition; m_Velocity = initDirection * initSpeed; } @@ -61,9 +57,7 @@ public class TestPeaceMakerGrenade : MonoBehaviour GameObject exp = Instantiate(m_ExplosionEffect); TestFakeHeight coord = exp.GetComponent(); - coord.x = m_Coords.x; - coord.y = m_Coords.y; - coord.height = m_Coords.height; + coord.position = m_Coords.position; exp.SetActive(true); } -- cgit v1.1-26-g67d0