예제 #1
0
    private void Awake()
    {
        mGearManager      = new GearManager(FindObjectOfType <VehicleCore>());
        mGameStateManager = FindObjectOfType <GameStateManager>();
        mGameSceneManager = FindObjectOfType <GameSceneManager>();
        this.UpdateAsObservable()
        .Subscribe(_ =>
        {
            //ギア
            mCurrentGear.Value = mGearManager.GetGear();
            if (mGameSceneManager.SceneState != SceneState.GAME)
            {
                return;
            }
            if (mGameStateManager.CurrentGameState.Value == InGameState.READY)
            {
                return;
            }
            float accel = Input.GetAxisRaw(ConstString.Input.ACCEL);
            accel       = Mathf.Clamp01(accel);
            mAccel.SetValueAndForceNotify(accel);

            //ハンドル
            mHundle.SetValueAndForceNotify(Input.GetAxisRaw(ConstString.Input.HORIZONTAL));

            //ブレーキ
            float brake = Input.GetAxisRaw(ConstString.Input.BRAKE);
            //下矢印キーでブレーキ。ハンコンでは01で取得するため符号反転してる
            brake = -Mathf.Clamp(brake, -1.0f, 0.0f);
            mBrake.SetValueAndForceNotify(brake);
        }).AddTo(gameObject);
    }
예제 #2
0
    private void Awake()
    {
        mGearManager = new MacGearManager(FindObjectOfType <VehicleCore>());

        this.UpdateAsObservable()
        .Subscribe(_ =>
        {
            //アクセル
            float accel = Input.GetAxis(ConstString.Input.VERTICAL);
            accel       = Mathf.Clamp01(accel);
            mAccel.SetValueAndForceNotify(accel);

            //ハンドル
            mHundle.SetValueAndForceNotify(Input.GetAxis(ConstString.Input.HORIZONTAL));

            //ブレーキ
            float brake = Input.GetAxis(ConstString.Input.VERTICAL);
            //下矢印キーでブレーキ。ハンコンでは01で取得するため符号反転してる
            brake = -Mathf.Clamp(brake, -1.0f, 0.0f);
            mBrake.SetValueAndForceNotify(brake);

            //ギア
            mCurrentGear.Value = mGearManager.GetGear();
        });
    }
예제 #3
0
    // FUNCTIONS

    void Start()
    {
        currentState = GameStates.WALK;

        player      = GameObject.Find("Player").GetComponent <PlayerScript> ();
        gearManager = GameObject.FindObjectOfType <GearManager> ();
    }
예제 #4
0
파일: GameManager.cs 프로젝트: svinot/LJSM
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);

        roomGenerator = GetComponent <RoomGenerator>();

        levelGenerator = GetComponent <LevelGenerator>();

        mapController = GetComponent <MapController>();

        fightManager = GetComponent <FightManager>();

        gearManager = GetComponent <GearManager>();

        statManager = GetComponent <StatManager>();

        InitGame();
    }
예제 #5
0
    // FUNCTIONS

    // Use this for initialization
    void Start()
    {
        rb = gameObject.GetComponent <Rigidbody> ();
        // gear = GameObject.FindObjectOfType<GearScript> ();
        gameManager = GameObject.FindObjectOfType <GameManager> ();
        gearManager = GameObject.FindObjectOfType <GearManager> ();
        tileManager = GameObject.FindObjectOfType <TileManager> ();
    }
예제 #6
0
    // Use this for initialization
    void Start()
    {
        radius = transform.FindChild("Gear Mesh").renderer.bounds.size.x;

        if (gameObject.activeSelf)
        {
            GearManager.Instance().AddGear(this);
        }
    }
예제 #7
0
    public static GearManager Instance()
    {
        if (instance == null)
        {
            instance = GameObject.Find("GameManager").GetComponent <GearManager>();
        }

        return(instance);
    }
예제 #8
0
 void Start()
 {
     Screen.orientation = ScreenOrientation.LandscapeLeft;
     gearManager        = gear.GetComponent <GearManager>();
     gasPedalSlider     = gasPedal.GetComponent <Slider>();
     breakPedalSlider   = breakPedal.GetComponent <Slider>();
     clutchPedalSlider  = clutchPedal.GetComponent <Slider>();
     Reset();
 }
예제 #9
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     gears      = new List <Gear>();
     driveGears = new List <Gear>();
     SetGearSettings();
 }
예제 #10
0
 public void OnHotReload(int id)
 {
     GearManager.Current.m_offlineSetupDone = false;
     this.CleanGearIcons();
     this.CleanGearSlots();
     GearManager.Current.SetupGearContainers(); //Re-initialize most data parameters
     this.LoadOfflineGearDatas();
     GearManager.GenerateAllGearIcons();
     GearManager.Current.m_offlineSetupDone = true;
     Log.Verbose("Reloaded Gear");
 }
예제 #11
0
    void OnTriggerExit(Collider collider)
    {
        // print("Exit trigger with " + collider.transform.name);

        Gear otherGear = collider.GetComponentInParent <Gear> ();

        if (!otherGear)
        {
            return;
        }

        GearManager.Instance().DisconnectGears(this, otherGear);
    }
예제 #12
0
    // FUNCTIONS


    void Start()
    {
        audioManager = GameObject.Find("AudioManager").GetComponent <AudioManager> ();
        gearManager  = GameObject.FindObjectOfType <GearManager> ();

        for (int i = 0; i < gearManager.gearArray.Length; i++)
        {
            if (gameObject.name == gearManager.gearArray[i].name)
            {
                gearNumber = i;
            }
        }
    }
예제 #13
0
    // Use this for initialization
    void Start()
    {
        money_manager = GameObject.Find("UI").GetComponent <MoneyManager>();
        gear_manager  = GameObject.Find("Environment").GetComponent <GearManager>();
        deceleration  = money_manager.deceleration;
        gear_pos      = (Vector2)Camera.main.WorldToScreenPoint(transform.position);
        Rigidbody2D rb = GetComponent <Rigidbody2D>();

        rb.centerOfMass = Vector2.zero;
        rb.inertia      = 0f;

        if (name == "gear0")
        {
            UpdateDistances();
        }
    }
예제 #14
0
    void Start()
    {
        camera             = GetComponent <Camera>();
        fpCameraController = GetComponent <FramePuzzle_ChangeCam>();

        FramelayerMask = (1 << LayerMask.NameToLayer("FramePuzzle"));
        GearlayerMask  = 1 << LayerMask.NameToLayer("Gear");

        //gearManager_script = GameObject.FindObjectOfType(typeof(GearManager)); //X
        gearManager_script = GameObject.FindObjectOfType <GearManager>();

        //subtitle_script = GameObject.FindObjectOfType<Subtitle_Controller>();
        puzzleEnter_script = GameObject.FindObjectOfType <FramePuzzle_Enter>();

        _drawer_script = GameObject.FindObjectOfType <Drawer_FP>();
    }
예제 #15
0
        /// <summary>
        /// The Code which will Randomize your Weapon Layout
        /// </summary>
        public void RandomizeCurrentWeapons()
        {
            GearIDRange[]   standardWeapons = GearManager.GetAllGearForSlot(InventorySlot.GearStandard);
            GearIDRange[]   specialWeapons  = GearManager.GetAllGearForSlot(InventorySlot.GearSpecial);
            PlayerDataBlock playerDataBlock = GameDataBlockBase <PlayerDataBlock> .GetBlock(1U);

            int standardArrayIndex = _random.Next(0, standardWeapons.Length);
            int specialArrayIndex  = _random.Next(0, specialWeapons.Length);

            var currentAmmoInStandard = PlayerBackpackManager.LocalBackpack.AmmoStorage.StandardAmmo.AmmoInPack;
            var currentAmmoInSpecial  = PlayerBackpackManager.LocalBackpack.AmmoStorage.SpecialAmmo.AmmoInPack;

            PlayerBackpackManager.LocalBackpack.AmmoStorage.SetAmmo(AmmoType.Standard, 0f);
            PlayerBackpackManager.LocalBackpack.AmmoStorage.SetAmmo(AmmoType.Special, 0f);

            PlayerBackpackManager.EquipLocalGear(standardWeapons[standardArrayIndex]);
            LocalInventory.WieldedItem.SetCurrentClip(PlayerBackpackManager.LocalBackpack.AmmoStorage.GetClipBulletsFromPack(LocalInventory.m_wieldedItem.WeaponComp.GetCurrentClip(), LocalInventory.m_wieldedItem.AmmoType));

            PlayerBackpackManager.EquipLocalGear(specialWeapons[specialArrayIndex]);
            LocalInventory.WieldedItem.SetCurrentClip(PlayerBackpackManager.LocalBackpack.AmmoStorage.GetClipBulletsFromPack(LocalInventory.m_wieldedItem.WeaponComp.GetCurrentClip(), LocalInventory.m_wieldedItem.AmmoType));

            PlayerBackpackManager.LocalBackpack.AmmoStorage.m_hasMappedCMPageMapInventory = false;
            PlayerBackpackManager.LocalBackpack.AmmoStorage.m_cmPageMapInventory          = (PUI_Inventory)null;

            //Hardcoded +10 to recompensate the Fact, that the Magazine Ammunition is somehow Bugged
            //PlayerBackpackManager.LocalBackpack.AmmoStorage.StandardAmmo.AddAmmo(currentAmmoInStandard + 10);
            //PlayerBackpackManager.LocalBackpack.AmmoStorage.SpecialAmmo.AddAmmo(currentAmmoInSpecial + 10);

            PlayerManager.GetLocalPlayerAgent().GiveAmmoRel(1f, 1f, 0f);

            PlayerBackpackManager.LocalBackpack.AmmoStorage.UpdateAllAmmoUI();
            PlayerBackpackManager.LocalBackpack.AmmoStorage.NeedsSync = true;

            //PlayerBackpackManager.LocalBackpack.AmmoStorage.PickupAmmo(AmmoType.Standard, 40);
            //PlayerBackpackManager.LocalBackpack.AmmoStorage.SetClipAmmoInSlot(InventorySlot.GearStandard);

            //PlayerBackpackManager.LocalBackpack.AmmoStorage.UpdateAmmoInPack(AmmoType.Special, 20);
            //PlayerBackpackManager.LocalBackpack.AmmoStorage.UpdateBulletsInPack(AmmoType.Special, 15);
            //PlayerBackpackManager.LocalBackpack.AmmoStorage.PickupAmmo(AmmoType.Special, 40);
            //PlayerBackpackManager.LocalBackpack.AmmoStorage.SetClipAmmoInSlot(InventorySlot.GearSpecial);

            PlayerBackpackManager.LocalBackpack.AmmoStorage.FillAllClips();
        }
예제 #16
0
 private void Awake()
 {
     self = this;
 }
예제 #17
0
 internal static void ResetCurrentBreakDown()
 {
     GearManager.DestroyGearObject(CurrentBreakDownReplacement?.gameObject);
     SetCurrentBreakDown(null);
 }
예제 #18
0
 public void RemoveFromScene()
 {
     gameObject.SetActive(false);
     GearManager.Instance().RemoveGear(this);
 }
예제 #19
0
 void Awake()
 {
     gearManager = gear.GetComponent <GearManager>();
 }