void loadBattleCanvas(int level, LevelData levelData) { BattleCanvas battleCanvas = BattleCanvas.Instance; battleCanvas.transform.SetParent(transform, false); battleCanvas.SetLevelText(level); if (level <= 20) { battleCanvas.SetBgImage("GameMain_1_bg"); } else if (level <= 40) { battleCanvas.SetBgImage("GameMain_2_bg"); } else if (level <= 60) { battleCanvas.SetBgImage("GameMain_3_bg"); } else { Debug.LogError("invalid level"); } string[] target1datas = levelData.target1.Split(','); string[] target2datas = levelData.target2.Split(','); if (levelData.isTimeOrStep == "0") { if (target2datas[0] == "-2") { battleCanvas.SetScoreTipPanel("ScoreTip1"); } else if (target2datas[0] == "11") { battleCanvas.SetScoreTipPanel("ScoreTip3"); } else { Debug.LogError("invalid target2datas[0]"); } battleCanvas.SetProp1Image("propTimeUp"); battleCanvas.SetProp2Image("propStopBaby"); battleCanvas.SetProp3Image("propBomb"); battleCanvas.SetProp1Count(PlayerData.GetGameProps(GameProps.TimeUp)); battleCanvas.SetProp2Count(PlayerData.GetGameProps(GameProps.StopBaby)); battleCanvas.SetProp3Count(PlayerData.GetGameProps(GameProps.Bomb)); } else if (levelData.isTimeOrStep == "1") { if (target2datas[0] == "-2") { battleCanvas.SetScoreTipPanel("ScoreTip2"); } else if (target2datas[0] == "11") { battleCanvas.SetScoreTipPanel("ScoreTip4"); } else { Debug.LogError("invalid target2datas[0]"); } battleCanvas.SetProp1Image("propStepUp"); battleCanvas.SetProp2Image("propStopBaby"); battleCanvas.SetProp3Image("propBomb"); battleCanvas.SetProp1Count(PlayerData.GetGameProps(GameProps.StepUp)); battleCanvas.SetProp2Count(PlayerData.GetGameProps(GameProps.StopBaby)); battleCanvas.SetProp3Count(PlayerData.GetGameProps(GameProps.Bomb)); } else { Debug.LogError("invalid levelData.isTimeOrStep"); } if (target2datas[0] == "11") { battleCanvas.GetScoreTipPanel().SetTarget2Icon("RescueObject_type11"); battleCanvas.GetScoreTipPanel().SetTarget2Text(target2datas[1]); } battleCanvas.GetScoreTipPanel().SetTimeOrStep(Convert.ToInt32(levelData.timeStep)); battleCanvas.GetScoreTipPanel().SetScoreText("0 / " + target1datas[1]); }