コード例 #1
0
ファイル: Field.cs プロジェクト: Sckorn/battleships
    public Field(string fieldName, int player)
    {
        CustomError ce = new CustomError("Field", "constructor");

        this.cells = new Cell[this.byX, this.byY];

        for (int i = 0; i < this.byX; i++)
        {
            for (int j = 0; j < this.byY; j++)
            {
                this.cells[i, j] = new Cell(i, j);
            }
        }

        Morpher mphr = GameObject.Find("Morpher").GetComponent <Morpher>();

        mphr.InstAField(fieldName, ref this.realObjectReference);
        if (player == 1)
        {
            this.crossHair       = mphr.InstACross().GetComponent <GUITexture>();
            this.allocatingShips = true;
        }
        else
        {
            this.allocatingShips = false;
        }

        EventManager.OnResize += this.ResizeAfterCreate;
    }
コード例 #2
0
ファイル: Field.cs プロジェクト: Sckorn/battleships
    public Field(string fieldName)
    {
        CustomError ce = new CustomError("Field", "constructor");

        this.cells = new Cell[this.byX, this.byY];
        Morpher mphr = GameObject.Find("Morpher").GetComponent <Morpher>();

        mphr.InstAField(fieldName, ref this.realObjectReference);
        this.crossHair = mphr.InstACross().GetComponent <GUITexture>();
    }