public void StartText(TextBehaviour text)
    {
        sentences.Clear();
        DayManager manager = null;

        if (GameObject.Find("Player") != null)
        {
            manager = GameObject.Find("Player").GetComponent <DayManager>();
        }
        foreach (string sentence in text.sentences)
        {
            if (manager != null)
            {
                if (manager.alreadyTypo.Contains(sentence))
                {
                    continue;
                }
                else
                {
                    manager.alreadyTypo.Add(sentence);
                }
            }
            sentences.Enqueue(sentence);
        }

        DisplayNextSentence();
    }
Example #2
0
    public Arena()
    {
        instance = this;

        mapData = MapGenerator.Generate();

        FSprite bgSprite = new FSprite("Arena/BG_1");

        AddChild(bgSprite);

        AddChild(entityArea = new EntityArea());
        float inset = 13;

        entityArea.bounds.x      = -Config.WIDTH / 2 + inset;
        entityArea.bounds.y      = -Config.HEIGHT / 2 + inset;
        entityArea.bounds.width  = Config.WIDTH - inset * 2;
        entityArea.bounds.height = Config.HEIGHT - inset * 2;

        colorOverlay        = new FSprite("WhiteBox");
        colorOverlay.color  = new Color(1, 1, 1, 0);
        colorOverlay.width  = Config.WIDTH;
        colorOverlay.height = Config.HEIGHT;
        entityArea.overlayContainer.AddChild(colorOverlay);

        AddChild(frontContainer = new FContainer());

        dayManager = new DayManager();

        CreateBuildings();
        SetupPlayers();

        ListenForUpdate(Update);
    }
    // Use this for initialization
    void Start()
    {
        dayManager = FindObjectOfType <DayManager>();

        dayManager.start += startLine;
        updateEvent();
    }
Example #4
0
        public ActionResult CLassroomAllocation(ClassAllocation aClassAllocation)
        {
            DepartmentManager aDepartmentManager = new DepartmentManager();
            CourseManager     aCourseManager     = new CourseManager();
            RoomManager       aRoomManager       = new RoomManager();
            DayManager        aDayManager        = new DayManager();

            ViewBag.departments = aDepartmentManager.GetAllDepartmentInfo();
            ViewBag.courses     = aCourseManager.GetAllCourse();
            ViewBag.rooms       = aRoomManager.GetAllRoom();
            ViewBag.days        = aDayManager.GetAllDay();
            ClassAllocationManager aClassAllocationManager = new ClassAllocationManager();

            List <ClassAllocation> alist = aClassAllocationManager.GetAllocatedClassInfo();

            if (aClassAllocationManager.CLassroomAllocation(aClassAllocation) > 0)
            {
                ViewBag.message = "Classrooms are Successfully allocated";
            }
            else
            {
                ViewBag.message = "Allocation Failed";
            }
            return(View());
        }
Example #5
0
 // Use this for initialization
 void Start()
 {
     isEvent = false;
     eventObj.SetActive(isEvent);
     eventURL = "http://nomossgames.com/wegotchi/events.html";
     dayMan   = GameObject.Find("day_manager").GetComponent <DayManager>();
 }
 public ActionResult Allocate()
 {
     ViewBag.departments = DepartmentManager.GetAllDepartmentForDropdown();
     ViewBag.rooms       = RoomManager.GetAllRoomForDropdown();
     ViewBag.days        = DayManager.GetAllDayForDropdown();
     return(View());
 }
Example #7
0
    public void Generate()
    {
        gameObject.SetActive(true);

        int diff = DayManager.instance.excitement - lastExcitement;

        graph.sprite   = diff > 0 ? upwardGraph : diff < 0 ? downwardGraph : neutralGraph;
        lastExcitement = DayManager.instance.excitement;

        views.text = Mathf.RoundToInt(
            Random.value * Mathf.Pow(10, 1 + 2 * Mathf.Log(Mathf.Max(1, DayManager.instance.excitement)))).ToString();
        advice.text = DayManager.note;

        foreach (Transform transform in comments)
        {
            Destroy(transform.gameObject);
        }

        foreach (CommentChain commentChain in CommentChainManager.comments.OrderBy(c => c.adviceRating).Take(3))
        {
            CommentChain.Comment comment = commentChain.comments.OrderBy(c => Random.value).FirstOrDefault();
            CommentChainManager.CreateComment(comments, commentChain, comment, messagePrefab).GetComponentInChildren <TextMeshProUGUI>().fontSize = 16;
        }

        DayManager.Delay(0, delegate {
            // Force layout rebuild
            VerticalLayoutGroup layout = comments.GetComponent <VerticalLayoutGroup>();
            layout.enabled             = false;
            layout.enabled             = true;
        });
    }
Example #8
0
 // Use this for initialization
 void Start()
 {
     dayMan = GameObject.Find("day_manager").GetComponent <DayManager>();
     if (dayMan.isRealTime)
     {
         gameObject.SetActive(false);
     }
 }
 public ClassRoomAllocationController()
 {
     courseManager = new CourseManager();
     classRoomAllocationManager   = new ClassRoomAllocationManager();
     assignCourseToTeacherManager = new AssignCourseToTeacherManager();
     dayManager  = new DayManager();
     roomManager = new RoomManager();
 }
 public AllocateClassroomController()
 {
     departmentManager    = new DepartmentManager();
     courseManager        = new CourseManager();
     roomManager          = new RoomManager();
     dayManager           = new DayManager();
     allocateClassManager = new AllocateClassManager();
 }
 private void OnDestroy()
 {
     if (instance_ == this)
     {
         instance_ = null;
     }
     GameManager.Instance.CurtainOpened -= GameManager_CurtainOpened;
 }
Example #12
0
        public ActionResult RefreshChainLength(int id)
        {
            DayManager dm          = new DayManager(db);
            Habit      habit       = db.Habits.First(h => h.DayStatuses.Select(s => s.DayStatusId).Contains(id));
            int        chainLength = dm.CountChainLength(habit);

            return(Json(chainLength.ToString(), JsonRequestBehavior.AllowGet));
        }
 public AllocateClassroomController()
 {
     _allocateClassroomManager = new AllocateClassroomManager();
     _departmentManager        = new DepartmentManager();
     _courseManager            = new CourseManager();
     _dayManager  = new DayManager();
     _roomManager = new RoomManager();
 }
 public AllocateClassroomController()
 {
     DepartmentManager = new DepartmentManager();
     RoomManager       = new RoomManager();
     DayManager        = new DayManager();
     CourseManager     = new CourseManager();
     ClassRoomManager  = new ClassRoomManager();
 }
Example #15
0
 public ClassRoomController()
 {
     aRoomManager              = new RoomManager();
     aDayManager               = new DayManager();
     aDepartmentManager        = new DepartmentManager();
     aCourseManager            = new CourseManager();
     aAllocateClassroomManager = new AllocateClassroomManager();
 }
Example #16
0
    private void Start()
    {
        dayManager     = GetComponent <DayManager>();
        messageManager = GetComponent <MessageManager>();

        upgradeOpen = false;

        openTab = null;
    }
Example #17
0
        public ActionResult ChangeStatus(string statusName, int dayId)
        {
            DayManager dm = new DayManager(db);

            dm.ChangeStatus(statusName, dayId);
            Habit habit       = db.Habits.First(h => h.DayStatuses.Select(s => s.DayStatusId).Contains(dayId));
            int   chainLength = dm.CountChainLength(habit);

            return(Json(chainLength.ToString(), JsonRequestBehavior.AllowGet));
        }
Example #18
0
        public ActionResult GetAllNotes(int habitId)
        {
            DayManager dm = new DayManager(db);

            List <NoteView> notes = dm.GetAllNotes(habitId);

            string notesJSON = Newtonsoft.Json.JsonConvert.SerializeObject(notes);

            return(Json(notesJSON, JsonRequestBehavior.AllowGet));
        }
Example #19
0
    private void Start()
    {
        var lGameState = GameController.instance.GameState;

        this.mDayManager = lGameState.DayManager;

        this.mEnemyPool = ObjectPool.FindEnemyObjectPool();

        this.mPlayer = GameObject.FindGameObjectWithTag(GameObjectTags.Player);
    }
Example #20
0
 private void Awake()
 {
     if (m_Instance != null && m_Instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         m_Instance = this;
     }
 }
 void Awake()
 {
     player             = GameObject.Find("Player");
     _sleepingAndWaking = player.GetComponent <SleepingAndWaking>();
     _needs             = player.GetComponent <Needs>();
     _FPSController     = player.GetComponent <FirstPersonController>();
     _dreamText         = GameObject.Find("Dream Canvas").GetComponent <DreamText>();
     _dayManager        = GetComponent <DayManager>();
     m_CamBackground    = Camera.main.gameObject.GetComponent <CamBackgroundColor>();
     r_sleepScript      = GameObject.Find("Player").GetComponent <SleepingAndWaking>();
     LoadScene(Scenes.Cell);
 }
Example #22
0
 // This is called before Start()
 private void Awake()
 {
     if (Instance == null)              // if instance doesn't contain anything, this script is running for the first time
     {
         Instance = this;               // set this curr instance to be contained inside ^ the static instance
         DontDestroyOnLoad(gameObject); // don't detroy the first instance
     }
     else
     {
         Destroy(gameObject); // destory other duplicated instances
     }
 }
    public void Awake()
    {
        enemyList = new List<GameObject>();
        friendlyList = new List<GameObject>();
        spawnList = new List<int>();
        dayManager = FindObjectOfType<DayManager>().GetComponent<DayManager>();

        spawnFlag = false;

        StartCoroutine(GameStateCheck());
        StartCoroutine(EnemySpawn());
    }
Example #24
0
 //public void GameManagerSetup()
 //{
 //    Init();
 //    //InitManagers();
 //}
 private void Init()
 {
     timeManager   = GetComponentInChildren <TimeManager>();
     inputManager  = GetComponentInChildren <InputManager>();
     cameraManager = GetComponentInChildren <CameraManager>();
     dayManager    = GetComponentInChildren <DayManager>();
     fSMManager    = GetComponentInChildren <FSMManager>();
     uIManager     = GetComponentInChildren <UIManager>();
     skyManager    = GetComponentInChildren <SkyManager>();
     levelManager  = GetComponentInChildren <LevelManager>();
     tabboz        = GetComponentInChildren <Tabboz3D>();
 }
 void Awake()
 {
     // static singleton for global public access
     if (Day != null)
     {
         GameObject.Destroy(Day);
     }
     else
     {
         Day = this;
     }
     DontDestroyOnLoad(this);
 }
Example #26
0
        //
        // GET: /ClassAllocate/
        public ActionResult CLassroomAllocation()
        {
            DepartmentManager aDepartmentManager = new DepartmentManager();
            //CourseManager aCourseManager = new CourseManager();
            RoomManager aRoomManager = new RoomManager();
            DayManager  aDayManager  = new DayManager();

            ViewBag.departments = aDepartmentManager.GetAllDepartmentInfo();
            ViewBag.courses     = aCourseManager.GetAllCourse();
            ViewBag.rooms       = aRoomManager.GetAllRoom();
            ViewBag.days        = aDayManager.GetAllDay();
            return(View());
        }
    private void Awake()
    {
        if (instance_ == null)
        {
            instance_ = this;
        }
        else if (instance_ != this)
        {
            Destroy(this);
        }

        timer.TimeUp.AddListener(HandleTimerTimeOut);
    }
Example #28
0
    // Act while live
    public override void Play(DrugState state)
    {
        Sprite originalMouth = state.slug.mouth.sprite;
        Sprite originalEyes  = state.slug.eyes.sprite;

        state.slug.mouth.sprite = sneezeMouth;
        state.slug.eyes.sprite  = sneezeEyes;
        state.slug.audio.PlayOneShot(sneezeSound);

        DayManager.Delay(sneezeSound.length / state.slug.audio.pitch, delegate {
            state.slug.mouth.sprite = originalMouth;
            state.slug.eyes.sprite  = originalEyes;
        });
    }
Example #29
0
 void Update()
 {
     if (Time.time - startTime >= nextSceneTime)
     {
         DayManager.LoadDay();
     }
     else if (Time.time - startTime >= blacknessTime)
     {
         nightBlocker.SetActive(true);
     }
     else if (Time.time - startTime >= lightsOutTime)
     {
         renderer.material.color = Color.black;
     }
 }
    public override void Action(GameObject player)
    {
        TaskList tl = player.GetComponent <TaskList>();

        if (!tl.IsTaskDone(barrierTask))
        {
            SpeechController speechController = player.GetComponent <SpeechController>();
            speechController.UpdateTexts(tl.GetBarrierMessage(barrierTask));
            speechController.StartSpeech(player);
        }
        else
        {
            DayManager.GotoNextDay();
        }
    }
Example #31
0
    void Start()
    {
        // health component
        HealthBar.maxValue = PlayerManager.Instance.PlayerMaxHealth;
        HealthBar.value    = PlayerManager.Instance.PlayerCurrHealth;

        // hunger component
        HungerBar.maxValue = PlayerManager.Instance.PlayerMaxHunger;
        HungerBar.value    = PlayerManager.Instance.PlayerCurrHunger;

        // thirst component
        ThirstBar.maxValue = PlayerManager.Instance.PlayerMaxThirst;
        ThirstBar.value    = PlayerManager.Instance.PlayerCurrThirst;

        theDay = FindObjectOfType <DayManager>();
    }
Example #32
0
    public Arena()
    {
        instance = this;

        mapData = MapGenerator.Generate();

        FSprite bgSprite = new FSprite("Arena/BG_1");
        AddChild(bgSprite);

        AddChild(entityArea = new EntityArea());
        float inset = 13;
        entityArea.bounds.x = -Config.WIDTH/2 + inset;
        entityArea.bounds.y = -Config.HEIGHT/2 + inset;
        entityArea.bounds.width = Config.WIDTH - inset*2;
        entityArea.bounds.height = Config.HEIGHT - inset*2;

        colorOverlay = new FSprite("WhiteBox");
        colorOverlay.color = new Color(1,1,1,0);
        colorOverlay.width = Config.WIDTH;
        colorOverlay.height = Config.HEIGHT;
        entityArea.overlayContainer.AddChild(colorOverlay);

        AddChild(frontContainer = new FContainer());

        dayManager = new DayManager();

        CreateBuildings();
        SetupPlayers();

        ListenForUpdate(Update);
    }
	void Awake()
	{
		_DayManager = GameObject.FindGameObjectWithTag("DataManager").GetComponent<DayManager>();

		_ReturningPoint = this.transform.position;
	}
Example #34
0
 void Awake()
 {
     if (instance == null)
         instance = this;
 }