示例#1
0
    public Unit CreateUnit()
    {
        var unit = Object.Instantiate(_context.UnitPrefab);

        unit.PartOne          = _controllerFactory.GetFirstPlayer();
        unit.PartOne.Command += unit.OnCommand;
        unit.PartTwo          = _controllerFactory.GetSecondPlayer();
        unit.PartTwo.Command += unit.OnCommand;

        return(unit);
    }
示例#2
0
    public Unit CreateUnit()
    {
        var unit = Object.Instantiate(_context.UnitPrefab);

        unit.PartOne          = _controllerFactory.GetFirstPlayer();
        unit.PartOne.Command += unit.OnCommand;
        unit.PartTwo          = _controllerFactory.GetSecondPlayer();
        unit.PartTwo.Command += unit.OnCommand;
        unit.GetComponentInChildren <CameraController>().target = unit.transform;

        return(unit);
    }