bool SnapOnApplyDirectlyToTheForehead(GameObject gameObject) { Vector3 dir; bool snap = GetSnappingDirection(gameObject.transform, out dir); if (!snap) { return(false); } gameObject.transform.position += dir; gameObject.transform.SetParent(Core.Instance.transform); Destroy(gameObject.GetComponent <Rigidbody2D>()); Snapper snapper = gameObject.AddComponent <Snapper>(); Consts.Dir snapDir = Consts.GetDir(dir); //Debug.Log(transform.name + " " + snapDir); Core.Instance.RegisterUnit(gameObject); return(true); }