Ejemplo n.º 1
0
    public void PlacingPlank()
    {
        //turn on collider
        this.gameObject.GetComponent <Collider>().enabled = true;

        //make trigger
        this.gameObject.GetComponent <Collider>().isTrigger = true;

        this.gameObject.GetComponent <Rigidbody>().isKinematic = true;

        //turn on artificial gravity
        snapRef.GravitySwitch(true);

        //make rotation -5 on z axis
        Vector3 tempEuler = this.gameObject.transform.localEulerAngles;

        tempEuler.z = -5f;
        this.gameObject.transform.localEulerAngles = tempEuler;

        //unparent
        if (this.gameObject.transform.parent != null)
        {
            //unparent
            this.gameObject.transform.parent = null;
        }

        plankState = PlankState.beingplaced;
    }
Ejemplo n.º 2
0
    public void PlacingPlank()
    {
        print(this.gameObject + " Placing");

        //don't let plank hit players
        SetToNotHitPlayers();

        //turn on artificial gravity
        snapRef.GravitySwitch(true);

        //turn on collider
        this.gameObject.GetComponent <Collider>().enabled = true;

        //make trigger
        this.gameObject.GetComponent <Collider>().isTrigger = true;

        //reduce size of collider
        //make collider full sized
        this.gameObject.GetComponent <BoxCollider>().size   = new Vector3(0.308f, 1, 1);
        this.gameObject.GetComponent <BoxCollider>().center = new Vector3(0.345f, 0, 0);

        this.gameObject.GetComponent <Rigidbody>().isKinematic = true;

        //unparent
        if (this.gameObject.transform.parent != null)
        {
            //unparent
            this.gameObject.transform.parent = null;
        }

        plankState = PlankState.beingplaced;
    }