コード例 #1
0
ファイル: PlayerController.cs プロジェクト: talford2/SpaceX
    private void Awake()
    {
        _current = this;
        Cursor.visible = !HideMouse;
        if (HideMouse)
            Cursor.lockState = CursorLockMode.Locked;

        _profile = GetComponent<ShipProfile>();
        _inventory = new PlayerInventory(15);

        _screenAspect = (float)Screen.height / (float)Screen.width;

        _playerNpc = gameObject.AddComponent<Fighter>();
        _playerNpc.Team = Team;
        _playerNpc.IsSquadronMember = true;
        _playerNpc.GetComponent<ShipProfile>().CallSign = CallSign;
        _playerNpc.VehiclePrefab = VehiclePrefab;
        _playerNpc.enabled = false;
        SpawnVehicle(VehiclePrefab, Universe.Current.PlayerSpawnPosition);
        _playerNpc.SetVehicleInstance(_playVehicleInstance);
        _playerNpc.IsFollowIdleDestination = true;

        SetControlEnabled(true);

        _aimMask = ~LayerMask.GetMask("Player", "Detectable", "Distant");
        _detectableMask = LayerMask.GetMask("Detectable");
        _collectableMask = LayerMask.GetMask("Collectible");
    }