Exemple #1
0
    //Executes snapping to place
    private void snapToUnit()
    {
        //Fix position of cube to selected unit
        player.position = selected.bounds.center;
        selected.SendMessage("deselectUnit");
        GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezePosition | RigidbodyConstraints.FreezeRotation;
        activePlayer = false;

        snap.Play();
        //Send a message to your dispenser
        curDisp.SendMessage("dispense");
        Destroy(this);
    }