コード例 #1
0
    public void CloseInteract()
    {
        //PetData petData = SaveSystem.A_LoadPet(petAI.id);
        target.transform.localScale = new Vector3(0.3f, 0.3f, 1);
        target.transform.position   = new Vector3(0, -1.5f, 0);
        target.transform.rotation   = Quaternion.identity;
        petAI.rigidbody.constraints = RigidbodyConstraints2D.None;
        petAI.PetAct      = PetActivity.Stand;
        petData.hunger    = (int)petAI.Hunger;
        petData.happiness = (int)petAI.Happiness;

        Transform[] roots = target.GetComponentsInChildren <Transform>();
        foreach (Transform g in roots)
        {
            g.gameObject.layer = 10;
        }

        interactCam.gameObject.SetActive(false);
        SaveSystem.A_EditPet(petData, true);
        if (foodDic.Count > 0)
        {
            SaveSystem.A_SaveListFood(foodDic);
        }
        petAI.Happiness = petAI.Happiness;
        petAI.Hunger    = petAI.Hunger;
        target.layer    = 10;
        timeer          = 0;
        petAI.aleart    = true;
        target          = null;
        petAI           = null;
        interactUI.SetActive(false);
        interactUIBG.SetActive(false);
        foodCanvasList.SetActive(false);
        dressUpBtn.onClick.Invoke();
        gameMode = GameMode.Normal;
    }