コード例 #1
0
 // Use this for initialization
 void Start()
 {
     points = FindObjectOfType <PointCollectionScript>();
     agent  = GetComponent <NavMeshAgent>();
     error  = points.error;
     end    = FindObjectOfType <EndPointScript>();
     player = FindObjectOfType <PlayerScript>();
 }
コード例 #2
0
 // Update is called once per frame
 void Update()
 {
     if (!mHUD)
     {
         mHUD = transform.FindChild("HUDCanvas").gameObject.GetComponent <HUDScript>();
     }
     if (!playerController)
     {
         playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControllerIk>();
     }
     if (!startPointScript)
     {
         startPointScript = GameObject.FindGameObjectWithTag("Start").GetComponent <StartPointScript>();
     }
     if (!endPointScript)
     {
         endPointScript = GameObject.FindGameObjectWithTag("End").GetComponent <EndPointScript>();
     }
 }