public void StopShooting()
 {
     activeAnimShootWeapon.ResetAnims();
     unitSkeleton.ReplaceAllBodyPartsInAnimation(activeAnimShootWeapon);
     isShooting = false;
     SetActive();
     SetAimTarget(aimTargetPosition);
 }
Esempio n. 2
0
    public void Shoot(Vector3 shootTargetPosition, Action onShootCompleted)
    {
        SetAimTarget(shootTargetPosition);

        Action <V_Skeleton_Anim> shootCompleted = (V_Skeleton_Anim skeletonAnim) => {
            isShooting = false;
            unitSkeleton.ReplaceAllBodyPartsInAnimation(activeAnimAimWeaponRight);
            onShootCompleted();
        };

        activeAnimShootWeaponRight.ResetAnims();
        activeAnimShootWeaponRight.GetAnims()[0].onAnimComplete = shootCompleted;
        unitSkeleton.ReplaceAllBodyPartsInAnimation(activeAnimShootWeaponRight);
        isShooting = true;
    }
Esempio n. 3
0
    public void Reload(Vector3 aimTargetPosition, Action onReloadCompleted)
    {
        SetAimTarget(aimTargetPosition);
        Action <V_Skeleton_Anim> reloadCompleted = (V_Skeleton_Anim skeletonAnim) => {
            isReloading = false;
            activeAnimAimWeaponReload.GetAnims()[0].onAnimComplete = null;
            //CodeMonkey.CMDebug.TextPopupMouse("reload");
            onReloadCompleted();
        };

        isReloading = true;
        activeAnimAimWeaponReload.ResetAnims();
        activeAnimAimWeaponReload.GetAnims()[0].onAnimComplete = reloadCompleted;
        unitSkeleton.ReplaceAllBodyPartsInAnimation(activeAnimAimWeaponReload);
    }