예제 #1
0
 public Counter(
     float from            = 0.0f,
     float to              = 0.0f,
     float time            = 0.0f,
     Smoothness smoothness = Smoothness.None,
     Action action         = null
     )
 {
     Reset(from, to, time, smoothness, action);
 }
예제 #2
0
        public Counter(
		    float      from       = 0.0f,
		    float      to         = 0.0f,
		    float      time       = 0.0f,
		    Smoothness smoothness = Smoothness.None,
		    Action     action     = null
		    )
        {
            Reset(from, to, time, smoothness, action);
        }
        /// <summary>
        /// Creates a simple animation that goes from a value to another
        /// </summary>
        /// <param name="from">From what value the animation comes from</param>
        /// <param name="to">To what value the animation goes to</param>
        /// <param name="time">Animation duration</param>
        /// <param name="smoothness">Animation easing</param>
        /// <param name="action">Callback action</param>
        public SimpleAnimation(
		    float      from       = 0.0f,
		    float      to         = 0.0f,
		    float      time       = 0.0f,
		    Smoothness smoothness = Smoothness.None,
		    Action     action     = null
		    )
        {
            Reset(from, to, time, smoothness, action);
        }
 /// <summary>
 /// Creates a simple animation that goes from a value to another
 /// </summary>
 /// <param name="from">From what value the animation comes from</param>
 /// <param name="to">To what value the animation goes to</param>
 /// <param name="time">Animation duration</param>
 /// <param name="smoothness">Animation easing</param>
 /// <param name="action">Callback action</param>
 public SimpleAnimation(
     float from            = 0.0f,
     float to              = 0.0f,
     float time            = 0.0f,
     Smoothness smoothness = Smoothness.None,
     Action action         = null
     )
 {
     Reset(from, to, time, smoothness, action);
 }
예제 #5
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Empty.GetHashCode();
         hashCode = (hashCode * 397) ^ Color.GetHashCode();
         hashCode = (hashCode * 397) ^ Metallic.GetHashCode();
         hashCode = (hashCode * 397) ^ Smoothness.GetHashCode();
         hashCode = (hashCode * 397) ^ Emission.GetHashCode();
         return(hashCode);
     }
 }
예제 #6
0
        public XElement toXElem()
        {
            XElement xel = new XElement("ControllerConfig");

            xel.Add(new XAttribute("Id", Id.ToString()),
                    new XAttribute("Type", Type),
                    new XAttribute("SmoothingEnabled", SmoothingEnabled.ToString().ToLower()),
                    new XAttribute("Smoothness", Smoothness.ToString()),
                    new XAttribute("Itensity", Intensity.ToString()),
                    new XAttribute("Acceleration", Acceleration.ToString()),
                    new XAttribute("MinSpeed", MinSpeed.ToString()),
                    new XAttribute("MaxSpeed", MaxSpeed.ToString())
                    );
            return(xel);
        }
예제 #7
0
        public void Reset(
            float from            = 0.0f,
            float to              = 0.0f,
            float time            = 0.0f,
            Smoothness smoothness = Smoothness.None,
            Action action         = null
            )
        {
            From       = from;
            To         = to;
            Time       = time;
            Smoothness = smoothness;
            Action     = action;

            _Current = 0.0f;
        }
        /// <summary>
        /// Resets the animation settings
        /// </summary>
        /// <param name="from">From what value the animation comes from</param>
        /// <param name="to">To what value the animation goes to</param>
        /// <param name="time">Animation duration</param>
        /// <param name="smoothness">Animation easing</param>
        /// <param name="action">Callback action</param>
        public void Reset(
            float from            = 0.0f,
            float to              = 0.0f,
            float time            = 0.0f,
            Smoothness smoothness = Smoothness.None,
            Action action         = null
            )
        {
            // Applies the new settings
            From       = from;
            To         = to;
            Time       = time;
            Smoothness = smoothness;
            Action     = action;

            // Resets the animation progress
            _Current = 0.0f;
        }
예제 #9
0
    private void Start()
    {
        lineRenderer = GetComponent <LineRenderer>();
        lineRenderer.positionCount = points + 1;
        maxPoints                = points;
        smoothnessScript         = GetComponent <Smoothness>();
        smoothnessScript.scripts = new List <HoldingDistance>();

        GameObject go = Instantiate(nodePrefab, player.position + Vector3.down, Quaternion.identity, transform);

        nodes.Add(go.transform);
        HoldingDistance script = go.GetComponent <HoldingDistance>();

        script.target      = player;
        script.maxDistance = firstNodeDistance;
        smoothnessScript.scripts.Add(script);
        Attacking.closestNode = go.transform;

        for (int i = 0; i < points - 1; i++)
        {
            GenerateNode();
        }
    }
예제 #10
0
        public void Reset(
		    float      from       = 0.0f,
		    float      to         = 0.0f,
		    float      time       = 0.0f,
		    Smoothness smoothness = Smoothness.None,
		    Action     action     = null
		    )
        {
            From       = from;
            To         = to;
            Time       = time;
            Smoothness = smoothness;
            Action     = action;

            _Current   = 0.0f;
        }
예제 #11
0
        /// <summary>
        /// Resets the animation settings
        /// </summary>
        /// <param name="from">From what value the animation comes from</param>
        /// <param name="to">To what value the animation goes to</param>
        /// <param name="time">Animation duration</param>
        /// <param name="smoothness">Animation easing</param>
        /// <param name="action">Callback action</param>
        public void Reset(
		    float      from       = 0.0f,
		    float      to         = 0.0f,
		    float      time       = 0.0f,
		    Smoothness smoothness = Smoothness.None,
		    Action     action     = null
		    )
        {
            // Applies the new settings
            From       = from;
            To         = to;
            Time       = time;
            Smoothness = smoothness;
            Action     = action;

            // Resets the animation progress
            _Current   = 0.0f;
        }