コード例 #1
0
 void Awake()
 {
     if (singleton != null)
     {
         enabled = false;
         Destroy(this);
         return;
     }
     singleton = this;
     RunThroughNPCs();
 }
コード例 #2
0
    public void CageBroken()
    {
        if (cageID != -1)
        {
            PlayerPrefs.SetInt("Cage" + cageID.ToString(), 1);

            CagedNPCManager.RunThroughNPCs();

            if (cageID >= 4)
            {
                CountFreedFlowers();
            }
            //    CagedNPCManager.SpecialCaseCheck(cageID);
        }

        audioSource.enabled = true;

        npcText.gameObject.transform.parent.parent.parent.parent.gameObject.GetComponent <NPCInteraction>().textID = freeTextID;

        if (npcAnimator != null && victoryAnimationName != "")
        {
            npcAnimator.Play(victoryAnimationName, 0);
        }

        tpc    = PlayerManager.GetMainPlayer();
        woodle = tpc.gameObject;

        StartCoroutine(BerryReward(berryReward));
        CheckPSTrophies(berryReward);

        if (npcAnimator != null)
        {
            npcRenderer = npcAnimator.GetComponentInChildren <Renderer>();
        }
        StartCoroutine(FinishInteraction());
    }