Ответ: Вопросы от новичка
Сообщение от Nex
|
OnDrawGizmosSelected делает гизмо не-пикабельным((
Решилось вот так:
родитель
List<ChildClass> childs = new List<ChildClass>(); public bool allowDrawGizmos = false; void OnDrawGizmos() { if (Selection.activeGameObject != null){ ChildClass sel = Selection.activeGameObject.GetComponent<ChildClass>(); if ((sel != null && childs.Contains(sel)) || Selection.activeGameObject == gameObject){ allowDrawGizmos = true; } else { allowDrawGizmos = false; } } }
чайлд
void OnDrawGizmos() { if (parent.allowDrawGizmos){ Gizmos.DrawIcon(transform.position, "GizmoIco.psd", true); } }
__________________
Intel Core i3-4005U (1.7 ГГц), 4 ГБ ОЗУ, nVidia GeForce 940M 4 ГБ, Win8.1
|