2021-08-18 00:50:19 +08:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class Stone : MonoBehaviour
|
|
|
|
{
|
|
|
|
//具象物体,石头
|
|
|
|
[Tooltip("投掷物堆的游戏物体,请拖入预制体。石头被剧情杀炸毁后,将生成这样一个投掷物堆")]
|
|
|
|
public GameObject missile;
|
2021-08-30 01:55:39 +08:00
|
|
|
private delegate Vector3 Down(Vector3 pos);
|
|
|
|
|
2021-08-18 00:50:19 +08:00
|
|
|
|
|
|
|
//如果被特殊炮弹击中
|
|
|
|
public void BeHitBySpecalShell()
|
|
|
|
{
|
2021-08-30 01:55:39 +08:00
|
|
|
Down down = (Vector3 pos)
|
|
|
|
=>
|
|
|
|
{
|
|
|
|
return new Vector3(
|
|
|
|
//x
|
|
|
|
pos.x,
|
|
|
|
//y
|
|
|
|
pos.y - 0.6f,
|
|
|
|
//z
|
|
|
|
pos.z
|
|
|
|
);
|
|
|
|
};
|
|
|
|
Instantiate(missile,
|
|
|
|
down(transform.position),
|
|
|
|
Quaternion.identity);//原地生成投掷物堆
|
2021-08-18 00:50:19 +08:00
|
|
|
Destroy(gameObject);
|
|
|
|
}
|
|
|
|
}
|