Example #1
0
    protected new void Start()
    {
        base.Start();
        foreach (var obj in FindObjectsOfType <Rigidbody2D>())
        {
            Destroy(obj);
        }
        _textStyle           = new GUIStyle();
        _textStyle.fontSize  = Screen.height * 5 / 100;
        _textStyle.alignment = TextAnchor.MiddleCenter;


        _textStyle.normal.textColor = Color.white;

        if ((_floor = FindObjectOfType <Floor>()) == null)
        {
            Room.DoorType    = "move";
            Room.WallFatness = 10f;
            _floor           = Floor.CreateFloor(gameObject, (short)(10 * Screen.width / 1920), 10, 50f, 50f);
        }

        MoveComponent.ShowMovements = true;

        Camera.main.orthographicSize = CameraScript.BIRDSEYE_VIEW;
        if (_floor.LengthI.IsEven())
        {
            MyCameraLib.SetCameraPosition(_floor[_floor.LengthI >> 1, _floor.LengthJ - 1].Position - new Vector3(0f, _floor[0, 0].Height / 2f));
        }
        else
        {
            MyCameraLib.SetCameraPosition(_floor[_floor.LengthI >> 1, _floor.LengthJ - 1].Position);
        }
    }
Example #2
0
    protected new void Start()
    {
        base.Start();

        _room = gameObject.AddComponent <Room>();

        _chargers = new Transform[0];

        MyCameraLib.SetCameraPosition(_room.Position);

        _textStyle = new GUIStyle();
        _textStyle.normal.textColor = Color.black;
        _textStyle.alignment        = TextAnchor.MiddleCenter;

        _update = pregameupdate;
        _hitTextStyle.alignment        = TextAnchor.MiddleCenter;
        _hitTextStyle.normal.textColor = Color.yellow;

        _updateGUI = pregameupdategui;

        _playerTeam = MyColorLib.teams[MyColorLib.green].transform;
        _enemyTeam  = GameObject.Find("purple").GetTeam().transform;
    }
Example #3
0
 private void _setCamera()
 {
     MyCameraLib.SetCameraPosition(Vector2.zero);
     Camera.main.orthographicSize = 30f;
 }