// Use this for initialization void Start() { velocity = Vector2.zero; if (isTargetAlive()) { typeFollow = TypeFollow.OBJECT; following = true; invokeOnFollow(); } }
/// <summary> /// Sets the target to follow. /// </summary> /// <param name="target"></param> public void setTarget(GameObject target, bool follow = false) { this.target = target; this.typeFollow = TypeFollow.OBJECT; this.following = follow; }