Exemple #1
0
		void Awake() 
		{
			if (instance != null)
			{
				Destroy(gameObject);
			}
			else
			{
				instance = this;
				GameObject.DontDestroyOnLoad(gameObject);
			}
		}
		void Start () 
		{
			_colourSwatch = GameObject.FindObjectOfType<ColourSwatch>();
			_sprite = GetComponent<SpriteRenderer>();

			var modelIndex = PlayerPrefsManager.GetShipModel();
			_sprite.sprite = _spriteArray[modelIndex];

			var exclusions = new HashSet<int>() {2, 3};

			if (!exclusions.Contains(modelIndex))
			{
				_sprite.color = _colourSwatch.GetColour(PlayerPrefsManager.GetShipColour());
			}
		}
Exemple #3
0
		void Awake ()
		{
			_colours = GameObject.FindObjectOfType<ColourSwatch>();
		}