예제 #1
0
 public void Awake()
 {
     audio = GetComponent<AudioSource>();
     dayController = GameObject.Find("GameManager").GetComponent<DayController>();
     alarmClock = GameObject.Find("AlarmClock");
     deathInitiated = false;
 }
예제 #2
0
    // Use this for initialization
	void Start ()
	{
        rb = GetComponent<Rigidbody2D>();
	    boxCollider = GetComponent<BoxCollider2D>();
        playerText = GameObject.Find("Zaal").GetComponent<PlayerText>();
        dayController = GameObject.Find("GameManager").GetComponent<DayController>();

        cowController = GameObject.Find("CowContainer").GetComponent<CowController>();
        cowActions = new CowAction[4];
        cowActions[0] = () => { };
        cowActions[1] = cowController.AccelerateCows;
        cowActions[2] = cowController.ReverseCows;
        cowActions[3] = cowController.AlternateCowPaths;

	    GameObject planeObject = GameObject.Find("PlaneContainer");
        planeActions = new PlaneAction[4];
	    if (planeObject != null)
	    {
	        planeController = planeObject.GetComponent<PlaneController>();
            planeActions[0] = () => { };
            planeActions[1] = planeController.AcceleratePlane;
            planeActions[2] = planeController.ReversePlane;
            planeActions[3] = planeController.AlternatePlanePath;
	    }
	}
예제 #3
0
파일: Door.cs 프로젝트: ahung89/DarkhogDay
 void Awake()
 {
     playerText = GameObject.Find("Textbox").GetComponent<PlayerText>();
     dayController = GameObject.Find("GameManager").GetComponent<DayController>();
     task1 = GameObject.Find("AlarmClock").GetComponent<InteractiveObject>();
     task2 = GameObject.Find("Microwave").GetComponent<InteractiveObject>();
     task3 = GameObject.Find("Dresser").GetComponent<InteractiveObject>();
 }
예제 #4
0
        public void DayControllerTest()
        {
            var rnd  = new Random();
            var date = rnd.Next(1, 29) + "." + rnd.Next(1, 13) + "." + rnd.Next(2012, 2019);
            //var date = DateTime.Today.AddDays(rnd.Next(500));

            var controller = new DayController(date);

            Assert.AreEqual(date, controller.CurrentDay.Date);
        }
예제 #5
0
    // Start is called before the first frame update
    // Acts as a initialzing method.
    void Start()
    {
        var temp = GameObject.FindGameObjectWithTag("DayController");

        if (temp != null)
        {
            dayController = temp.GetComponent <DayController>();
            dayController.Subscribe(this);
            dayCycle = dayController.GetDayCycle();
            //Sets initial state
            SetSpawnState();
        }
        spawnPoints = FindObjectOfType <MoveSpots>();
    }
    public void DaySelected(DayController day)
    {
        // select and deslect days
        foreach (DayController d in days)
        {
            if (d == day)
            {
                d.ChangeImg(true);
                selected = d;
            }
            else
            {
                d.ChangeImg(false);
            }
        }

        //activate day details
        dayDetails.SetActive(true);
        //setup day details
    }
예제 #7
0
    // Start is called before the first frame update
    void Start()
    {
        dayController = GameObject.Find("DayController").GetComponent <DayController>();
        messageText   = GameObject.Find("Canvas/MessageText");

        Present   = GameObject.Find("PresentBox");
        Present_O = GameObject.Find("PresentBox_O");
        //PresentContain = GameObject.Find("Benz");

        Fader      = GameObject.Find("Fader");
        SnowEffect = GameObject.Find("Snow");
        Material fade = Fader.GetComponent <Renderer>().material;
        Material snow = SnowEffect.GetComponent <Renderer>().material;

        fade.color = new Color(0.0f, 0.0f, 0.0f, fadeOpacity);
        snow.color = new Color(0.0f, 0.0f, 0.0f, snowOpacity);

        Present_O.SetActive(false);
        //PresentContain.SetActive(false);
    }
예제 #8
0
    public void Start()
    {
        GameObject temp = GameObject.FindGameObjectWithTag("DayController");

        if (temp != null)
        {
            dayController = temp.GetComponent <DayController>();
        }
        else
        {
            Debug.Log("Can't Find DayController");
        }

        if (dayController != null)
        {
            dayController.Subscribe(this);
            dayCycle = dayController.GetDayCycle();
            UpdateIndicator();
        }
        else
        {
            Debug.Log("DayController not referenced.");
        }
    }
예제 #9
0
        static void Main(string[] args)
        {
            while (true)
            {
                Console.WriteLine("Приветики! Я - ежедневник.");
                Console.WriteLine("Я помогу в отслеживании твоих планов на день и буду следить за их выполнением.");

                Console.WriteLine("Как тебя зовут?");
                var name = Console.ReadLine();

                var userController = new UserController(name);

                if (userController.IsNewUser)
                {
                    Console.WriteLine("Введите пол");
                    var gender = Console.ReadLine();
                    userController.SetNewUserData(gender);
                }
                while (true)
                {
                    Console.WriteLine("Введите дату в формате день.месяц.год");
                    var dayController = new DayController(Console.ReadLine());
                    dayController.DayMenu();
                    Console.WriteLine("Чтобы выйти введите \"exit\", чтобы продолжить нажмите \"Enter\".");
                    if (Console.ReadLine() == "exit")
                    {
                        break;
                    }
                }
                Console.WriteLine("Чтобы выйти введите \"exit\", чтобы продолжить нажмите \"Enter\".");
                if (Console.ReadLine() == "exit")
                {
                    break;
                }
            }
        }
예제 #10
0
 // Start is called before the first frame update
 void Start()
 {
     dayController = GameObject.Find("DayController").GetComponent <DayController>();
 }
예제 #11
0
    void InitializeScheduleTime()
    {
        var dayOfWeek = (int)DataManager.dateNewAppointment.DayOfWeek;

        limit = DataManager.currentResponsible.timeToFinishWork [dayOfWeek];
        begin = DataManager.currentResponsible.timeToBeginWork [dayOfWeek];
        List <AppointmentModel> appointmentList = new List <AppointmentModel> ();
        var         isOneInOneHour     = PlayerPreferences.oneInOneHour;
        int         index              = 0;
        bool        isResponsible      = false;
        var         newAppointmentDate = new DateTime(appointmentYear, appointmentMonth, appointmentDay);
        CultureInfo provider           = new CultureInfo("pt-BR");

        if (DataManager.currentResponsible.userID == DataManager.currentUser.userID)
        {
            isResponsible = true;
        }

        DataManager.responsibleAppointmentList.ForEach(x => {
            if (DateTime.ParseExact(x.data, Constants.dateformat, provider) == newAppointmentDate)
            {
                appointmentList.Add(x);
            }
        });

        if (appointmentList != null)
        {
            appointmentList.Sort((first, second) => ((new DateTime(appointmentYear, appointmentMonth, appointmentDay, first.hour, first.minute, 0)).CompareTo((new DateTime(appointmentYear, appointmentMonth, appointmentDay, second.hour, second.minute, 0)))));
        }

        if (!isOneInOneHour)
        {
            limit = (limit - begin) * 2;
        }
        var into = false;

        for (var i = 0; i < limit; i++)
        {
            if (appointmentList != null && index < appointmentList.Count)
            {
                var initAppointmentDateTime   = (new DateTime(appointmentYear, appointmentMonth, appointmentDay, appointmentList [index].hour, appointmentList [index].minute, 0));
                var finishAppointmentDateTime = (new DateTime(appointmentYear, appointmentMonth, appointmentDay, appointmentList [index].hour, appointmentList [index].minute, 0)).AddMinutes(appointmentList [index].durationInMinutes);

                if (into)
                {
                    if (finishAppointmentDateTime.CompareTo(dt) > 0)
                    {
                        var description = "";
                        if (isResponsible)
                        {
                            description = appointmentList [index].userName;
                        }
                        else
                        {
                            description = "Ocupado";
                        }
                        var cell = DayController.Instantiate(cellPrefabTransform, dt.Hour.ToString() + ":" + dt.Minute.ToString("00"), description, false);
                        cell.GetComponent <Button> ().interactable = false;
                        cellList.Add(cell);
                        into = true;
                        dt   = dt.AddMinutes(isOneInOneHour ? 60 : 30);
                    }
                    else
                    {
                        into = false;
                        limit++;
                        index++;
                    }
                }
                else
                {
                    if (initAppointmentDateTime.CompareTo(dt) == 0)
                    {
                        var description = "";
                        if (isResponsible)
                        {
                            description = appointmentList [index].userName;
                        }
                        else
                        {
                            description = "Ocupado";
                        }
                        var cell = DayController.Instantiate(cellPrefabTransform, dt.Hour.ToString() + ":" + dt.Minute.ToString("00"), description, false);
                        cell.GetComponent <Button> ().interactable = false;
                        cellList.Add(cell);
                        into = true;
                    }
                    else
                    {
                        cellList.Add(DayController.Instantiate(cellPrefabTransform, dt.Hour.ToString() + ":" + dt.Minute.ToString("00"), "Livre"));
                    }
                    dt = dt.AddMinutes(isOneInOneHour ? 60 : 30);
                }
            }
            else
            {
                cellList.Add(DayController.Instantiate(cellPrefabTransform, dt.Hour.ToString() + ":" + dt.Minute.ToString("00"), "Livre"));
                dt = dt.AddMinutes(isOneInOneHour ? 60 : 30);
            }
        }
    }
예제 #12
0
    // Update is called once per frame
    void Update()
    {
        ChangeTimeOfDay DayController;

        DayController.ChangeDay();
    }