// Update is called once per frame void Update() { if (!initmon) { if (Lists.IsActive() && MonInit.IsActive() && BattleMain3.IsActive()) { //MonInv.AddMonster(MonInit.MakeFromPrefab(test)); //MonInv.AddMonster(MonInit.MakeFromPrefab(test)); initmon = true; randopon = Lists.RandMon(); randopon = MonInit.RandomFromPrefab(randopon); //randopon = MonInit.RandomFromPrefab(testopon); BattleMain3.SetMon(randopon); //you = MonInv.FirstActive(); //you = MonInit.MakeFromPrefab(test); //you = new Monster.SubMonster(MonInv.FirstActive()); //BattleMain3.SetYou(you); BattleMain3.TurnSet(true); } } else if (initmon) { gameObject.SetActive(false); //animation, activate BattleMain3, close this } }
void OnEnable() { Events.SetActive(false); temp = Lists.RandMon(); temp = MonInit.RandomFromPrefab(temp); disp.sprite = Resources.Load("MonsterSprites/" + temp.imagepath, typeof(Sprite)) as Sprite; text.text = "Aw! You've found a lonely " + temp.Name + "\nwho wants to join your team\n\nDo you want to keep it?"; //SaveLoad.Save(SaveCallBack); }