I have no idea where to start with this or how to search for more info on this topic so i am coming here for advice. I want to make a Saved system where the player can press a Button and get the Object to appear on a Favorite list(list of buttons that take you to the Game scene shown on them).
I have managed to make this
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
public class CustomSave : MonoBehaviour
{
public Button Custom;
public Button Save;
public Button Save1;
int a = 0, b = 0;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (a>b)
{
if (PlayerPrefs.GetInt("Place") == 1 && PlayerPrefs.GetInt("1") == 0)
{
RectTransform rt = Custom.GetComponent();
rt.anchoredPosition = new Vector2(-285, 435);
PlayerPrefs.SetInt("1", 1);
PlayerPrefs.SetInt("2", 0);
}
if (PlayerPrefs.GetInt("Place") == 2 && PlayerPrefs.GetInt("2") == 0)
{
RectTransform rt = Custom.GetComponent();
rt.anchoredPosition = new Vector2(245, 435);
PlayerPrefs.SetInt("2", 1);
}
if (PlayerPrefs.GetInt("0") == 0)
{
RectTransform rt = Custom.GetComponent();
rt.anchoredPosition = new Vector2(-2000, 700);
PlayerPrefs.SetInt("1", 0);
PlayerPrefs.SetInt("0", 1);
}
b++;
}
}
public void CustomSaved()
{
a++;
PlayerPrefs.SetInt("CustomSaved", PlayerPrefs.GetInt("CustomSaved") +1);
if (PlayerPrefs.GetInt("CustomSaved") % 2 != 0)
{
var colors0 = Save.GetComponent
↧