Exemple #1
0
 private void OnDestroy()
 {
     if (_instance == this)
     {
         _instance = null;
     }
 }
Exemple #2
0
    private void _spawnDirt(Transform parent)
    {
        var prefab = DirtRepocitory.GetStationaryPrefab();
        var child  = Instantiate(prefab, Vector3.zero, Quaternion.identity, parent);

        child.transform.position = parent.transform.position;
    }
Exemple #3
0
 private void Awake()
 {
     if (instance == null)
     {
         _instance = this;
     }
     else if (instance != this)
     {
         Debug.LogError(string.Format("{0} had duplicate dirt repo", name));
         Destroy(this);
     }
 }