1234567891011121314151617181920212223242526272829303132333435363738 |
- using UnityEngine;
- using System.Collections;
- namespace CommonAIClient.Unity.Utils
- {
- public class DummyNode : MonoBehaviour
- {
- private string mDummyName;
- private GameObject mTraceObject;
- public bool Init(string name, GameObject traceObject)
- {
- if (string.IsNullOrEmpty(name))
- {
- Debug.LogError("string.IsNullOrEmpty(DummyName)");
- return false;
- }
-
- mDummyName = name;
- mTraceObject = traceObject;
- gameObject.name = "DummyNode_" + name;
- return true;
- }
-
- // Update is called once per frame
- void Update()
- {
- if (mTraceObject != null && mTraceObject.activeInHierarchy)
- {
- transform.position = mTraceObject.Position();
- transform.rotation = mTraceObject.Rotation();
- }
- }
- }
- }
|