Example #1
0
    void ShotFireLeft()
    {
        Debug.Log("ShotFireLeft");
        float x    = 1000 * (nowLeftHand.x - prevLeftHand.x);
        float y    = 1000 * (nowLeftHand.y - prevLeftHand.y);
        float z    = 1000 * (nowLeftHand.z - prevLeftHand.z);
        float dist = Vector3.Distance(nowLeftHand, prevLeftHand) * 1000;

        GameObject wildFire = (GameObject)Instantiate(WildFire, nowLeftHand, Quaternion.identity);

        wildFire.transform.parent = effect.transform;
        wildFire.name             = "leftShot";
        FireShot fireShot = wildFire.GetComponent <FireShot> ();

        fireShot.Force(x, y, z);

        Destroy(leftFire);
        leftFire = null;
    }