示例#1
0
    // Use this for initialization
    void Start()
    {
        MG_Pin_Arms father = gameObject.transform.parent.GetComponent <MG_Pin_Arms>();

        grandfather = father.getFather();
        spawnPos    = gameObject.transform.position;
        rb          = gameObject.GetComponent <Rigidbody>();
        //Evite les rotations de l'objet indésirables.
        rb.constraints = RigidbodyConstraints.FreezeRotation;
        rs             = us = touch = false;
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        MG_Pin_Arms father = gameObject.transform.parent.GetComponent <MG_Pin_Arms>();

        baseYRotation = gameObject.transform.rotation.eulerAngles.y;
        pushForce     = basePushForce = 1000f;
        if (gameObject.name.CompareTo("LeftArm") == 0)
        {
            father.setLeftArm(gameObject.transform);
            boundX = gameObject.GetComponent <Renderer>().bounds.max.x;
        }
        else
        {
            if (gameObject.name.CompareTo("RightArm") == 0)
            {
                father.setRightArm(gameObject.transform);
                boundX = gameObject.GetComponent <Renderer>().bounds.min.x;
            }
        }
    }