Commit 71db4061 authored by czy's avatar czy

添加吃金币特效

parent 8bdd7293
......@@ -1005,6 +1005,75 @@ Transform:
m_Father: {fileID: 2089912915}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &427821060
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 143964, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_Name
value: GoldCoinBlast
objectReference: {fileID: 0}
- target: {fileID: 143964, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalRotation.x
value: -0.7071068
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071067
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 19851814, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: InitialModule.startSizeY.minMaxState
value: 3
objectReference: {fileID: 0}
- target: {fileID: 19851814, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: InitialModule.startSizeZ.minMaxState
value: 3
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
--- !u!1001 &443390485
PrefabInstance:
m_ObjectHideFlags: 0
......
......@@ -35,6 +35,7 @@ public class AIMove : MonoBehaviour
[Header("特效")]
public ParticleSystem particleChange; //变身特效
private RaycastHit RHit;
private CharacterController characterController;
private bool m_bIsCanMove = true;//是否能开车
......@@ -102,11 +103,15 @@ public class AIMove : MonoBehaviour
{
if(SpeedLevel < 3)
{
SpeedLevel += 1;
BattleCtrl.instance.Score++;
BattleCtrl.instance.updateScore?.Invoke();
ChangeModel();
}
other.gameObject.GetComponentInChildren<Gold>().PlayParticle();//吃金币特效
Destroy(other.gameObject);
}
else if (other.tag == "Prickle")
......@@ -643,19 +648,19 @@ public class AIMove : MonoBehaviour
switch (SpeedLevel)
{
case 1:
PlayParticle();
PlayParticle(particleChange);
Model1.SetActive(true);
Model2.SetActive(false);
Model3.SetActive(false);
break;
case 2:
PlayParticle();
PlayParticle(particleChange);
Model1.SetActive(false);
Model2.SetActive(true);
Model3.SetActive(false);
break;
case 3:
PlayParticle();
PlayParticle(particleChange);
Model1.SetActive(false);
Model2.SetActive(false);
Model3.SetActive(true);
......@@ -684,11 +689,13 @@ public class AIMove : MonoBehaviour
}
}
}
public void PlayParticle()
public void PlayParticle(ParticleSystem ps)
{
ParticleSystem copyParticle = Instantiate(particleChange, particleChange.transform.position, particleChange.transform.rotation);
ParticleSystem copyParticle = Instantiate(ps, ps.transform.position, ps.transform.rotation);
copyParticle.Play();
}
private void OnDestroy()
{
m_targetTrans = null;
......
......@@ -4,14 +4,27 @@ using UnityEngine;
public class Gold : MonoBehaviour
{
public ParticleSystem particleGetGold;//获取金币特效
//private void OnTriggerEnter(Collider other)
//{
// if (other.tag=="Player")
// if (other.tag == "Player")
// {
// BattleCtrl.instance.Score++;
// BattleCtrl.instance.updateScore?.Invoke();
// Destroy(gameObject);
// }
//}
private void Start()
{
}
public void PlayParticle()
{
ParticleSystem copyParticle = Instantiate(particleGetGold, particleGetGold.transform.position, particleGetGold.transform.rotation);
copyParticle.Play();
}
}
......@@ -105,6 +105,7 @@ public class PlayerMove : MonoBehaviour
//print("OnTriggerEnter:"+other.name);
if (other.tag == "Gold")
{
other.gameObject.GetComponentInChildren<Gold>().PlayParticle();//吃金币特效
Destroy(other.gameObject);
if (SpeedLevel < 3)
{
......
......@@ -629,7 +629,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 541645531084013779}
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: 4.967, y: 3.75, z: 14.999}
m_LocalPosition: {x: 2.86, y: 3.75, z: 14.999}
m_LocalScale: {x: 3.2785354, y: 3.2785354, z: 3.2785354}
m_Children:
- {fileID: 3529393628854795021}
......@@ -2575,7 +2575,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4825482254551959764}
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: 3.1507, y: 3.75, z: 13.275}
m_LocalPosition: {x: 2.8, y: 3.75, z: 13.275}
m_LocalScale: {x: 3.2785354, y: 3.2785354, z: 3.2785354}
m_Children:
- {fileID: 611077812003865918}
......
......@@ -758,7 +758,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 541645531084013779}
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: 4.967, y: 1, z: 14.999}
m_LocalPosition: {x: 3.21, y: 1, z: 14.999}
m_LocalScale: {x: 3.2785354, y: 3.2785354, z: 3.2785354}
m_Children:
- {fileID: 3529393628854795021}
......
......@@ -9639,6 +9639,7 @@ Transform:
m_Children:
- {fileID: 368439108773061039}
- {fileID: 145774609814517389}
- {fileID: 2895305670506004570}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -9654,6 +9655,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0b6122de87679854eb2212330a8efaaf, type: 3}
m_Name:
m_EditorClassIdentifier:
particleGetGold: {fileID: 2895305670520203826}
--- !u!65 &6918762362743542617
BoxCollider:
m_ObjectHideFlags: 0
......@@ -9746,3 +9748,84 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 147240504158127137}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2895305670505648266
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 6772370766242430276}
m_Modifications:
- target: {fileID: 143964, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_Name
value: GoldCoinBlast
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalRotation.x
value: -0.7071068
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071067
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalScale.x
value: 2
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalScale.y
value: 2
objectReference: {fileID: 0}
- target: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
propertyPath: m_LocalScale.z
value: 2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 09d9de58ef3bf5444ac94afa0e6013cb, type: 3}
--- !u!4 &2895305670506004570 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 430288, guid: 09d9de58ef3bf5444ac94afa0e6013cb,
type: 3}
m_PrefabInstance: {fileID: 2895305670505648266}
m_PrefabAsset: {fileID: 0}
--- !u!198 &2895305670520203826 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 19806904, guid: 09d9de58ef3bf5444ac94afa0e6013cb,
type: 3}
m_PrefabInstance: {fileID: 2895305670505648266}
m_PrefabAsset: {fileID: 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