Пример #1
0
    void Awake()
    {
        isDebugMode = selectedBeatDetection.debugMode;

        int j = 0;

        for (int i = 0; i < cubesToSpawn; i++)
        {
            CubeSound newCube = Instantiate <CubeSound>(cubePrefabObject);
            int[]     toEar   = { j, j + 1 };
            j += 2;
            newCube.selectedBeatDetection = selectedBeatDetection;
            newCube.cubesManager          = gameObject.GetComponent <CubesManager>();
            newCube.subbandsToEar         = toEar;
            newCube.smoothnessChange      = 2f;
            newCube.isDebugMode           = this.isDebugMode;
            newCube.moodManager           = this.moodManager;

            if (!isDebugMode)
            {
                MeshRenderer renderer = newCube.gameObject.GetComponent <MeshRenderer>();
                renderer.material.color = new Color(0, 0, 0, 0);
                Debug.Log("Alpha!");
            }

            //newCube.transform.position = Vector3.right * (-cubesToSpawn + i * 2);
            newCube.transform.position = new Vector3(-cubesToSpawn + i * 2, yPositionOfCubes, 0);
            newCube.transform.SetParent(transform);
        }

        moodManager.isDebugMode = isDebugMode;
        moodManager.GetCubeSounds(moodManager.cubeParent);
    }
Пример #2
0
    void Awake()
    {
        int j = 0;

        for (int i = 0; i < cubesToSpawn; i++)
        {
            CubeSound newCube = Instantiate <CubeSound> (prefabObject);
            int[]     toEar   = { j, j + 1 };
            j += 2;
            newCube.selectedBeatDetection = selectedBeatDetection;
            newCube.subbandsToEar         = toEar;
            newCube.smoothnessChange      = 2f;


            newCube.transform.position = Vector3.right * (-cubesToSpawn + i * 2);
            newCube.transform.SetParent(transform);
        }
    }