예제 #1
0
    /* static int rowState = Animator.StringToHash("Base Layer.Row");
    static int gyroState = Animator.StringToHash("Base Layer.Gyro");
    TODO: implement at a later date 2015-04-02
    */
    //------------------------------------------------------------------------------------------------------------------------------------------------------------------
    // Functions
    //------------------------------------------------------------------------------------------------------------------------------------------------------------------
    void Start()
    {
        playerRobot = GameObject.Find ("PlayerRobot");
        peAccessor = playerRobot.GetComponent<PlayerEnergy>();
        playerMover = playerRobot.GetComponent<SWS.PlayerSplineMove> ();
        gestureManager = GameObject.Find ("GestureManager").GetComponent<GestureManager>();
        oldPosX = playerRobot.transform.position.x;
        oldPosZ = playerRobot.transform.position.z;
        moveSpeed = 0.0f;

        //initialising reference variables
        anim = GetComponent<Animator> ();
        if (anim.layerCount == 2) {
            anim.SetLayerWeight (1, 1);
        }

        switch (Application.loadedLevel){
        case 0:
            playerMover.events[1].AddListener(delegate{pauseMovement(4f); GameObject.Find ("MainCamera").GetComponent<ThirdPersonCamera>().callDoorZoom();});
            break;
        case 1:
            playerMover.startPoint = 0;
            playerMover.SetPath(WaypointManager.Paths["Level02_Room01_Path01"]);
            playerMover.speed = 5.5f;
            playerMover.lockRotation = AxisConstraint.X;

            anim.SetBool("IsWalking", true);
            playerMover.StartMove();

            playerMover.events[3].AddListener(delegate() {pauseMovement(.8f); callJumping();});
            playerMover.events[4].AddListener(delegate() {pauseMovement(1.5f);});
            playerMover.events[5].AddListener(delegate() {callRowing (); stopMovement(.7f);});
            break;
        case 2:

            break;
        default:
            return;
        }
    }
예제 #2
0
    void Start()
    {
        // initialising references
        if (GameObject.Find ("MainCamera")) {
            Destroy(GameObject.Find ("DebugCamera"));
        }
        standardPos = GameObject.Find ("CamPos").transform;
        playerRobot = GameObject.Find ("PlayerRobot");
        playerMover = playerRobot.GetComponent<PlayerSplineMove> ();
        pcAccessor = playerRobot.GetComponent<PlayerController> ();

        standardSmoothValue = 2.25f;

        switch (Application.loadedLevel) {

        case 0:
            break;
        case 1:
            setIntroSmoothingVariables(true, 0.95f, 13.5f);
            break;
        case 2:
            break;
        }
    }