private void CountBreakableBlocks() { level = FindObjectOfType <level>(); if (tag == "Breakable") { level.CountBlocks(); } }
private void CountBreakableBlocks() { //we need to access to the type of level //all instances are adding another block so that why it can count the number of blocks. level = FindObjectOfType <level>(); if (tag == "Breakable") { level.CountBlocks(); } }
private void Start() { //findobjectでlevelスクリプトを参照してブロックの数を数える level = FindObjectOfType <level>(); if (tag == "Breakable") { level.CountBlocks(); } }