示例#1
0
		void Awake() 
		{
			if (instance != null)
			{
				Destroy(gameObject);
			}
			else
			{
				instance = this;
				GameObject.DontDestroyOnLoad(gameObject);
			}
		}
示例#2
0
		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());
			}
		}
示例#3
0
		void Awake ()
		{
			_colours = GameObject.FindObjectOfType<ColourSwatch>();
		}