示例#1
0
    private void OnTriggerEnter(Collider other)
    {
        WinCondition winCondition = other.GetComponent <WinCondition>();
        DieEvent     dieEvent     = other.GetComponent <DieEvent>();
        ICoins       iCoins       = other.GetComponent <ICoins>();

        if (other.tag == "Cannon")
        {
            cannonTriggered = other.gameObject;
            other.enabled   = false;
            StuckOnCannon();
            cannonTriggered.GetComponent <CannonParent>().mAnimator.SetTrigger("Entering");
            OnProgressLvl(transform.position);
        }
        else if (dieEvent != null)
        {
            mCollider.enabled     = false;
            transform.position    = reference.position;
            transform.eulerAngles = reference.eulerAngles;
            dieEvent.CharacterDie();
            m_Rigidbody.constraints  = RigidbodyConstraints.FreezeAll;
            m_SpriteRenderer.enabled = false;
        }
        else if (winCondition != null)
        {
            winCondition.Win(m_Rigidbody);
            mCollider.enabled        = false;
            m_SpriteRenderer.enabled = false;
        }
        else if (iCoins != null)
        {
            iCoins.CollectCoins();
        }
    }
        public CoinsDetailsPageViewModel(ICoins icoins)
        {
            _icoins = icoins;
            NavigationPage page = App.Current.MainPage as NavigationPage;

            page.BarBackgroundColor = Color.FromHex("427ad4");
        }
 public CoinsPageViewModel(ICoins coins, INavigationService navigationService)
 {
     coinsModel   = new ObservableCollection <CoinsModel>();
     _icoins      = coins;
     CoinsGrouped = new ObservableCollection <Grouping <string, CoinsModel> >();
     IsBusy       = true;
     LoadCoins();
     NavigationService = navigationService;
 }