Last active
December 28, 2015 08:16
-
-
Save peroon/e578677bd44b1c01f076 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| // 各インスタンスにAnimatorつけるのがもったいないのでAnimatorつけるのは1つにして | |
| // 他のオブジェクトはそれをコピーする | |
| // 1フレーム遅れるが問題ない | |
| public class AnimationCopy : MonoBehaviour { | |
| public Transform animationBase; // アニメーションのコピー元 | |
| void Update () { | |
| // 自身のローカルPos, Rotをコピー元と合わせる | |
| if (animationBase != null) { | |
| this.transform.localPosition = animationBase.localPosition; | |
| this.transform.localRotation = animationBase.localRotation; | |
| } else { | |
| Debug.Log ("null"); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment