コード例 #1
0
ファイル: PlayerHand.cs プロジェクト: ZhouDavid/FlyingCar
    void gestureKIKOHO(float strength)
    {
        if (kikohoTime > 3f)
        {
            kikohoTime = 0f;
            if (kikohoInstance != null)
            {
                Destroy(kikohoInstance);
                kikohoInstance = null;
            }
            GameObject kikoho = Instantiate(kikohoWave);
            HandWave   script = kikoho.GetComponent <HandWave>();

            script.name = "KIKOHO";
            kikoho.transform.position = handController.transform.TransformPoint(((leftHand.PalmPosition + rightHand.PalmPosition) / 2).ToUnityScaled(false));
            script.direction          = (kikoho.transform.position - Camera.main.transform.position).normalized;//handController.transform.TransformDirection((leftHand.Arm.Direction.ToUnity() + rightHand.Arm.Direction.ToUnity()).normalized);
            script.speed = 25f;
            script.agile = 1f;
            script.value = strength;
        }
        else
        {
            kikohoTime += Time.deltaTime;
            if (kikohoInstance == null)
            {
                kikohoInstance = Instantiate(kikohoWaveSmall);
            }
            kikohoInstance.transform.position = handController.transform.TransformPoint(((leftHand.PalmPosition + rightHand.PalmPosition) / 2).ToUnityScaled(false));
        }
    }
コード例 #2
0
ファイル: PlayerHand.cs プロジェクト: ZhouDavid/FlyingCar
    void gestureKAME(float strength)
    {
        GameObject kame   = Instantiate(kameWave);
        HandWave   script = kame.GetComponent <HandWave>();

        script.name             = "KAME";
        kame.transform.position = handController.transform.TransformPoint(((leftHand.WristPosition + rightHand.WristPosition) / 2).ToUnityScaled(false));
        script.direction        = handController.transform.TransformDirection((leftHand.Arm.Direction.ToUnity() + rightHand.Arm.Direction.ToUnity()).normalized);
        script.speed            = 40f;
        script.agile            = 1f;
        script.value            = strength;
    }
コード例 #3
0
ファイル: PlayerHand.cs プロジェクト: ZhouDavid/FlyingCar
    void gestureSWAVE(bool isRight, float strength)
    {
        GameObject swave  = Instantiate(sWave);
        HandWave   script = swave.GetComponent <HandWave>();

        script.name = "SWAVE";
        if (isRight)
        {
            swave.transform.position = handController.transform.TransformPoint(rightIndex.TipPosition.ToUnityScaled(false));
            script.direction         = handController.transform.TransformDirection(rightIndex.Direction.ToUnity().normalized);
        }
        else
        {
            swave.transform.position = handController.transform.TransformPoint(leftIndex.TipPosition.ToUnityScaled(false));
            script.direction         = handController.transform.TransformDirection(leftIndex.Direction.ToUnity().normalized);
        }
        script.speed = 25f;
        script.agile = 5f;
        script.value = strength;
    }
コード例 #4
0
ファイル: PlayerHand.cs プロジェクト: ZhouDavid/FlyingCar
    void gestureSpin(float strength)
    {
        GameObject spin   = Instantiate(spinWave);
        HandWave   script = spin.GetComponent <HandWave>();

        script.name             = "SPIN";
        spin.transform.position = handController.transform.position;
        Vector dir = new Vector();

        if (leftHand != null)
        {
            dir += leftIndex.Direction;
        }
        if (rightHand != null)
        {
            dir += rightIndex.Direction;
        }
        script.direction = handController.transform.TransformDirection(dir.ToUnity().normalized);
        script.speed     = 100f;
        script.agile     = 100f;
        script.value     = strength;
    }
コード例 #5
0
ファイル: PlayerHand.cs プロジェクト: ZhouDavid/FlyingCar
    void gestureTHUNDER(float strength)
    {
        GameObject thunder = Instantiate(thunderWave);
        HandWave   script  = thunder.GetComponent <HandWave>();

        script.name = "THUNDER";
        thunder.transform.position = handController.transform.position;
        Vector dir = new Vector();

        if (leftHand != null)
        {
            dir += leftHand.Arm.Direction;
        }
        if (rightHand != null)
        {
            dir += rightHand.Arm.Direction;
        }
        script.direction = handController.transform.TransformDirection(dir.ToUnity().normalized);
        script.speed     = 100f;
        script.agile     = 100f;
        script.value     = strength;
    }