void Start()
 {
     animator = GetComponent <Animator>();
     agente   = GetComponent <NavMeshAgent>();
     gs       = GameStatus.Instance;
     w        = Winston.Instance;
 }
Пример #2
0
 void Start()
 {
     shCollider = GetComponent <BoxCollider>();
     ws         = WinstonStats.Instance;
     wa         = WinstonAnimator.Instance;
     gs         = GameStatus.Instance;
     w          = Winston.Instance;
 }
Пример #3
0
 void Awake()
 {
     StartCoroutine(sacietyControl());
     StartCoroutine(higControl());
     StartCoroutine(vejigaControl());
     //		StartCoroutine (saludControl ());
     wins = gameObject.GetComponent <Winston>();
 }
Пример #4
0
        private async Task PlayWinstonAnimationAsync()
        {
            var height = ((Frame)Window.Current.Content).ActualHeight;

            var initialDelay      = TimeSpan.FromSeconds(0.5).TotalMilliseconds;
            var animationDuration = TimeSpan.FromSeconds(25).TotalMilliseconds;

            var animation = Winston
                            .Rotate(delay: initialDelay, duration: animationDuration, centerX: 125, centerY: 125, value: rotation, easingMode: EasingMode.EaseOut)
                            .Offset(delay: initialDelay, duration: animationDuration, offsetX: targetX, offsetY: Rng.Next(0, (int)height), easingMode: EasingMode.EaseOut);

            animation.Completed += OnWinstonArrivedRight;
            await animation.StartAsync();
        }
Пример #5
0
    void OnCollisionEnter(Collision collision)
    {
        Winston w = collision.gameObject.GetComponent <Winston>();
        Hay     h = collision.gameObject.GetComponent <Hay>();

        if (w != null)
        {
            w.PlayAction();
            //rigidbody.AddForce(Vector3.up * ((12 - Mathf.Clamp(collision.relativeVelocity.y, 3.0f, 10.0f)) * 70));
            rigidbody.AddForce(Vector3.up * ((Mathf.Clamp(collision.relativeVelocity.y, 5.0f, 10.0f)) * 60));
            Debug.Log(collision.relativeVelocity.y);
        }
        else if (h != null)
        {
            h.Bounce();
            Debug.Log(collision.relativeVelocity.magnitude);
            rigidbody.AddForce(collision.contacts[0].normal * (Mathf.Clamp(collision.relativeVelocity.magnitude, 5.0f, 10.0f) * 40.0f));
        }
        else
        {
            rigidbody.AddForce(Vector3.up * ((Mathf.Clamp(collision.relativeVelocity.y, 0.0f, 15.0f)) * 15));
        }
    }