Ejemplo n.º 1
0
        virtual protected void Start()
        {
            // Make sure the Tagalong object has a BoxCollider.
            tagalongCollider = GetComponent <BoxCollider>();
            if (!tagalongCollider)
            {
                // If we can't find one, disable the script.
                enabled = false;
            }

            // Add an Interpolator component and set some default parameters for
            // it. These parameters can be adjusted in Unity's Inspector.
            interpolator = gameObject.AddComponent <Interpolator>();
            interpolator.SmoothLerpToTarget      = SmoothMotion;
            interpolator.SmoothPositionLerpRatio = SmoothingFactor;
        }
Ejemplo n.º 2
0
        protected virtual void Start()
        {
            // Make sure the Tagalong object has a BoxCollider.
            tagalongCollider = GetComponent<BoxCollider>();
            if (!tagalongCollider)
            {
                // If we can't find one, disable the script.
                enabled = false;
            }

            // Add an Interpolator component and set some default parameters for
            // it. These parameters can be adjusted in Unity's Inspector.
            interpolator = gameObject.AddComponent<Interpolator>();
            interpolator.SmoothLerpToTarget = SmoothMotion;
            interpolator.SmoothPositionLerpRatio = SmoothingFactor;
        }