예제 #1
0
    public void Update()
    {
        switch (mRippleState)
        {
        case RippleState.Ripple:
            ripple();
            mRippleDuration -= Time.deltaTime;
            if (mRippleDuration < 0)
            {
                if (mIsLine)
                {
                    mRippleState = RippleState.Spring;
                }
                else
                {
                    mRippleState = RippleState.Pause;
                }
            }
            break;

        case RippleState.Pause:
            mPauseDuration -= Time.deltaTime;
            if (mPauseDuration < 0)
            {
                mRippleState = RippleState.Move;
            }
            break;

        case RippleState.Move:
            move();
            mMoveDuration -= Time.deltaTime;
            if (mMoveDuration < 0)
            {
                mRippleState = RippleState.End;
            }
            break;

        case RippleState.Spring:
            spring();
            mSprintDuration -= Time.deltaTime;
            if (mSprintDuration < 0)
            {
                mRippleState = RippleState.Move;
            }
            break;

        default:
            SignFinished();
            break;
        }
    }
예제 #2
0
        private static StObject LedgerFormatted(StObject source, LedgerEntryType ledgerEntryType)
        {
            StObject constructed = null;

            if (ledgerEntryType == Enums.LedgerEntryType.Offer)
            {
                constructed = new Offer();
            }
            else if (ledgerEntryType == Enums.LedgerEntryType.RippleState)
            {
                constructed = new RippleState();
            }
            else if (ledgerEntryType == Enums.LedgerEntryType.AccountRoot)
            {
                constructed = new AccountRoot();
            }
            else if (ledgerEntryType == Enums.LedgerEntryType.Invalid)
            {
            }
            else if (ledgerEntryType == Enums.LedgerEntryType.DirectoryNode)
            {
                constructed = new DirectoryNode();
            }
            else if (ledgerEntryType == Enums.LedgerEntryType.GeneratorMap)
            {
            }
            else if (ledgerEntryType == Enums.LedgerEntryType.Nickname)
            {
            }
            else if (ledgerEntryType == Enums.LedgerEntryType.Contract)
            {
            }
            else if (ledgerEntryType == Enums.LedgerEntryType.LedgerHashes)
            {
            }
            else if (ledgerEntryType == Enums.LedgerEntryType.EnabledFeatures)
            {
            }
            else if (ledgerEntryType == Enums.LedgerEntryType.FeeSettings)
            {
            }

            if (constructed == null)
            {
                constructed = new LedgerEntry(ledgerEntryType);
            }

            constructed.fields = source.fields;

            return(constructed);
        }
예제 #3
0
    public void SetState(RippleState state)
    {
        this.ripplestate = state;
        switch (this.ripplestate)
        {
        case RippleState.On:
            ripple.Frequency = -1f * velocity;
            ripple.Speed     = 1.0f * velocity;
            break;

        case RippleState.Off:
            ripple.Frequency = 0;
            ripple.Speed     = 0;
            break;
        }
    }
예제 #4
0
 public void Update()
 {
     switch (mRippleState)
     {
         case RippleState.Ripple:
             ripple();
             mRippleDuration -= Time.deltaTime;
             if (mRippleDuration < 0)
             {
                 if (mIsLine)
                 {
                     mRippleState = RippleState.Spring;
                 }
                 else
                 {
                     mRippleState = RippleState.Pause;
                 }
             }
             break;
         case RippleState.Pause:
             mPauseDuration -= Time.deltaTime;
             if (mPauseDuration < 0)
             {
                 mRippleState = RippleState.Move;
             }
             break;
         case RippleState.Move:
             move();
             mMoveDuration -= Time.deltaTime;
             if (mMoveDuration < 0)
             {
                 mRippleState = RippleState.End;
             }
             break;
         case RippleState.Spring:
             spring();
             mSprintDuration -= Time.deltaTime;
             if (mSprintDuration < 0)
             {
                 mRippleState = RippleState.Move;
             }
             break;
         default:
             SignFinished();
             break;
     }
 }
예제 #5
0
    public void SetState(RippleState state)
    {
        this.ripplestate = state;
        switch (this.ripplestate)
        {
        case RippleState.On:
            ripple.Frequency = 1f;
            ripple.Amplitude = 1f;
            ripple.Speed     = 2.0f * velocity;
            break;

        case RippleState.Off:
            ripple.Frequency = 0f;
            ripple.Amplitude = 0f;
            ripple.Speed     = 0;
            break;
        }
    }
예제 #6
0
    protected override void create()
    {
        base.create();
        mMoveDuration = Vector3.Distance(mInitPosition, mTargetPosition) / mMoveSpeed;

        if (Random.Range(0, 90) < 45)
        {
            rippleInit();
        }
        else
        {
            lineInit();
        }

        if (mCoins.Count <= 1)
        {
            mRippleState = RippleState.Move;
        }
    }
예제 #7
0
        protected override void create()
        {
            base.create();
            mMoveDuration = Vector3.Distance(mInitPosition, mTargetPosition) / mMoveSpeed;

            if (Random.Range(0, 90) < 45)
            {
                rippleInit();
            }
            else
            {
                lineInit();
            }

            if (mCoins.Count <= 1)
            {
                mRippleState = RippleState.Move;
            }
        }