コード例 #1
0
ファイル: Rock.cs プロジェクト: Tyler0126/VRProject2
    IEnumerator destroyAndRecreate()
    {
        stoneWoodText stoneWoodScript = GameObject.Find("StoneWoodText").GetComponent <stoneWoodText>();

        stoneWoodScript.stone++;
        crumbleAudioSrc.PlayOneShot(rockCrumble);

        gameObject.GetComponent <Renderer>().enabled = false;

        yield return(new WaitForSeconds(respawnTime));

        gameObject.GetComponent <Renderer>().enabled = true;
        pickaxeSwings = 0;
    }
コード例 #2
0
    IEnumerator destroyAndRecreate()
    {
        stoneWoodText stoneWoodScript = GameObject.Find("StoneWoodText").GetComponent <stoneWoodText>();

        stoneWoodScript.wood++;
        chopAudiosrc.PlayOneShot(treeChop);

        gameObject.GetComponent <Renderer>().enabled = false;

        yield return(new WaitForSeconds(respawnTime));

        gameObject.GetComponent <Renderer>().enabled = true;
        axeSwings = 0;
    }
コード例 #3
0
ファイル: Tier1.cs プロジェクト: Tyler0126/VRProject2
    // Update is called once per frame
    void Update()
    {
        stoneWoodText stoneWoodScript = GameObject.Find("StoneWoodText").GetComponent <stoneWoodText>();

        if (stoneWoodScript.tier1Spawned)
        {
            gameObject.GetComponent <Renderer>().enabled    = true;
            gameObject.GetComponent <BoxCollider>().enabled = true;
        }
        else if (gameObject.GetComponent <Renderer>().enabled == true)
        {
            gameObject.GetComponent <Renderer>().enabled    = false;
            gameObject.GetComponent <BoxCollider>().enabled = false;
        }
    }