Ejemplo n.º 1
0
        private void UpdateTarget()
        {
            if (selection != Selection.Delete)
            {
                return;
            }

            if (target != null)
            {
                target.Deselect();
                target = null;
            }

            var(hit, go) = Trace();
            if (!hit)
            {
                return;
            }

            if (!(go.GetComponent(typeof(ITargetable)) is ITargetable newTarget))
            {
                return;
            }
            target = newTarget;
            target.Select();
        }