void Start() { MelodyPlay = GameObject.Find("/GameManager").GetComponent <MelodyPlay>(); //找到电视需要替换的material _tvMaterial = Resources.Load <Material>("Materials/tvMat"); if (FurnitureName == "Piano") { _myAudioList = GetComponents <AudioSource>(); } //待修改:怎么找smokeparticle //SmokeParticle = GameObject.Find("Kitchen/SmokeParticle"); Register(); //print("registered"); //levelProcessor = GameObject.Find("GameManager").GetComponent<LevelProcessor>(); childOutlines = GetComponentsInChildren <cakeslice.Outline>(); //新加 _audioSource = GetComponent <AudioSource>(); _anim = Furniture.GetComponent <Animator>(); _animNew = Furniture2.GetComponent <Animator>(); //_animUI = UI.GetComponent<Animator>(); //找到填充的UI FullUI = GameObject.Find(FurnitureName + "UI/Full"); StrokeUI = GameObject.Find(FurnitureName + "UI/Stroke"); rdStroke = StrokeUI.GetComponent <CanvasRenderer>(); rdFull = FullUI.GetComponent <CanvasRenderer>(); rdFull.SetAlpha(0); if (!gameObject.name.Contains("Clock")) { rdStroke.SetAlpha(0); } _imageUI = FullUI.GetComponent <Image>(); _imageUI.fillAmount = 0; //spotLight = transform.Find("SpotLight").gameObject; //HeartBeating = UI.GetComponent<HeartBeating>(); //originalScale = transform.localScale; scoring = transform.Find("Scoring").gameObject; foreach (var Beat in BeatLoop) { if (Beat) { requiredPerfect++; } } }
// Start is called before the first frame update private void Awake() { _melodyPlay = GetComponent <MelodyPlay>(); foreach (var furniture in furnitureInteractors) { if (testMode) { furniture.requiredPerfect = 0; furniture.requiredCorrectPlayers = 0; } AudioSource audioTemp = furniture.GetComponent <AudioSource>(); _furnitureSF.Add(audioTemp); oriVolume.Add(audioTemp.volume); } }