void ClearCC() { if (ccInstance != null) { Destroy(ccInstance.gameObject); ccInstance = null; } }
void CreateCCInstance(IsometricMovement prefab) { ClearCC(); ccInstance = GameObject.Instantiate(prefab); ccInstance.transform.position = startingPoint.position + Vector3.up * fDropHeight; inputAssist.SetTarget(ccInstance); CCTypeText.text = CCType; }
private void SetTarget(IsometricMovement newTarget) { target = newTarget; NMAgent = target == null ? null : target.GetComponent <IsometricNavMeshAgent>(); }