Advertisement
brainode

dumbbell

Jul 10th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.07 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using NUnit.Framework.Constraints;
  4. using UnityEngine;
  5.  
  6. public class Dumbbell : MonoBehaviour
  7. {
  8.  
  9.     public int dumbbellWeight;
  10.    
  11.  
  12.     public void UpdateSprite(int dumbbelWeight)
  13.     {
  14.         GameObject spriteWeight = transform.Find("WeightNum").gameObject;
  15.         SpriteRenderer spriteWeightRenderer = spriteWeight.GetComponent<SpriteRenderer>();
  16.         spriteWeightRenderer.sprite = Resources.Load<Sprite>("Images\\" + dumbbelWeight);
  17.     }
  18.  
  19.     public static bool operator >=(Dumbbell left,Dumbbell right)
  20.     {
  21.         return left.dumbbellWeight>=right.dumbbellWeight;
  22.     }
  23.  
  24.     public static bool operator <=(Dumbbell left, Dumbbell right)
  25.     {
  26.         return left.dumbbellWeight<=right.dumbbellWeight;
  27.     }
  28.  
  29.     public static bool operator >(Dumbbell left, Dumbbell right)
  30.     {
  31.         return left.dumbbellWeight > right.dumbbellWeight;
  32.     }
  33.  
  34.     public static bool operator <(Dumbbell left, Dumbbell right)
  35.     {
  36.         return left.dumbbellWeight < right.dumbbellWeight;
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement