Inheritance: MonoBehaviour
示例#1
0
		public override void WriteGroupCodes()
		{
			int flags;

			WriteGroupCodeValue(10, X0.ToString().Trim());
			WriteGroupCodeValue(20, Y0.ToString().Trim());
			WriteGroupCodeValue(30, Z0.ToString().Trim());

			WriteGroupCodeValue(11, X1.ToString().Trim());
			WriteGroupCodeValue(21, Y1.ToString().Trim());
			WriteGroupCodeValue(31, Z1.ToString().Trim());

			WriteGroupCodeValue(12, X2.ToString().Trim());
			WriteGroupCodeValue(22, Y2.ToString().Trim());
			WriteGroupCodeValue(32, Z2.ToString().Trim());

			WriteGroupCodeValue(13, X3.ToString().Trim());
			WriteGroupCodeValue(23, Y3.ToString().Trim());
			WriteGroupCodeValue(33, Z3.ToString().Trim());

			flags = 0;

			if(Edge1Invisible) flags += 1;
			if(Edge2Invisible) flags += 2;
			if(Edge3Invisible) flags += 4;
			if(Edge4Invisible) flags += 8;

			WriteGroupCodeValue(70, flags.ToString().Trim());
		}
示例#2
0
 public void disableMultiplier()
 {
     isRestoring = true;
     X1.GetComponent <Image>().fillAmount = 0.0f;
     X2.GetComponent <Image>().fillAmount = 0.0f;
     X3.GetComponent <Image>().fillAmount = 0.0f;
 }
示例#3
0
    public static void MainTest()
    {
        var x1 = new X1();
        var x2 = new X2();
        var x3 = new X3();
        var x4 = new X4();

        x4.Display2();
        x1 = x4;
        x1.Display1();
        System.Console.WriteLine(x1.y);
        //x1.Display2();
        System.Console.WriteLine();

        var tt = new Y <int, Double>();

        tt.Set(3);
        tt.Set(.3);

        x1 = new X1();
        var x11 = new X1();

        x2 = new X2();
        var x22 = new X2();

        x1 = T1.V1(x22);
        //x2 = T1.V2(x1);
    }
示例#4
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         hashCode = hashCode * 59 + Type.GetHashCode();
         hashCode = hashCode * 59 + Barcode1DSymbology.GetHashCode();
         if (Data != null)
         {
             hashCode = hashCode * 59 + Data.GetHashCode();
         }
         hashCode = hashCode * 59 + X1.GetHashCode();
         hashCode = hashCode * 59 + X2.GetHashCode();
         hashCode = hashCode * 59 + X3.GetHashCode();
         hashCode = hashCode * 59 + X4.GetHashCode();
         hashCode = hashCode * 59 + Y1.GetHashCode();
         hashCode = hashCode * 59 + Y2.GetHashCode();
         hashCode = hashCode * 59 + Y3.GetHashCode();
         hashCode = hashCode * 59 + Y4.GetHashCode();
         hashCode = hashCode * 59 + BboxLeftInches.GetHashCode();
         hashCode = hashCode * 59 + BboxTopInches.GetHashCode();
         hashCode = hashCode * 59 + BboxWidthInches.GetHashCode();
         hashCode = hashCode * 59 + BboxHeightInches.GetHashCode();
         hashCode = hashCode * 59 + PageNumber.GetHashCode();
         hashCode = hashCode * 59 + PagePixelWidth.GetHashCode();
         hashCode = hashCode * 59 + PagePixelHeight.GetHashCode();
         hashCode = hashCode * 59 + PageHorizontalResolution.GetHashCode();
         hashCode = hashCode * 59 + PageVerticalResolution.GetHashCode();
         return(hashCode);
     }
 }
示例#5
0
 public void onJoker3Click()
 {
     //Disable button and show cross
     helpFromAudience.GetComponent <Button>().enabled = false;
     X3.SetActive(true);
     AudienceChoice();
 }
示例#6
0
    IEnumerator GTLSequence(int multiplierGtl)
    {
        isRegenGtl = true;
        switch (multiplierGtl)
        {
        case 1:
            for (int i = 0; i < 6; i++)
            {
                X1.GetComponent <Image>().fillAmount = 1.0f;
                yield return(new WaitForSeconds(0.125f));

                X1.GetComponent <Image>().fillAmount = 0.0f;
                if (isRestoring)
                {
                    statusGTL = 0;
                    break;
                }
                yield return(new WaitForSeconds(0.125f));
            }
            X1.GetComponent <Image>().fillAmount = 1.0f;
            break;

        case 2:
            for (int i = 0; i < 6; i++)
            {
                X2.GetComponent <Image>().fillAmount = 1.0f;
                yield return(new WaitForSeconds(0.125f));

                X2.GetComponent <Image>().fillAmount = 0.0f;
                if (isRestoring)
                {
                    statusGTL = 0;
                    break;
                }
                yield return(new WaitForSeconds(0.125f));
            }
            X2.GetComponent <Image>().fillAmount = 1.0f;
            break;

        case 3:
            for (int i = 0; i < 6; i++)
            {
                X3.GetComponent <Image>().fillAmount = 1.0f;
                yield return(new WaitForSeconds(0.125f));

                X3.GetComponent <Image>().fillAmount = 0.0f;
                if (isRestoring)
                {
                    statusGTL = 0;
                    break;
                }
                yield return(new WaitForSeconds(0.125f));
            }
            X3.GetComponent <Image>().fillAmount = 1.0f;
            break;
        }
        isRegenGtl  = false;
        isRestoring = false;
    }
        public override string ToString()
        {
            string str = "";

            str += X1.ToString() + "\n";
            str += X2.ToString() + "\n";
            str += X3.ToString() + "\n";
            str += $"Area = {Area.ToString("f3")}\nPerimetr = {Perimetr.ToString("f3")}\n";
            return(str);
        }
示例#8
0
        public static void SaveLog()
        {
            //创建文件夹
            var dir = AppDomain.CurrentDomain.BaseDirectory + "Log";

            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }

            //新文件则添加表头
            var fileName = dir + "\\" + DateTime.Now.ToString("yyyy-MM-dd") + ".csv";

            if (!File.Exists(fileName))
            {
                var sw    = new StreamWriter(fileName, true);
                var title = "时间,Y1,X4,X3,X2,X1,结果";
                sw.WriteLine(title);
                sw.Flush();
                sw.Close();
            }

            var item = DateTime.Now.ToString("HH:mm:ss:fff")
                       + "," + Y.ToString("f3")
                       + "," + X1.ToString("f3")
                       + "," + X2.ToString("f3")
                       + "," + X3.ToString("f3")
                       + "," + X4.ToString("f3");
            //+ "," + WZ1.ToString("f3")
            //+ "," + WZ2.ToString("f3")
            //+ "," + WZ3.ToString("f3")
            //+ "," + WZ11.ToString("f3")
            //+ "," + WZ31.ToString("f3")


            var sw2 = new StreamWriter(fileName, true);

            sw2.WriteLine(item);
            sw2.Flush();
            sw2.Close();

            //删除过期文件
            var files = Directory.GetFiles(dir);

            for (var i = 0; i < files.Length; i++)
            {
                var dt = File.GetCreationTime(files[i]);
                var ts = DateTime.Now - dt;
                if (ts.Days > 30)
                {
                    File.Delete(files[i]);
                }
            }
        }
示例#9
0
        public override int GetHashCode()
        {
            int prime = 37;
            int hash  = 1;

            hash = prime * hash + X1.GetHashCode();
            hash = prime * hash + X2.GetHashCode();
            hash = prime * hash + X3.GetHashCode();
            hash = prime * hash + Y1.GetHashCode();
            hash = prime * hash + Y2.GetHashCode();
            return(prime * hash + Y3.GetHashCode());
        }
示例#10
0
    // Use this for initialization
    void Start()
    {
        fiftyFifty.GetComponent <Button>().enabled       = true;
        callAFriend.GetComponent <Button>().enabled      = true;
        helpFromAudience.GetComponent <Button>().enabled = true;
        Panel.SetActive(false);


        //hide "cross" images
        X1.SetActive(false);
        X2.SetActive(false);
        X3.SetActive(false);
    }
示例#11
0
        public void TestWildcardOverrideIgnoreStateMachine()
        {
            var config = new LogEvent();

            this.Test(r =>
            {
                X3.RunTest(r, config);
            });

            string actual = config.ToString();

            Assert.True(actual is "Init,Active,Catch E1 in State Active");
        }
示例#12
0
        public override int GetHashCode()
        {
            var prime = 37;
            var hash  = 1;

            hash = prime * hash + X1.GetHashCode();
            hash = prime * hash + Y1.GetHashCode();
            hash = prime * hash + X2.GetHashCode();
            hash = prime * hash + Y2.GetHashCode();
            hash = prime * hash + X3.GetHashCode();
            hash = prime * hash + Y3.GetHashCode();

            return(hash);
        }
示例#13
0
        public static void DifferentObjectsHaveDifferentHashes()
        {
            var x = new X3
            {
                F1 = "some string",
                F2 = 17,
                F3 = new X1()
            };

            var y = new X3
            {
                F1 = "some string xxx",
                F2 = 17,
                F3 = new X1()
            };

            Assert.NotEqual(x.GetHashCode(), y.GetHashCode());
        }
示例#14
0
        public override void WriteGroupCodes()
        {
            WriteGroupCodeValue(10, X0.ToString().Trim());
            WriteGroupCodeValue(20, Y0.ToString().Trim());
            WriteGroupCodeValue(30, Z0.ToString().Trim());

            WriteGroupCodeValue(11, X1.ToString().Trim());
            WriteGroupCodeValue(21, Y1.ToString().Trim());
            WriteGroupCodeValue(31, Z1.ToString().Trim());

            WriteGroupCodeValue(12, X2.ToString().Trim());
            WriteGroupCodeValue(22, Y2.ToString().Trim());
            WriteGroupCodeValue(32, Z2.ToString().Trim());

            WriteGroupCodeValue(13, X3.ToString().Trim());
            WriteGroupCodeValue(23, Y3.ToString().Trim());
            WriteGroupCodeValue(33, Z3.ToString().Trim());
        }
示例#15
0
        public static void SameObjectsHaveSameHashes()
        {
            var x = new X3
            {
                F1 = "some string",
                F2 = 17,
                F3 = new X1()
            };

            var y = new X3
            {
                F1 = "some string",
                F2 = 17,
                F3 = new X1()
            };

            Assert.Equal(x.GetHashCode(), y.GetHashCode());
        }
示例#16
0
 bool WriteFromGRDECL(string file)
 {
     try
     {
         using (StreamWriter sw = new StreamWriter(file, true))
         {
             sw.WriteLine(string.Empty);
             sw.WriteLine(grdecl_kw_mapaxes);
             sw.WriteLine(X1.ToString() + " " + Y1.ToString() + " " +
                          X2.ToString() + " " + Y2.ToString() + " " +
                          X3.ToString() + " " + Y3.ToString() + " /");
         }
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
示例#17
0
    // Update is called once per frame
    void Update()
    {
        if (ScoreScript.multiplierScore == 1.0f && statusGTL != 1 && !isRegenGtl)
        {
            statusGTL = 1;
            if (X1.GetComponent <Image>().fillAmount < 1.0f && !tm.InSlowMo())
            {
                GTLTimerDoor = GTLSequence(statusGTL);
                StartCoroutine(GTLTimerDoor);
            }

            X2.GetComponent <Image>().fillAmount = 0.0f;
            X3.GetComponent <Image>().fillAmount = 0.0f;
        }
        else if (ScoreScript.multiplierScore == 1.5f && statusGTL != 2 && !isRegenGtl)
        {
            statusGTL = 2;
            if (X2.GetComponent <Image>().fillAmount == 0.0f)
            {
                GTLTimerDoor = GTLSequence(statusGTL);
                StartCoroutine(GTLTimerDoor);
            }
            X1.GetComponent <Image>().fillAmount = 0.0f;
            X3.GetComponent <Image>().fillAmount = 0.0f;
        }
        else if (ScoreScript.multiplierScore == 2.0f && statusGTL != 3 && !isRegenGtl)
        {
            statusGTL = 3;
            if (X3.GetComponent <Image>().fillAmount == 0.0f)
            {
                GTLTimerDoor = GTLSequence(statusGTL);
                StartCoroutine(GTLTimerDoor);
            }
            X1.GetComponent <Image>().fillAmount = 0.0f;
            X2.GetComponent <Image>().fillAmount = 0.0f;
        }
    }
示例#18
0
        /// <summary>
        /// Returns true if BarcodeInfo instances are equal
        /// </summary>
        /// <param name="input">Instance of BarcodeInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BarcodeInfo input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Type == input.Type ||
                     Type.Equals(input.Type)
                     ) &&
                 (
                     Barcode1DSymbology == input.Barcode1DSymbology ||
                     Barcode1DSymbology.Equals(input.Barcode1DSymbology)
                 ) &&
                 (
                     Data == input.Data ||
                     (Data != null &&
                      Data.Equals(input.Data))
                 ) &&
                 (
                     X1 == input.X1 ||
                     X1.Equals(input.X1)
                 ) &&
                 (
                     X2 == input.X2 ||
                     X2.Equals(input.X2)
                 ) &&
                 (
                     X3 == input.X3 ||
                     X3.Equals(input.X3)
                 ) &&
                 (
                     X4 == input.X4 ||
                     X4.Equals(input.X4)
                 ) &&
                 (
                     Y1 == input.Y1 ||
                     Y1.Equals(input.Y1)
                 ) &&
                 (
                     Y2 == input.Y2 ||
                     Y2.Equals(input.Y2)
                 ) &&
                 (
                     Y3 == input.Y3 ||
                     Y3.Equals(input.Y3)
                 ) &&
                 (
                     Y4 == input.Y4 ||
                     Y4.Equals(input.Y4)
                 ) &&
                 (
                     BboxLeftInches == input.BboxLeftInches ||
                     BboxLeftInches.Equals(input.BboxLeftInches)
                 ) &&
                 (
                     BboxTopInches == input.BboxTopInches ||
                     BboxTopInches.Equals(input.BboxTopInches)
                 ) &&
                 (
                     BboxWidthInches == input.BboxWidthInches ||
                     BboxWidthInches.Equals(input.BboxWidthInches)
                 ) &&
                 (
                     BboxHeightInches == input.BboxHeightInches ||
                     BboxHeightInches.Equals(input.BboxHeightInches)
                 ) &&
                 (
                     PageNumber == input.PageNumber ||
                     PageNumber.Equals(input.PageNumber)
                 ) &&
                 (
                     PagePixelWidth == input.PagePixelWidth ||
                     PagePixelWidth.Equals(input.PagePixelWidth)
                 ) &&
                 (
                     PagePixelHeight == input.PagePixelHeight ||
                     PagePixelHeight.Equals(input.PagePixelHeight)
                 ) &&
                 (
                     PageHorizontalResolution == input.PageHorizontalResolution ||
                     PageHorizontalResolution.Equals(input.PageHorizontalResolution)
                 ) &&
                 (
                     PageVerticalResolution == input.PageVerticalResolution ||
                     PageVerticalResolution.Equals(input.PageVerticalResolution)
                 ));
        }
示例#19
0
    private IEnumerator DelayEvent3(X3 event3)
    {
        yield return(new WaitForSeconds(0.1f));

        event3.enabled = true;
    }
示例#20
0
    private void Update()
    {
        if (Input.GetMouseButtonDown(1) && !tookPicture && phoneEquipped)
        {
            // Raycast based on player's camera
            Ray ray = cam.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0));

            Vector3 forward = this.transform.TransformDirection(Vector3.forward) * 100;

            RaycastHit hit;
            if (Physics.Raycast(ray, out hit, interactDistance, layer))
            {
                if (hit.transform.tag == "X_Event")
                {
                    X1     event1     = hit.transform.GetComponent <X1>();
                    X2     event2     = hit.transform.GetComponent <X2>();
                    X3     event3     = hit.transform.GetComponent <X3>();
                    X4     event4     = hit.transform.GetComponent <X4>();
                    XBlank eventBlank = hit.transform.GetComponent <XBlank>();

                    if (event1)
                    {
                        StartCoroutine(DelayEvent1(event1));

                        // Play shatter vfx
                        hit.transform.GetComponent <MeshRenderer>().enabled = false;
                        hit.transform.GetComponent <BoxCollider>().enabled  = false;
                        Destroy(hit.transform.gameObject, 5.0f);
                    }
                    else if (event2)
                    {
                        StartCoroutine(DelayEvent2(event2));

                        hit.transform.GetComponent <MeshRenderer>().enabled = false;
                        hit.transform.GetComponent <BoxCollider>().enabled  = false;
                    }
                    else if (event3)
                    {
                        StartCoroutine(DelayEvent3(event3));

                        hit.transform.GetComponent <MeshRenderer>().enabled = false;
                        hit.transform.GetComponent <BoxCollider>().enabled  = false;
                    }
                    else if (event4)
                    {
                        StartCoroutine(DelayEvent4(event4));

                        hit.transform.GetComponent <MeshRenderer>().enabled = false;
                        hit.transform.GetComponent <BoxCollider>().enabled  = false;
                    }
                    else if (eventBlank)
                    {
                        StartCoroutine(DelayEventBlank(eventBlank));
                    }
                }
                else if (hit.transform.tag == "Door")
                {
                    if (hit.transform.GetComponent <Door>().TargetKeyID == 1337) // hallway puzzle door
                    {
                        StartCoroutine(FlashDoorColor(hit.transform.gameObject, new Color(0, 1, 0.792f, 1)));
                    }
                }
            }

            // Picture effect on phone
            TakePicture();
        }

        if (Input.GetKeyDown(KeyCode.C))
        {
            EquipPhone();
        }
    }
示例#21
0
 public override int GetHashCode()
 {
     return(X1.GetHashCode() + X2.GetHashCode() + X3.GetHashCode() + Y1.GetHashCode() + Y2.GetHashCode() + Y3.GetHashCode());
 }