private void Start() { cic = GameObject.FindGameObjectWithTag("CIC").GetComponent <CIC>(); weaponUI[0].SetActive(true); shipWeapon = cic.activeCICWeapon; }
// Use this for initialization void Start() { planeAnchorManager = planeAnchorManagerRef; debugText = debugTextRef; shipWeapons = shipWeaponsRef; UnityEngine.XR.iOS.UnityARUtility.InitializePlanePrefab(planePrefab); }
public void RemoveWeapons(ShipWeapons weapons) { if (this.currentWeapons == weapons) { this.currentWeapons = null; } }
// Аналогично; вызывается для сброса // переменной currentWeapons. public void RemoveWeapons(ShipWeapons weapons) { // Если currentWeapons ссылается на данный объект 'weapons', присвоить ей null. if (this.currentWeapons == weapons) { this.currentWeapons = null; } }
/// ------------------------------------------------------------------------------------------------------ /// <summary> /// Sets up the amount of ammo this gun has automatically from the ship stats. /// </summary> /// ------------------------------------------------------------------------------------------------------ private void AmmoSetup(ShipWeapons gun) { int _toGet = (int)gun; int[] _weaponStats = ship.GetWeaponAmmo(_toGet); maxAmmo = _weaponStats[0]; ammo = _weaponStats[1]; }
// Likewise; called to reset the currentWeapons variable. public void RemoveWeapons(ShipWeapons weapons) { // If the currentWeapons object is 'weapons', // set it to null. if (this.currentWeapons == weapons) { this.currentWeapons = null; } }
public void Update() { if (shipWeaponHandle == null) { ShipWeapons weaponSys = Ship.GetComponent <ShipWeapons>(); shipWeaponHandle = weaponSys.weapons[weaponSys.CurrentWeapon]; } updateSkill(); }
private void ChangeActiveWeaponUI() { int _pos = (int)cic.activeCICWeapon; int _lastPos = (int)shipWeapon; weaponUI[_pos].SetActive(true); weaponUI[_lastPos].SetActive(false); shipWeapon = cic.activeCICWeapon; }
// Аналогично вызывается для сброса переменной currentWeapons. public void RemoveWeapons(ShipWeapons weapons) { Debug.Log("метод RemoveWeapons"); // Если currentWeapons ссылается на данный объект 'weapons', присвоить ей null. if (this.currentWeapons == weapons) { Debug.Log("currentWeapons ссылается на данный объект 'weapons', присвоить ей null. "); this.currentWeapons = null; } }
// Use this for initialization void Start() { planeAnchorManager = planeAnchorManagerRef; debugText = debugTextRef; shipWeapons = shipWeaponsRef; crosshair = crosshairRef; featuresVisualizer = featuresVisualizerRef; onionLocationHelper = onionLocationHelperRef; UnityEngine.XR.iOS.UnityARUtility.InitializePlanePrefab(planePrefab); }
void Awake() { sails = GetComponentInChildren <Sails> (); rudder = GetComponentInChildren <Rudder> (); physics = GetComponentInChildren <BoatPhysics>(); rigidBody = GetComponent <Rigidbody> (); weapons = GetComponentInChildren <ShipWeapons>(); destination = transform.position; speedModifier = 1f; }
public void nextWeapon() { currentWeaponId++; if (currentWeaponId >= allWeapons.Count) { currentWeaponId = 0; } _currentWeapon.Unselect(); _currentWeapon = allWeapons[currentWeaponId]; _currentWeapon.Select(); InputManager.instance.SetWeapons(_currentWeapon); }
public void Awake() { allWeapons = new List <ShipWeapons>(); foreach (var obj in objWithWeapon) { allWeapons.Add(obj.GetComponent <ShipWeapons>()); } if (allWeapons.Count > 0) { _currentWeapon = allWeapons.ElementAt(currentWeaponId); } InputManager.instance.setArsenal(this); InputManager.instance.SetWeapons(_currentWeapon); }
void Awake() { instance = this; coreSystems = new ShipSystem[5]; shipPower = new ShipPower(); coreSystems[0] = shipPower; shipPropulsion = new ShipPropulsion(); coreSystems[1] = shipPropulsion; shipCargo = new ShipCargoHolds(GetComponent <InventoryUI>()); coreSystems[2] = shipCargo; shipWeapons = new ShipWeapons(); coreSystems[3] = shipWeapons; shipNavigation = new ShipNavigation(); coreSystems[4] = shipNavigation; Debug.Log("Systems initalized!"); shipMode = ShipMode.OFF; }
public void Start() { // Update distances distFront *= range; distNear *= range; distMin *= range; //targetery = Instantiate(targetery, transform.position, transform.rotation) as GameObject; //targeter = targetery.GetComponent<Targeter>(); searchTarget = new GameObject("searchTarget"); skillsRef = gameObject.GetComponent<SkillSet>(); weaponsRef = gameObject.GetComponent<ShipWeapons>(); if(skillsRef == null) { Debug.Log("FAIL"); } UnlockAi(); }
public void Start() { // Update distances distFront *= range; distNear *= range; distMin *= range; //targetery = Instantiate(targetery, transform.position, transform.rotation) as GameObject; //targeter = targetery.GetComponent<Targeter>(); searchTarget = new GameObject("searchTarget"); skillsRef = gameObject.GetComponent <SkillSet>(); weaponsRef = gameObject.GetComponent <ShipWeapons>(); if (skillsRef == null) { Debug.Log("FAIL"); } UnlockAi(); }
public void spawnNewPlayer() { Transform spawn = respawns[Random.Range(0, this.respawns.Length)].transform; this.movingLeft = false; this.movingRight = false; this.movingFront = false; this.movingBack = false; this.barrelLeft = false; this.barrelRight = false; this.ship = Network.Instantiate(shipPrefab, spawn.position, spawn.rotation, 0) as GameObject; //this.ship.rigidbody.interpolation = RigidbodyInterpolation.Interpolate; // use this if add velocity in Update and not in Fixed update this.camScript.setTarget(this.ship.transform); this.camScriptCrossHair.setTarget(this.ship.transform); this.shipMovementsScript = ship.GetComponent <ShipMovements>(); this.shipWeaponsScript = ship.GetComponent <ShipWeapons>(); this.shipCrosshairScript = ship.GetComponent <ShipCrosshair>(); this.camScript.resetZoom(); this.camScriptCrossHair.resetZoom(); this.scriptUI.setScriptLife(ship.GetComponent <shipLife>()); this.scriptUI.setScriptWeapons(ship.GetComponent <ShipWeapons>()); this.scriptUI.setScriptMovements(this.shipMovementsScript); }
public void SetWeapons(ShipWeapons weapons) { this.currentWeapons = weapons; }
public void setScriptWeapons(ShipWeapons script) { this.shipWeaponsScript = script; }
void Start() { rudder = GetComponentInChildren <Rudder>(); sails = GetComponentInChildren <Sails>(); weapons = GetComponent <ShipWeapons>(); }
void Start() { movementController = gameObject.GetComponent <Movement>(); weaponController = gameObject.GetComponent <ShipWeapons>(); }
// Вызывается сценарием ShipWeapons для обновления переменной currentWeapons. public void SetWeapons(ShipWeapons weapons) { Debug.Log("сценарий weapons" + currentWeapons); this.currentWeapons = weapons; }
/// <summary> /// Changes the active ship weapon /// </summary> /// <param name="weapon">ShipWeapon | Weapon to change to.</param> public void ChangeCICWeapon(int weapon) { activeCICWeapon = (ShipWeapons)weapon; }