12345678910111213141516171819 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class ChangeHand : MonoBehaviour
- {
- public GameObject shoubi1;
- public GameObject shoubi2;
- public GameObject zhongduan;
- // Update is called once per frame
- void Update()
- {
- Vector3 p1 = (shoubi1.transform.position + shoubi2.transform.position)/2;
- zhongduan.transform.position = p1;
- zhongduan.transform.LookAt(shoubi1.transform, Vector3.down);
- }
- }
|