コード例 #1
0
ファイル: maze_gui.cs プロジェクト: Kvazikot/BallPark
    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]);
        }
    }
コード例 #2
0
ファイル: LevelManager.cs プロジェクト: Flubz/Plucky
 void ClearLevelImmediate()
 {
     foreach (ILevelObject obj in GetCurrentLevelObjects())
     {
         SafeDestroy.DestroyGameObject(obj.GetTransform);
     }
 }
コード例 #3
0
ファイル: Block.cs プロジェクト: Flubz/Plucky
 public virtual void DeathEffect(float deathEffectTime_)
 {
     if (Application.isPlaying)
     {
         Tweener t = transform.DOScale(Vector3.zero, deathEffectTime_);
         t.SetEase(_blockProperties._blockSpawnEaseType);
     }
     SafeDestroy.DestroyGameObject(this, deathEffectTime_);
 }
コード例 #4
0
 public void DeathEffect(float deathEffectTime_)
 {
     if (Application.isPlaying)
     {
         Tweener t = transform.DOScale(Vector3.zero, deathEffectTime_);
         t.SetEase(_spawnEase);
         OnDeath();
     }
     SafeDestroy.DestroyGameObject(this, 2.0f);
 }
コード例 #5
0
ファイル: Projectile.cs プロジェクト: Flubz/GDL2018
    private void OnCollisionEnter(Collision other)
    {
        _health = other.gameObject.GetComponent <Health> ();
        if (_health != null)
        {
            _health.Damage(_damage);
        }

        SafeDestroy.DestroyGameObject(this);
    }
コード例 #6
0
ファイル: RrtPlaner.cs プロジェクト: Kvazikot/BallPark
    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++;
        }
    }
コード例 #7
0
ファイル: LevelGenerator.cs プロジェクト: Flubz/GDL2018
 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);
         }
     }
 }
コード例 #8
0
ファイル: LevelGenerator.cs プロジェクト: Flubz/GDL2018
    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);
            }
        }
    }