/// <summary>
        /// Preparin initial stuff
        /// </summary>
        protected virtual void Start()
        {
            fitter      = GetComponent <FGroundFitter>();
            animator    = GetComponentInChildren <Animator>();
            rigb        = GetComponent <Rigidbody>();
            itsCollider = GetComponentInChildren <Collider>();

            if (animator)
            {
                if (HasParameter(animator, "AnimationSpeed"))
                {
                    animatorHaveAnimationSpeedProp = true;
                }
                animator.applyRootMotion = false;
            }

            fitter.UpAxisRotation = transform.rotation.eulerAngles.y;
            initialUpOffset       = fitter.UpOffset;

            fitter.RefreshLastRaycast();

            clips = new FAnimationClips(animator);
            clips.AddClip("Idle");
            clips.AddClip("Walk");
            clips.AddClip("Run");
        }
Пример #2
0
        public virtual void Start()
        {
            fitter     = GetComponent <FGroundFitter>();
            controller = GetComponent <FGroundFitter_Movement>();

            RotationOffset = 0f;
            Sprint         = false;
            MoveVector     = Vector3.zero;
        }
        void Start()
        {
            fitter   = GetComponent <FGroundFitter>();
            animator = GetComponentInChildren <Animator>();
            timer    = Random.Range(1f, 5f);

            if (name.Contains("Fpider"))
            {
                bodyTransform = transform.GetChild(0).Find("BSkeleton").GetChild(0).Find("Body_Shield");
            }

            transform.rotation    = Quaternion.Euler(0f, Random.Range(-180f, 180f), 0f);
            fitter.UpAxisRotation = transform.rotation.eulerAngles.y;

            onDestination = true;

            transform.localScale = Vector3.one * Random.Range(0.5f, 1f);

            clips = new FAnimationClips(animator);
            clips.AddClip("Idle");
            clips.AddClip("Move");
        }