Inheritance: MonoBehaviour
コード例 #1
0
        private void Start()
        {
            cic = GameObject.FindGameObjectWithTag("CIC").GetComponent <CIC>();

            weaponUI[0].SetActive(true);
            shipWeapon = cic.activeCICWeapon;
        }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     planeAnchorManager = planeAnchorManagerRef;
     debugText          = debugTextRef;
     shipWeapons        = shipWeaponsRef;
     UnityEngine.XR.iOS.UnityARUtility.InitializePlanePrefab(planePrefab);
 }
コード例 #3
0
 public void RemoveWeapons(ShipWeapons weapons)
 {
     if (this.currentWeapons == weapons)
     {
         this.currentWeapons = null;
     }
 }
コード例 #4
0
ファイル: InputManager.cs プロジェクト: kpblcke/Rockfall
 // Аналогично; вызывается для сброса
 // переменной currentWeapons.
 public void RemoveWeapons(ShipWeapons weapons)
 {
     // Если currentWeapons ссылается на данный объект 'weapons', присвоить ей null.
     if (this.currentWeapons == weapons)
     {
         this.currentWeapons = null;
     }
 }
コード例 #5
0
        /// ------------------------------------------------------------------------------------------------------
        /// <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];
        }
コード例 #6
0
 // 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;
     }
 }
コード例 #7
0
 public void Update()
 {
     if (shipWeaponHandle == null)
     {
         ShipWeapons weaponSys = Ship.GetComponent <ShipWeapons>();
         shipWeaponHandle = weaponSys.weapons[weaponSys.CurrentWeapon];
     }
     updateSkill();
 }
コード例 #8
0
        private void ChangeActiveWeaponUI()
        {
            int _pos     = (int)cic.activeCICWeapon;
            int _lastPos = (int)shipWeapon;

            weaponUI[_pos].SetActive(true);
            weaponUI[_lastPos].SetActive(false);
            shipWeapon = cic.activeCICWeapon;
        }
コード例 #9
0
 // Аналогично вызывается для сброса переменной currentWeapons.
 public void RemoveWeapons(ShipWeapons weapons)
 {
     Debug.Log("метод RemoveWeapons");
     // Если currentWeapons ссылается на данный объект 'weapons', присвоить ей null.
     if (this.currentWeapons == weapons)
     {
         Debug.Log("currentWeapons ссылается на данный объект 'weapons', присвоить ей null. ");
         this.currentWeapons = null;
     }
 }
コード例 #10
0
ファイル: CC.cs プロジェクト: vannorman/coffeecommand
    // Use this for initialization
    void Start()
    {
        planeAnchorManager  = planeAnchorManagerRef;
        debugText           = debugTextRef;
        shipWeapons         = shipWeaponsRef;
        crosshair           = crosshairRef;
        featuresVisualizer  = featuresVisualizerRef;
        onionLocationHelper = onionLocationHelperRef;

        UnityEngine.XR.iOS.UnityARUtility.InitializePlanePrefab(planePrefab);
    }
コード例 #11
0
    void Awake()
    {
        sails     = GetComponentInChildren <Sails> ();
        rudder    = GetComponentInChildren <Rudder> ();
        physics   = GetComponentInChildren <BoatPhysics>();
        rigidBody = GetComponent <Rigidbody> ();
        weapons   = GetComponentInChildren <ShipWeapons>();

        destination = transform.position;

        speedModifier = 1f;
    }
コード例 #12
0
ファイル: ShipArsenal.cs プロジェクト: kpblcke/Rockfall
 public void nextWeapon()
 {
     currentWeaponId++;
     if (currentWeaponId >= allWeapons.Count)
     {
         currentWeaponId = 0;
     }
     _currentWeapon.Unselect();
     _currentWeapon = allWeapons[currentWeaponId];
     _currentWeapon.Select();
     InputManager.instance.SetWeapons(_currentWeapon);
 }
コード例 #13
0
ファイル: ShipArsenal.cs プロジェクト: kpblcke/Rockfall
 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);
 }
コード例 #14
0
ファイル: ShipManager.cs プロジェクト: cesarrac/WeeklyJam-23
 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;
 }
コード例 #15
0
ファイル: AIMovement.cs プロジェクト: kyranitar/gaf
    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();
    }
コード例 #16
0
ファイル: AIMovement.cs プロジェクト: kyranitar/gaf
    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();
    }
コード例 #17
0
    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);
    }
コード例 #18
0
 public void SetWeapons(ShipWeapons weapons)
 {
     this.currentWeapons = weapons;
 }
コード例 #19
0
ファイル: ShipUI.cs プロジェクト: Frolanta/FlyingShipProject
 public void setScriptWeapons(ShipWeapons script)
 {
     this.shipWeaponsScript = script;
 }
コード例 #20
0
 void Start()
 {
     rudder  = GetComponentInChildren <Rudder>();
     sails   = GetComponentInChildren <Sails>();
     weapons = GetComponent <ShipWeapons>();
 }
コード例 #21
0
 void Start()
 {
     movementController = gameObject.GetComponent <Movement>();
     weaponController   = gameObject.GetComponent <ShipWeapons>();
 }
コード例 #22
0
 // Вызывается сценарием ShipWeapons для обновления переменной currentWeapons.
 public void SetWeapons(ShipWeapons weapons)
 {
     Debug.Log("сценарий weapons" + currentWeapons);
     this.currentWeapons = weapons;
 }
コード例 #23
0
ファイル: CIC.cs プロジェクト: CarterGames/CWIS
 /// <summary>
 /// Changes the active ship weapon
 /// </summary>
 /// <param name="weapon">ShipWeapon | Weapon to change to.</param>
 public void ChangeCICWeapon(int weapon)
 {
     activeCICWeapon = (ShipWeapons)weapon;
 }