예제 #1
0
    // Use this for initialization
    void Start()
    {
        gfps      = this.transform.root.GetComponent <GravityFPSWalker> ();
        FOVinit   = worldCam.fieldOfView;
        FOVsprint = FOVinit + 5;
        animator  = transform.GetChild(0).GetComponent <Animator> ();

        interaction         = GameObject.Find("Canvas").transform.FindChild("Interaction").GetComponent <Text> ();
        myAudioSource       = GetComponent <AudioSource> ();
        myCameraAudioSource = transform.parent.GetComponent <AudioSource> ();

        //Hide all weapons that are not the starting one.
        if (weaponList == null)
        {
            weaponList = new List <Weapon>();
        }
        foreach (var w in weaponList)
        {
            if (w != null)
            {
                w.gameObject.SetActive(false);
            }
        }
        weaponIndex = 0;
        //weaponList[weaponIndex].gameObject.SetActive(true);
        ChangeWeapon();
    }
예제 #2
0
 void Start()
 {
     gfp        = GameObject.FindObjectOfType <GravityFPSWalker> ();
     DefaultPos = this.transform.localPosition;
     DefaultRot = this.transform.localRotation;
 }