private IEnumerator TimerChange( )
        {
            if (_curTimeout > 0)
            {
                yield return(new WaitForSeconds(1.0f));

                Progress    = Progress + 0.1f;
                _curTimeout = _curTimeout - 1;
                CoroutineEngine.GetInstance( ).Execute(TimerChange( ));
            }
        }
예제 #2
0
        void Awake()
        {
            var rigidbody = GetComponent <Rigidbody>();

            //_collider = GetComponent<CapsuleCollider>( );

            rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;
            //_collider.center = new Vector3( 0, 1, 0 );
            //_collider.radius = 1;

            Vector3 extraGravityForce = Physics.gravity;

            rigidbody.AddForce(extraGravityForce);

            var navMeshAgent = GetComponent <NavMeshAgent>();

            navMeshAgent.speed            = 2f;
            navMeshAgent.acceleration     = 360;
            navMeshAgent.angularSpeed     = 1f;
            navMeshAgent.stoppingDistance = 0.1f;

            CoroutineEngine.GetInstance().Execute(TimerChange());
        }
예제 #3
0
 private void OnClickLogin()
 {
     _loginState = UiLoginState.WaitingForHttp;
     CoroutineEngine.GetInstance().Execute(GetServer());
 }
 public override void Start( )
 {
     _curTimeout = 10;
     CoroutineEngine.GetInstance( ).Execute(TimerChange( ));
 }