void Start() { //連接MatchCSourse MatchCSourse = GetComponent <PermutationsSumSourse>(); m_MoveItems = MatchCSourse.MoveItems; m_MatchPosItems = MatchCSourse.MatchPosItems; m_SceneSound = MatchCSourse.SceneSounds; m_otherAnimObj = MatchCSourse.OtherAnimObjs; m_removeItemObj = MatchCSourse.removeItemObj; m_couldHaveSameChildCount = MatchCSourse.CouldHaveSameChildCount; m_didnotHaveSameMatchItem = MatchCSourse.DidnotHaveSameMatchItem; //淡出相機 m_CameraFade = this.gameObject.AddComponent <CameraFade>(); //判斷播放背景音 GamePublicAudioControl.Instance.PlaySceneMusic(); //音量建大 GamePublicAudioControl.Instance.UpSceneMusic(); //判斷播放開頭提示音效 PlaySceneSound(m_SceneSound.TipSound, m_SceneSound.TipSoundOnOff); //生成場景物件 InstanceMoveItem(m_MoveItems, moveItmeObj); InstanceMatchPosItem(m_MatchPosItems, matchPosItemObj); InstanceOtherAnimObj(m_otherAnimObj); InstanceRemoveObj(m_removeItemObj); //點擊check按鈕事件 GameEventSystem.Instance.OnPushCheckBtn += CheckPass; }
/// <summary> /// (editor)生成額外動畫物件 /// </summary> /// <param name="_otherAnimObj"></param> /// <param name="objPrefab"></param> public void InstanceOtherAnimObj(OtherAnimObj_PermutationsSum _otherAnimObj) { if (_otherAnimObj.OtherAnimObjOnOff == true) { m_OtherAnimObjs = Instantiate(_otherAnimObj.OtherAnimObjPrefab, _otherAnimObj.OtherAnimObjPosition, Quaternion.identity); m_OtherAnimObjs.GetComponent <Animator>().enabled = false; m_OtherAnimObjs.GetComponent <SpriteRenderer>().enabled = _otherAnimObj.ShowInBeginOnOff; m_OtherAnimObjs.GetComponent <SpriteRenderer>().sortingOrder = 1; } }