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); }
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(); }); }
// FUNCTIONS void Start() { currentState = GameStates.WALK; player = GameObject.Find("Player").GetComponent <PlayerScript> (); gearManager = GameObject.FindObjectOfType <GearManager> (); }
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(); }
// 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> (); }
// Use this for initialization void Start() { radius = transform.FindChild("Gear Mesh").renderer.bounds.size.x; if (gameObject.activeSelf) { GearManager.Instance().AddGear(this); } }
public static GearManager Instance() { if (instance == null) { instance = GameObject.Find("GameManager").GetComponent <GearManager>(); } return(instance); }
void Start() { Screen.orientation = ScreenOrientation.LandscapeLeft; gearManager = gear.GetComponent <GearManager>(); gasPedalSlider = gasPedal.GetComponent <Slider>(); breakPedalSlider = breakPedal.GetComponent <Slider>(); clutchPedalSlider = clutchPedal.GetComponent <Slider>(); Reset(); }
void Awake() { if (instance == null) { instance = this; } gears = new List <Gear>(); driveGears = new List <Gear>(); SetGearSettings(); }
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"); }
void OnTriggerExit(Collider collider) { // print("Exit trigger with " + collider.transform.name); Gear otherGear = collider.GetComponentInParent <Gear> (); if (!otherGear) { return; } GearManager.Instance().DisconnectGears(this, otherGear); }
// 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; } } }
// 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(); } }
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>(); }
/// <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(); }
private void Awake() { self = this; }
internal static void ResetCurrentBreakDown() { GearManager.DestroyGearObject(CurrentBreakDownReplacement?.gameObject); SetCurrentBreakDown(null); }
public void RemoveFromScene() { gameObject.SetActive(false); GearManager.Instance().RemoveGear(this); }
void Awake() { gearManager = gear.GetComponent <GearManager>(); }