コード例 #1
0
 // Use this for initialization
 void Start()
 {
     rb = GetComponent <Rigidbody> ();
     cameraTransform  = Camera.main.transform;
     switchGun        = GetComponent <SwitchGun> ();
     Cursor.lockState = CursorLockMode.Locked;
     gravityDir       = -transform.up;
 }
コード例 #2
0
    public void SwitchButtonClicked()
    {
        GameObject _turretGameObj   = EventSystem.current.currentSelectedGameObject.transform.parent.parent.parent.gameObject;
        SwitchGun  _switchGunScript = GameObject.FindGameObjectWithTag("Player").GetComponent <SwitchGun>();

        _switchGunScript._selectedGun = _turretGameObj.GetComponent <Turret>()._guns[0];
        _switchGunScript.SwitchButtonClicked();
        _turretGameObj.GetComponent <ClickOnTurret>()._switchGunsButton.gameObject.SetActive(false);
    }
コード例 #3
0
ファイル: Weapon.cs プロジェクト: Th3Alon3/GKLScripts
 void Start()
 {
     ammoui2              = GetComponent <AmmoCountUI2>();
     ammoui               = GetComponent <AmmoCountUI>();
     switchGun            = GetComponent <SwitchGun>();
     pistolScript         = GetComponent <PistolAndroid>();
     rifle                = GetComponent <RifleAndroid>();
     fivereload.enabled   = true;
     fiveshot.enabled     = true;
     pistolScript.enabled = true;
     ammoui.enabled       = true;
     text1.SetActive(true);
 }