using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class wepon : MonoBehaviour {
public Transform Lhand;
public Transform Rhand;
// Use this for initialization
void Start () {
}
private void OnTriggerEnter(Collider other)
{
Debug.Log("hit:" + other.name);
if(other.tag=="dao")
{
other.transform.parent = Lhand;
other.transform.localPosition = Vector3.zero;
other.transform.localEulerAngles = new Vector3(-90, 0, 0);
}
if (other.tag=="fuzi")
{
other.transform.parent = Rhand;
other.transform.localPosition = Vector3.zero;
other.transform.localEulerAngles = new Vector3(-90, 0, 0);
}
}
// Update is called once per frame
void Update () {
}
}
拾取武器unity
最新推荐文章于 2024-07-11 15:19:27 发布