Created
March 5, 2019 01:28
-
-
Save Nobuyuki-Kobayashi/46a685e49dfd9155353151a62a9c3279 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
// | |
// LookAtConstraintHelperのヘルパー. | |
// ユニティちゃんのHipsジョイントにつける場合の例. | |
// unityChanJointHips = GameObject.Find("/CandyRockStar/Character1_Reference/Character1_Hips").transform; | |
// とやってもいいけど、初期化のプレファブ生成と同時やるとタイミングの面で難しいので、ターゲットにTagを付けたほうがいいです. | |
// | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
namespace UnityChan | |
{ | |
public class AttachUnityChanJoinHips : MonoBehaviour { | |
private LookAtConstraintHelper lookAtConstraintHelper; | |
private Transform unityChanJointHips; | |
void Awake() { | |
lookAtConstraintHelper = GetComponent<LookAtConstraintHelper>(); | |
//UnityChanのHipsジョイントにタグを付けておくこと. | |
unityChanJointHips = GameObject.FindGameObjectWithTag("UnityChanJointHips").transform; | |
lookAtConstraintHelper.SourceTransform = unityChanJointHips; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment