示例#1
0
        protected override void Awake()
        {
            instance = this;

            base.Awake();

            cam   = GetComponentInChildren <Camera>().transform;
            pivot = cam.parent.parent; //take the correct pivot
        }
示例#2
0
        // Use this for initialization
        void Start()
        {
            crosshairManager = CrosshairManager.GetInstance();
            //Debug.Log(crosshairManager.activeCrosshair);
            crosshair = crosshairManager.activeCrosshair.GetComponent <Crosshair>();

            camProperties = FreeCameraLook.GetInstance();
            camPivot      = camProperties.transform.GetChild(0);
            camTrans      = camPivot.GetChild(0);
            shakeCam      = camPivot.GetComponentInChildren <ShakeCamera>();

            states = GetComponent <StateManager>();

            shotLayerMask = ~(1 << gameObject.layer |
                              1 << LayerMask.NameToLayer("Enclos") |
                              1 << LayerMask.NameToLayer("Wolf") |
                              1 << LayerMask.NameToLayer("Leurre") |
                              1 << LayerMask.NameToLayer("Trap") |
                              1 << LayerMask.NameToLayer("ignoreLayer"));
            shotLayerMask        = shotLayerMask & ~(1 << LayerMask.NameToLayer("Default"));
            states.shotLayerMask = shotLayerMask;

            camLayerMask = ~(1 << gameObject.layer |
                             1 << LayerMask.NameToLayer("Terrain") |
                             1 << LayerMask.NameToLayer("Wolf") |
                             1 << LayerMask.NameToLayer("Leurre") |
                             1 << LayerMask.NameToLayer("Trap") |
                             1 << LayerMask.NameToLayer("ignoreLayer"));

            fenceCollision = false;

            gameObject.AddComponent <HandleMovement_Player>();
            hMove  = GetComponent <HandleMovement_Player>();
            player = GetComponent <Player>();

            states.isPlayer = true;
            states.Init();
            hMove.Init(states, this);
            player.Init();

            FixPlayerMeshes();
        }