Ejemplo n.º 1
0
    IEnumerator AttackSequence(Door door)
    {
        door.isFree = false;

        if (door is Window)
        {
            Window window = door as Window;
            window.Open();

            transform.position = window.startPoint.position;

            yield return(new WaitForSeconds(2.2f));

            animator.SetTrigger("Attack");
            yield return(new WaitForSeconds(2));

            window.Close();
        }

        if (door is Doorway)
        {
            Doorway doorway = door as Doorway;
            doorway.Open();

            transform.position = doorway.DoorStartPoint.position;
            yield return(StartCoroutine(MoveToPos(doorway.DoorEndPoint.position)));

            yield return(new WaitForSeconds(1));

            animator.SetTrigger("Attack");
            yield return(new WaitForSeconds(2));

            yield return(StartCoroutine(MoveToPos(doorway.DoorStartPoint.position)));

            doorway.Close();
        }

        if (door is DoubleDoor)
        {
            DoubleDoor doorway = door as DoubleDoor;
            doorway.Open();

            transform.position = doorway.startPoint.position;
            yield return(new WaitForSeconds(1));

            animator.SetTrigger("Attack");
            yield return(new WaitForSeconds(2));

            doorway.Close();
        }

        yield return(new WaitForSeconds(1));

        door.isFree = true;
        Destroy();
    }
Ejemplo n.º 2
0
 private void setWithoutObstacles(int posX, int posY, int i)
 {
     if (util.Random.boolValue(5) && doubleDoorCounter < MAX_DOUBLE_DOOR)
     {
         windows[i] = new DoubleDoor(posX, posY);
         doubleDoorCounter++;
     }
     else
     {
         windows[i] = new TwoPanels(posX, posY, false);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Saves the list of accessories to a Comma-Separated Value file for later use if needed.
        /// </summary>
        private bool SaveAccessoryList()
        {
            // Temporary file for storing accessory data
            string fname = "AccessoryData.csv";

            // Check if output folder already exists
            string OutputPath = @"C:\ProgramData\Charbonneau Vendette Solutions\";

            if (!Directory.Exists(OutputPath))
            {
                Directory.CreateDirectory(OutputPath);
                Console.WriteLine("Creating new path {0}.", OutputPath);
            }

            // Create full path for file for storing accessory data
            filename = OutputPath + fname;


            try
            {
                using (System.IO.StreamWriter file = new System.IO.StreamWriter(filename))
                {
                    Console.WriteLine("Writing to {0}.", filename);
                    file.WriteLine("BlackFloor,{0}", BlackFloor.ToString());
                    file.WriteLine("VarnishFloor,{0}", VarnishFloor.ToString());
                    file.WriteLine("TarFiller,{0}", TarFiller.ToString());
                    file.WriteLine("SpotLights,{0}", SpotLights.ToString());
                    file.WriteLine("Chandelier,{0}", Chandelier.ToString());
                    file.WriteLine("Cafe25,{0}", Cafe25.ToString());
                    file.WriteLine("Cafe50,{0}", Cafe50.ToString());
                    file.WriteLine("Cafe100,{0}", Cafe100.ToString());
                    file.WriteLine("Extension25,{0}", Extension25.ToString());
                    file.WriteLine("Extension50,{0}", Extension50.ToString());
                    file.WriteLine("Extension100,{0}", Extension100.ToString());
                    file.WriteLine("ExitSign,{0}", ExitSign.ToString());
                    file.WriteLine("SingleDoor,{0}", SingleDoor.ToString());
                    file.WriteLine("DoubleDoor,{0}", DoubleDoor.ToString());
                    file.WriteLine("FireExtinguisher,{0}", FireExtinguisher.ToString());
                    file.WriteLine("BlockCover,{0}", BlockCover.ToString());
                    file.WriteLine("Gutter10,{0}", Gutter10.ToString());
                    file.WriteLine("Gutter15,{0}", Gutter15.ToString());
                    file.WriteLine("Gutter20,{0}", Gutter20.ToString());
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 4
0
 private void setWithObstacles(int posX, int posY, int i)
 {
     if (util.Random.boolValue(5) && doubleDoorCounter < MAX_DOUBLE_DOOR)
     {
         bool hasObstacle = util.Random.boolValue(6);
         if (hasObstacle)
         {
             obsCounter++;
         }
         windows[i] = new DoubleDoor(posX, posY);
         doubleDoorCounter++;
     }
     else
     {
         bool hasObstacle = util.Random.boolValue(5);
         if (hasObstacle)
         {
             obsCounter++;
         }
         windows[i] = new TwoPanels(posX, posY, hasObstacle);
     }
 }