Esempio n. 1
0
    private void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            _instance = this;
        }

        InitiateGrid();

        if (Debugger.IsInEditorPlayMode() && Debugger.debug)
        {
            MyHexCell go;
            for (int i = -6; i <= 6; i++)
            {
                for (int j = -6; j <= 6; j++)
                {
                    if ((-i - j) * (-i - j) <= 6 * 6)
                    {
                        go = new GameObject("Debug: " + i + " | " + j).AddComponent <MyHexCell>();

                        SetElementAt(go, i, j, Mathf.RoundToInt(Random.Range(-3, 3)));
                    }
                }
            }
        }
    }
Esempio n. 2
0
    private void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            _instance = this;
        }

        grid             = MyHexGrid.Instance;
        interfaceManager = GetComponent <InterfaceManager>() ?? gameObject.AddComponent <InterfaceManager>();
    }