示例#1
0
    void Update()
    {
        RightSpellController.UpdateHandState(RightController);
        LeftSpellController.UpdateHandState(LeftController);
        //RightSpellController.HandState = CheckHandPowerState(RightController);
        //LeftSpellController.HandState = CheckHandPowerState(LeftController);


        //if (_currentSpell == Spell.None && RightSpellController.HandState == HandState.Fire && LeftSpellController.HandState == HandState.Fire) {
        //    if (RightSpellController.FirePercentageCharged >= 1.0f && LeftSpellController.FirePercentageCharged >= 1.0f) {
        //        if (RightController.CurrentGesture == HandGesture.Open && LeftController.CurrentGesture == HandGesture.Open) {
        //            _currentSpell = Spell.Fireball;
        //            castingSpell = true;
        //            SpawnFireball();
        //        }
        //    }
        //}

        //if (_currentSpell == Spell.Fireball) {
        //    if (RightSpellController.TargetHandState != HandState.Fire && LeftSpellController.TargetHandState != HandState.Fire) {
        //        Vector3 velocity = RightController.Velocity * RightSpellController.FirePercentageCharged + LeftController.Velocity * LeftSpellController.FirePercentageCharged;
        //        velocity /= RightSpellController.FirePercentageCharged + LeftSpellController.FirePercentageCharged;

        //        _castFireball.Create(velocity);
        //        _currentSpell = Spell.None;
        //    }
        //    else {
        //        CastFireball();
        //    }
        //}
    }