public void moveToNextNode(TeleportPad nextCheckpoint)
    {
        Vector3 posToPutPlayer = nextCheckpoint.transform.position;

        posToPutPlayer.y += 2.6f;
        gameObject.transform.position = posToPutPlayer;
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        StartCoroutine(OpenBlasterCase());
        TeleportScript = GameObject.Find("TeleportPadActor").GetComponent <TeleportPad>();
        // StartCoroutine(Test());
        //TeleportButton.GetComponent<MeshRenderer>().material.color = teleportNotReady;
        isLeversChangingScale = true;

        circlePanelmeshRend  = CirclePanel.GetComponent <MeshRenderer>();
        CirclePanelMat       = circlePanelmeshRend.material;
        CirclePanelMat.color = Color.gray;



        gameCircleMeshRend = GameCircle.GetComponent <MeshRenderer>();
        gameCircleMeshRend.material.color = Color.green;


        scaleInputNormalizer = new MathZ.ScalarNormalizer(0, 100, gameCircleXSizeMin, gameCircleXSizeMax);
        colorInputNormalizer = new MathZ.ScalarNormalizer(0, 100, 0, 1);
        TeleportButton.GetComponent <BoxCollider>().enabled = false;


        Reset();
    }
示例#3
0
    void TeleportPlayer()
    {
        // teleportPads list is 0 based so subtract one from nextTeleportPad
        int nextPadNum = nextTeleportPad - 1;

        // get the next teleport pad to teleport to
        TeleportPad pad = teleportPads[nextPadNum];

        float padYOffset = (player.transform.position.y - gameObject.transform.position.y);

        // calculate where to position the player on the next teleport pad
        Vector3 newPlayerPosition = new Vector3(pad.transform.position.x, pad.transform.position.y + padYOffset, pad.transform.position.z);

        player.transform.position = newPlayerPosition;
        teleportEntered           = false;
        teleportPads[nextPadNum].teleportEntered = true;
        teleportPads[nextPadNum].disableTimer    = 2;

        // clear key buffer so key is not triggered again
        Input.ResetInputAxes();

        //characterControl.rot = 200;
    }
示例#4
0
 void Start()
 {
     // Get the teleport script from the parent
     parentPad = transform.GetComponentInParent <TeleportPad>();
 }