private void OnArrowFlightComplete(TargetAreas targetArea, Action onComplete, Transform arrow)
    {
        m_hitEffect.gameObject.transform.position = arrow.transform.position;
        m_hitEffect.Stop();
        m_hitEffect.Play();

        switch (targetArea)
        {
        case TargetAreas.Red:
            m_bullsEyeEffect.Stop();
            m_bullsEyeEffect.Play();
            m_animator.SetFloat(m_animationVariationFloatHash, Random.value);
            m_animator.SetTrigger(m_bullsEyeTriggerHash);
            arrow.SetParent(m_animator.transform);
            m_audioSource.PlayOneShot(m_redHitSound);
            break;

        case TargetAreas.Miss:
            m_arrowPool.ReturnArrowToPool(arrow);
            m_audioSource.PlayOneShot(m_missSound);
            break;

        default:
            m_animator.SetFloat(m_animationVariationFloatHash, Random.value);
            m_animator.SetTrigger(m_hitTriggerHash);
            m_audioSource.PlayOneShot(targetArea == TargetAreas.Green ? m_greenHitSound : m_yellowHitSound);
            arrow.SetParent(m_animator.transform);
            break;
        }

        StartCoroutine(ReportComplete(onComplete));
    }
    private Vector3 GetHitPosition(TargetAreas targetArea)
    {
        Vector3 hitPosition =
            Quaternion.AngleAxis(Random.Range(0f, 360f), m_targetCenter.forward)
            * m_targetCenter.up;

        hitPosition *= Random.Range(m_targetAreaZonesDict[targetArea].MinimalRadius, m_targetAreaZonesDict[targetArea].MaximalRadius);

        return(m_targetCenter.position + hitPosition);
    }
 public BarTimingZone(TargetAreas area)
 {
     m_targetArea = area;
 }
 public void ShootArrow(TargetAreas targetArea, Action onComplete)
 {
     m_arrowPool.ShootArrow(GetHitPosition(targetArea), targetArea != TargetAreas.Miss,
                            arrow => { OnArrowFlightComplete(targetArea, onComplete, arrow); });
 }
 public TargetAreaZone(TargetAreas area)
 {
     m_area = area;
 }
Exemple #6
0
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            //Other fields Validation
            if (!String.IsNullOrEmpty(SocialMedia))
            {
                SocialMedia = SocialMedia.Trim();
            }
            if (!String.IsNullOrEmpty(BusinessDescription))
            {
                BusinessDescription = BusinessDescription.Trim();
            }
            if (!String.IsNullOrEmpty(WebAddress))
            {
                WebAddress = WebAddress.Trim();
            }
            if (!String.IsNullOrEmpty(DomainLoginUrl))
            {
                DomainLoginUrl = DomainLoginUrl.Trim();
            }
            if (!String.IsNullOrEmpty(DomainUsername))
            {
                DomainUsername = DomainUsername.Trim();
            }
            if (!String.IsNullOrEmpty(DomainPassword))
            {
                DomainPassword = DomainPassword.Trim();
            }
            if (!String.IsNullOrEmpty(HostingLoginUrl))
            {
                HostingLoginUrl = HostingLoginUrl.Trim();
            }
            if (!String.IsNullOrEmpty(HostingUserName))
            {
                HostingUserName = HostingUserName.Trim();
            }
            if (!String.IsNullOrEmpty(HostingPassword))
            {
                HostingPassword = HostingPassword.Trim();
            }
            if (!String.IsNullOrEmpty(WpLoginUrl))
            {
                WpLoginUrl = WpLoginUrl.Trim();
            }
            if (!String.IsNullOrEmpty(WpUserName))
            {
                WpUserName = WpUserName.Trim();
            }
            if (!String.IsNullOrEmpty(WpPassword))
            {
                WpPassword = WpPassword.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleAnalyticsUrl))
            {
                GoogleAnalyticsUrl = GoogleAnalyticsUrl.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleAnalyticsUsername))
            {
                GoogleAnalyticsUsername = GoogleAnalyticsUsername.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleAnalyticsPassword))
            {
                GoogleAnalyticsPassword = GoogleAnalyticsPassword.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleSearchConsoleUrl))
            {
                GoogleSearchConsoleUrl = GoogleSearchConsoleUrl.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleSearchConsoleUsername))
            {
                GoogleSearchConsoleUsername = GoogleSearchConsoleUsername.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleSearchConsolePassword))
            {
                GoogleSearchConsolePassword = GoogleSearchConsolePassword.Trim();
            }
            if (!String.IsNullOrEmpty(BingWemasterToolsUrl))
            {
                BingWemasterToolsUrl = BingWemasterToolsUrl.Trim();
            }
            if (!String.IsNullOrEmpty(BingWemasterToolsUsername))
            {
                BingWemasterToolsUsername = BingWemasterToolsUsername.Trim();
            }
            if (!String.IsNullOrEmpty(BingWemasterToolsPassword))
            {
                BingWemasterToolsPassword = BingWemasterToolsPassword.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleMyBusinessUrl))
            {
                GoogleMyBusinessUrl = GoogleMyBusinessUrl.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleMyBusinessUsername))
            {
                GoogleMyBusinessUsername = GoogleMyBusinessUsername.Trim();
            }
            if (!String.IsNullOrEmpty(GoogleMyBusinessPassword))
            {
                GoogleMyBusinessPassword = GoogleMyBusinessPassword.Trim();
            }
            if (!String.IsNullOrEmpty(KeyWords))
            {
                KeyWords = KeyWords.Trim();
            }
            if (!String.IsNullOrEmpty(TargetKeyPhases))
            {
                TargetKeyPhases = TargetKeyPhases.Trim();
            }
            if (!String.IsNullOrEmpty(TargetAreas))
            {
                TargetAreas = TargetAreas.Trim();
            }
            if (!String.IsNullOrEmpty(CompetitorsUrl))
            {
                CompetitorsUrl = CompetitorsUrl.Trim();
            }
            if (!String.IsNullOrEmpty(SocialMedia))
            {
                SocialMedia = SocialMedia.Trim();
            }
            if (!String.IsNullOrEmpty(SocialMedia2))
            {
                SocialMedia2 = SocialMedia2.Trim();
            }
            if (!String.IsNullOrEmpty(SocialMedia3))
            {
                SocialMedia3 = SocialMedia3.Trim();
            }
            if (!String.IsNullOrEmpty(SocialMedia4))
            {
                SocialMedia4 = SocialMedia4.Trim();
            }
            if (!String.IsNullOrEmpty(OtherMarketingTypes))
            {
                OtherMarketingTypes = OtherMarketingTypes.Trim();
            }
            if (!String.IsNullOrEmpty(MarketingGoals))
            {
                MarketingGoals = MarketingGoals.Trim();
            }

            //ExpandPlaning = ExpandPlaning.Trim();

            yield return(ValidationResult.Success);
        }