// Use this for initialization void Start() { realz = transform.position.z; initialz = realz; initialx = transform.position.x; initialy = transform.position.y; realz = transform.position.z; Random.seed = 42; System.Random rn = new System.Random(); movespeed = 6; k = rn.Next(2, 20); cube1 = GameObject.Find("Cube1").GetComponent <Cube1>(); flag = false; }
/// <summary> /// Compares two instances of this object. /// </summary> /// <param name="Cube1">A Cube<T>.</param> /// <param name="Cube2">Another Cube<T>.</param> /// <returns>true|false</returns> public static Boolean operator ==(Cube <T> Cube1, Cube <T> Cube2) { // If both are null, or both are same instance, return true. if (Object.ReferenceEquals(Cube1, Cube2)) { return(true); } // If one is null, but not both, return false. if (((Object)Cube1 == null) || ((Object)Cube2 == null)) { return(false); } return(Cube1.Equals(Cube2)); }