public override void OnInspectorGUI() { DrawDefaultInspector(); EditorGUILayout.LabelField("Опции"); MazeGenParallel maze_gen = (MazeGenParallel)target; if (GUILayout.Button("ReGenerate Maze Parallel")) { int n = maze_gen.transform.childCount; for (int i = 0; i < n; i++) { SafeDestroy.SafeDestroyGameObject(maze_gen.transform.GetChild(0)); } maze_gen.RegenerateMaze(); } if (GUILayout.Button("ReGenerate Maze")) { MazeGen maze_gen1 = GameObject.Find("Plane").GetComponent <MazeGen>(); int n = maze_gen1.transform.childCount; for (int i = 0; i < n; i++) { SafeDestroy.SafeDestroyGameObject(maze_gen1.transform.GetChild(0)); } maze_gen1.RegenerateMaze(); } EditorGUI.BeginChangeCheck(); this._selected = EditorGUILayout.Popup("My Simple Dropdown", _selected, _options); if (EditorGUI.EndChangeCheck()) { Debug.Log(_options[_selected]); } }
void ClearLevelImmediate() { foreach (ILevelObject obj in GetCurrentLevelObjects()) { SafeDestroy.DestroyGameObject(obj.GetTransform); } }
public virtual void DeathEffect(float deathEffectTime_) { if (Application.isPlaying) { Tweener t = transform.DOScale(Vector3.zero, deathEffectTime_); t.SetEase(_blockProperties._blockSpawnEaseType); } SafeDestroy.DestroyGameObject(this, deathEffectTime_); }
public void DeathEffect(float deathEffectTime_) { if (Application.isPlaying) { Tweener t = transform.DOScale(Vector3.zero, deathEffectTime_); t.SetEase(_spawnEase); OnDeath(); } SafeDestroy.DestroyGameObject(this, 2.0f); }
private void OnCollisionEnter(Collision other) { _health = other.gameObject.GetComponent <Health> (); if (_health != null) { _health.Damage(_damage); } SafeDestroy.DestroyGameObject(this); }
public void DeleteWaypoints() { int i = 0; while (wps.Count != 2) { Component wp = wps[i]; if (wp.name != "S" && wp.name != "E") { SafeDestroy.SafeDestroyGameObject(wp); i--; } wps.Remove(wp); i++; } }
void DestroyAllChildren() { if (_isEditMode) { for (int i = transform.childCount - 1; i >= 0; i--) { SafeDestroy.DestroyGameObject(transform.GetChild(0)); } } else { foreach (Transform tran in transform) { Destroy(tran.gameObject); } } }
void DestroyWall(Vector3 pos_) { _colliders = Physics.OverlapSphere(pos_, 0.2f, _wallsLayerMask); if (_isEditMode) { for (int i = 0; i < _colliders.Length; i++) { SafeDestroy.DestroyGameObject(_colliders[i]); } } else { foreach (Collider col in _colliders) { Destroy(col.gameObject); } } }