コード例 #1
0
    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);
    }
コード例 #2
0
    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;
    }