public virtual void LoseTarget(string source = "") { // Debug.Log("lost targ:"+source); if (target == null) { return; } // Debug.Log("lost target:"+target.transform+" because "+source); if (!line) { // // commented Debug.Log("error no line on.. this obj"); } else { line.SetVertexCount(0); } // // commented Debug.Log("target lost."); target = null; }
public virtual void SetTarget(Transform t, TargetType tt, GameObject targetObj, Gadget g = null) { target = new AnimalTarget(); target.transform = t; target.type = tt; if (g) { // Debug.Log("set targ with g;"+g); target.gadget = g; // sooo many threads that this is woven into how annoying, but we need to keep a ref to the gadget from within which we found a tasty target ammo } else { // Debug.Log("set targ:"+t.name+", no gadget"); } // Debug.Log("set target. t:"+t); if (targetObj) { target.targetObj = targetObj; // should only happen with frogs.. This is code debt. Scrap this script and start over!! } // // commented Debug.Log("set target:"+t.name+", target type:"+tt); }