コード例 #1
0
    private IEnumerator GiveLight(int light)
    {
        onCooldown = true;
        Scoring.AddLight(light);
        light1.gameObject.SetActive(false);
        light2.gameObject.SetActive(false);
        light3.gameObject.SetActive(false);
        particles.gameObject.SetActive(false);
        Debug.Log("Warming! " + Scoring.GetLight() + " light remaining");
        yield return(new WaitForSeconds(cooldown));

        onCooldown = false;
        light1.gameObject.SetActive(true);
        light2.gameObject.SetActive(true);
        light3.gameObject.SetActive(true);
        particles.gameObject.SetActive(true);
    }
コード例 #2
0
ファイル: Torch.cs プロジェクト: JLSaake/Night-Light
    private IEnumerator TakeTorch()
    {
        Debug.Log("TakingTorch");
        Scoring.AddLight(1); // TODO: make constant
        Debug.Log("Taking: " + Scoring.GetLight() + " light remaining");
        isActive = false;
        canTake  = false;
        particles.gameObject.SetActive(false);
        light1.gameObject.SetActive(false);
        light2.gameObject.SetActive(false);
        yield return(new WaitForSeconds(cooldown));

        particles.gameObject.SetActive(true);
        light1.gameObject.SetActive(true);
        light2.gameObject.SetActive(true);
        isActive = true;
        if (playerIn)
        {
            canTake = true;
        }
        Debug.Log("TorchActive");
    }