Exemplo n.º 1
0
    void Awake()
    {
        up       = KeyCode.W;
        down     = KeyCode.S;
        left     = KeyCode.A;
        right    = KeyCode.D;
        jump     = KeyCode.Space;
        interact = KeyCode.F;
        //book = KeyCode.Tab;
        run    = KeyCode.LeftShift;
        crouch = KeyCode.C;

        rb         = GetComponent <Rigidbody> ();
        fpscam     = transform.FindChild("Camera");
        canjump    = true;
        hands      = GetComponent <Hands> ();
        hands.ctrl = this;
        //uwater = fpscam.GetComponent<Underwater> ();
        questbook = GameObject.Find("questbook");
        if (questbook)
        {
            questbook.SetActive(false);
        }
        inbook  = false;
        camobj  = fpscam.GetComponent <FPSCam> ();
        loadout = transform.FindChild("loadout");
        //equip fists
        rfist = loadout.FindChild("fist").gameObject;
        lfist = loadout.FindChild("fistalt").gameObject;
        hands.equip(true, rfist.transform);
        hands.equip(false, lfist.transform);
        defspd  = spd;
        capsule = transform.FindChild("Capsule");
    }
Exemplo n.º 2
0
 public override void Initialize()
 {
     this.lightDirection     = new Vector3(0, 1, 0);
     this.fpsCam             = new FPSCam(this.form.ClientSize.Width, this.form.ClientSize.Height);
     this.orenNayarRoughness = 0.5f;
     this.ColorObject        = new Vector4(1.0f, 0, 0, 1.0f);
     base.Initialize();
 }
Exemplo n.º 3
0
 void Awake()
 {
     oCamera = Camera.main.GetComponent<FPSCam>();
     oWorld = GameObject.Find("GameController").GetComponent<World>();
 }