示例#1
0
    void Start()
    {
        mcc    = GetComponentInParent <Motorcycle_Controller>();
        finish = false;


        //ignoring collision between biker's bodytrigger and motorcycle body
        Physics.IgnoreCollision(GetComponent <Collider>(), mcc.body.GetComponent <Collider>());

        //add new audio sources and add audio clips to them, used to play sounds
        bonesCrackSC = gameObject.AddComponent <AudioSource>();
        hitSC        = gameObject.AddComponent <AudioSource>();
        oohCrowdSC   = gameObject.AddComponent <AudioSource>();

        bonesCrackSC.playOnAwake = false;
        hitSC.playOnAwake        = false;
        oohCrowdSC.playOnAwake   = false;

        bonesCrackSC.rolloffMode = AudioRolloffMode.Linear;
        hitSC.rolloffMode        = AudioRolloffMode.Linear;
        oohCrowdSC.rolloffMode   = AudioRolloffMode.Linear;

        bonesCrackSC.clip = bonesCrackSound;
        hitSC.clip        = hitSound;
        oohCrowdSC.clip   = oohCrowdSound;
        //--------------------------------------------------
    }
示例#2
0
    public void InitRagdoll()
    {
        Motorcycle_Controller mcc = GetComponentInParent <Motorcycle_Controller>();

        mcc.hips      = hips;
        mcc.leftHand  = leftHand;
        mcc.rightHand = rightHand;
        mcc.leftFoot  = leftFoot;
        mcc.rightFoot = rightFoot;

        leftHand.connectedBody  = mcc.body;
        rightHand.connectedBody = mcc.body;
        leftFoot.connectedBody  = mcc.body;
        rightFoot.connectedBody = mcc.body;
        hips.connectedBody      = mcc.body;
    }
示例#3
0
    private void Start()
    {
        ragId = new string[5] {
            "1001", "1001", "1001", "1001", "1001"
        };
        pv  = GetComponent <PhotonView>();
        mcc = GetComponent <Motorcycle_Controller>();

        if (PhotonRoom.room == null || pv.IsMine)
        {
            //FindObjectOfType<SmoothFollow>().target = transform;
            //FindObjectOfType<MotoUiGameplay>().mcc = GetComponent<Motorcycle_Controller>();
        }
        else
        {
            mcc.rearWheel.GetComponent <SphereCollider>().material = null;
        }

        if (nameText)
        {
            nameText.text = pv.Owner.NickName;
        }

        //if (PhotonRoom.room != null)
        //{
        //    cpt = pv.Owner.CustomProperties;
        //    ragId[0] = cpt["Body"].ToString();
        //    ragId[1] = cpt["Helmet"].ToString();
        //    ragId[2] = cpt["Suit"].ToString();
        //    ragId[3] = cpt["Gloves"].ToString();
        //    ragId[4] = cpt["Boots"].ToString();
        //}
        //else
        //{
        //    ragId[0] = PlayerPrefs.GetString("Body");
        //    ragId[1] = PlayerPrefs.GetString("Helmet");
        //    ragId[2] = PlayerPrefs.GetString("Suit");
        //    ragId[3] = PlayerPrefs.GetString("Gloves");
        //    ragId[4] = PlayerPrefs.GetString("Boots");
        //}
        SetupBike();
        CreateRagdoll();
    }
示例#4
0
 private void Start()
 {
     mcc            = GetComponentInParent <Motorcycle_Controller>();
     mcc.accelerate = true;
 }