protected override void Awake() { base.Awake(); body = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); orderObj = Instantiate(ordersFramePrefab, ordersFrameRoot, false); orderObj.Init(this, ordersFollowGO); catHealthObj = Instantiate(catHealthPrefab, healthFrameRoot, false); catHealthObj.Init(this, healthFollowsGO); displayOrders(false); }
private void cleanup() { if (curOrder != null) { curOrder.Cleanup(); } if (orderObj.IsDisplayed) { InputManager.Instance.OnRightMouseUp -= hideOrders; } Destroy(orderObj.gameObject); Destroy(catHealthObj.gameObject); orderObj = null; catHealthObj = null; }