Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        stats             = GetComponent <Stats>();
        gameStatusManager = FindObjectOfType <GameStatusManager>();
        audioSrcs         = GetComponents <AudioSource>();

        //Get all information about the damn dogs.

        GetSubValues(stats);
        //Debug.Log("*********" +allergyRating + " " + breedRating + " " + upKeepRating + " " + ageRating + " "+ energyRating + " " + familyRating + " " + petsRating);

        allergyText = SetStringCategory(allergyCategories, allergyRating);
        breedText   = stats.dogBreed.ToString();
        upKeepText  = SetStringCategory(upKeepCategories, upKeepRating);
        energyText  = SetStringCategory(energyCategories, energyRating);
        ageText     = SetStringCategory(ageCategories, ageRating);
        familyText  = SetStringCategory(familyCategories, familyRating);
        petsText    = SetStringCategory(petCategories, petsRating);

        //Debug.Log(allergyText + " " + breedText + " " + upKeepText + " " + energyText + " " + ageText + " " + familyText + " " + petsText);

        stats = GetComponent <Stats>();
        anim  = GetComponent <Animator>();
        sr    = GetComponent <SpriteRenderer>();

        // determine moveSpeed for the dog
        moveSpeed = maxSpeed * (.5f + (stats.energy / 2));
        Debug.Assert(moveSpeed < maxSpeed);

        // give a random init move direction
        moveDir = Random.onUnitSphere;
    }
Beispiel #2
0
        public static async Task Initialize()
        {
            Logger = new Logger();
            Logger.Log(
                $"Starting [{DateTime.Now.ToLongTimeString()}] ...");

            StartTime = DateTime.UtcNow;

            Configuration = new Configuration();
            Configuration.Initialize();

            Firebase = new Firebase();

            StatusDatabase      = new StatusDatabase();
            FingerprintDatabase = new FingerprintDatabase();
            EventDatabase       = new EventDatabase();
            Logger.Log(
                $"Loaded MySql with {await StatusDatabase.CountAsync()} status(es), {await FingerprintDatabase.CountAsync()} fingerprint(s) & {await EventDatabase.CountAsync()} event(s)");

            EventCache       = new EventCache();
            FingerprintCache = new FingerprintCache();

            GameVersionManager = new GameVersionManager();

            GameStatusManager = new GameStatusManager();
            GameStatusManager.Initialize();

            Logger.Log("Resources initialized.");
        }
Beispiel #3
0
 public void CharacterInspectoinMenuStart()
 {
     database                  = GameObject.Find("_GameManager").GetComponent <DatabaseManager> ();
     gamestatusmanager         = GameObject.Find("_GameManager").GetComponent <GameStatusManager> ();
     CurrentInspectinCharacter = 0;
     UpdateCharacterInspectionText();
 }
Beispiel #4
0
    // Use this for initialization
    void Start()
    {
        tebanManager = GameObject.Find("TebanManager").GetComponent <TebanManager> ();
        tebanManager.isPlayer1Teban = true;
        gameStatusManager           = GameObject.Find("GameStatusManager").GetComponent <GameStatusManager> ();

        InitializeButtons();

        komas [0] = Hiyoko.GetComponent <KomaController> ();
        komas [1] = Kirin.GetComponent <KomaController> ();
        komas [2] = Zou.GetComponent <KomaController> ();
        komas [3] = Lion.GetComponent <KomaController> ();
        komas [4] = eHiyoko.GetComponent <KomaController> ();
        komas [5] = eKirin.GetComponent <KomaController> ();
        komas [6] = eZou.GetComponent <KomaController> ();
        komas [7] = eLion.GetComponent <KomaController> ();

        Print();

//		// 動かし方の例:Hiyoko(3,2)
//		te.from.dan = 0;
//		te.from.suji = 0;
//		te.to.dan = 3;
//		te.to.suji = 2;
//		te.koma = Koma.Hiyoko;
//		te.promote = false;
//		tePrint ();
//		Move (0, ref te);
    }
 public void PauseMenuManagerStart()
 {
     IsPauseMenuActive = true;
     timemanager       = GameObject.Find("_GameManager").GetComponent <TimeManager> ();
     gamestatusmanager = GameObject.Find("_GameManager").GetComponent <GameStatusManager> ();
     timemanager.StopTime();
 }
    public void MainMenuManagerStart()
    {
        gamemanager       = GameObject.Find("_GameManager").gameObject;
        timemanager       = gamemanager.GetComponent <TimeManager> ();
        gamestatusmanager = gamemanager.GetComponent <GameStatusManager> ();

        FullTextUpdate();
    }
 public void InventoryMenuManagerStart()
 {
     InventoryState    = 1;
     gamestatusmanager = GameObject.Find("_GameManager").GetComponent <GameStatusManager> ();
     CreateInventoryUI();
     UpdateInventoryTitle();
     UpdateInventoryUI();
 }
Beispiel #8
0
    void Shoot(Vector3 initPos, Vector3 direction)
    {
        GameStatusManager.StartShooting();
        Ball bulletBall = Instantiate(ball, initPos, Quaternion.identity).GetComponent <Ball>();

        bulletBall.role      = BallRole.Bullet;
        bulletBall.direction = direction;
    }
    public static GameStatusManager GetInstance()
    {
        if (!Instance)
        {
            Container = new GameObject {
                name = "GameStatusManager"
            };
            Instance = Container.AddComponent <GameStatusManager>();
        }

        return(Instance);
    }
Beispiel #10
0
 /// <summary>
 /// Sets up managers when a user is logged in
 /// </summary>
 /// <param name="user">User.</param>
 public static void UserLoggedIn(User user)
 {
     Log.WriteLine(Log.Layer.AL, typeof(Application), "User logged in: " + user);
     User = user;
     GameStatusManager   = new GameStatusManager(user);
     InfoManager         = new InfoManager(user);
     ItemManager         = new ItemManager(user);
     OrderTypeManager    = new OrderTypeManager(user);
     PositionManager     = new PositionManager(user);
     StarSystemManager   = new StarSystemManager(user);
     OrderManager        = new OrderManager(user);
     NotificationManager = new NotificationManager(user);
 }
Beispiel #11
0
    private void Start()
    {
        gm = FindObjectOfType <GameStatusManager>().GetComponent <GameStatusManager>();

        uiManagerScript = FindObjectOfType <UIManagerScript>();

        Debug.Assert(peopleQ == null);
        peopleQ = new List <GameObject>();

        cuemanager = FindObjectOfType <QueueManager>();

        StartCoroutine("PersonSpawner");
    }
 public void MapMenuManagerStart()
 {
     if (IsWorldMapCreated == false)
     {
         gamestatusmanager = GameObject.Find("_GameManager").GetComponent <GameStatusManager> ();
         database          = GameObject.Find("_GameManager").GetComponent <DatabaseManager> ();
         CurrentGameMapID  = 1;
         LoadGameMapContent(CurrentGameMapID);
         CreateGameMap();
     }
     else
     {
     }
 }
Beispiel #13
0
    void Awake()
    {
        _fadeScr = GameObject.FindObjectOfType <ScreenFader>();
        // Create actorA temporary reference to the current scene.
        Scene currentScene = SceneManager.GetActiveScene();

        _sceneName = currentScene.name;
        _sc        = GameObject.Find("UI Controller").GetComponent <GameStatusManager>();
        print("-------- " + _sc.GameStatus.ToString());

        _dta                   = TempDataTracker.GetInstance();
        _settingsReader        = SettingsReader.GetInstance();
        _cam                   = GameObject.Find("Main Camera");
        _environmentController = EnvironmentController.GetInstance();
        _gm = GeneticsManager.GetInstance();
        _co = CollisionMediator.GetInstance();
    }
Beispiel #14
0
    private void Awake()
    {
        _fadeScr = GameObject.FindObjectOfType <ScreenFader>();
        // Create actorA temporary reference to the current scene.
        Scene currentScene = SceneManager.GetActiveScene();

        _sceneName = currentScene.name;
        _sc        = GameObject.Find("UI Controller").GetComponent <GameStatusManager>();
        print("-------- " + _sc.GameStatus.ToString());

        if (_sc.GameStatus == 4)
        {
            print("First start...");
            _dta                   = TempDataTracker.GetInstance();
            _settingsReader        = SettingsReader.GetInstance();
            _cam                   = GameObject.Find("Main Camera");
            _environmentController = EnvironmentController.GetInstance();
            _gm = GeneticsManager.GetInstance();
            _co = CollisionMediator.GetInstance();
            _am = AudioManager.GetInstance();
            PlayerDataTracker pdt = PlayerDataTracker.GetInstance();
            _pd = pdt.Dt;

            var s = _settingsReader.FoodWideSpreadY;
            _defaultN = s;

            PlayerPrefab = Instantiate(PlayerPrefab, new Vector3(0, s, 0), Quaternion.identity);
            PlayerPrefab.gameObject.name = "Player";

            pdt.SetEnergy(_settingsReader.PlayerStartEnergy);

            this.gameObject.GetComponent <EnvironmentColours>().Player = PlayerPrefab;
        }
        else if (_sc.GameStatus == 3)
        {
            Load();
        }

        C = Camera.main;
        C.transform.position = new Vector3(PlayerPrefab.transform.position.x, PlayerPrefab.transform.position.y + 10, PlayerPrefab.transform.position.z);
        C.transform.parent   = PlayerPrefab.transform;
    }
Beispiel #15
0
    void Update()
    {
        if ((data.gameStatus == GameState.GAME_OVER || data.gameStatus == GameState.WINS_GAME))
        {
            return;
        }

        //Todo: slow mo modifier in data for effects later
        DeltaTimeSystem.Parse(ref delta);
        GameStatusManager.Parse(ref world, ref data);

        // Will receive players input and modify controls
        InputReceiver.Parse(delta, world, ref controls);

        CalculateReticle.Parse(ref data, world, controls, settings);

        CharacterMovement.Parse(ref data, ref world, delta, controls, settings);

        ShootingAction.Parse(ref data, ref world, delta, controls, settings);

        EnemyAction.Parse(ref data, ref world, delta, controls, settings);

        CharacterActions.Parse(ref data, world, controls, settings);

        CameraMovement.Parse(ref data, ref world, delta, controls, settings);
        CharacterLaunching.Parse(ref data, ref world, delta, controls, settings);

        // clears input like buttons
        InputDeleter.Parse(ref controls);

        if (data.gameStatus == GameState.GAME_OVER)
        {
            StartCoroutine(Death());
        }

        if (data.gameStatus == GameState.WINS_GAME)
        {
            StartCoroutine(Win());
        }
    }
Beispiel #16
0
    void Start()
    {
        gsm = FindObjectOfType <GameStatusManager>();
        // emotionImage = GameObject.Find("EmotionImage");
        emotionImage = GameObject.Find("EmotionImage");
        //emotionImage.SetActive(false);
        emotions = Resources.LoadAll <Sprite>("Emotions");
        //emotionImage = humanCard.transform.parent.gameObject.GetComponentInChildren<Animator>().gameObject;
        var animalchildren = animalCard.GetComponentsInChildren <Text>();

        Debug.Assert(animalchildren.Length >= 7);

        breedText          = animalchildren[0];
        ageText            = animalchildren[1];
        allergiesText      = animalchildren[2];
        energyText         = animalchildren[3];
        maintenanceText    = animalchildren[4];
        familyFriendlyText = animalchildren[5];
        petFriendlyText    = animalchildren[6];

        animalHeadImg = animalCard.transform.GetChild(0).GetComponent <Image>();

        var humanchildren = humanCard.GetComponentsInChildren <Text>();

        Debug.Assert(humanchildren.Length >= 7);

        ageTextHuman       = humanchildren[0];
        incomeText         = humanchildren[1];
        energyTextHuman    = humanchildren[2];
        allergiesTextHuman = humanchildren[3];
        spaceText          = humanchildren[4];
        familyext          = humanchildren[5];
        petText            = humanchildren[6];

        humanHeadImg = humanCard.transform.GetChild(0).GetComponent <Image>();

        peopleFaceSprites = Resources.LoadAll <Sprite>("PeopleHeads");
    }
Beispiel #17
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        Ball otherBall = other.GetComponent <Ball>();

        if (otherBall == null)
        {
            return;
        }
        if (otherBall.role == BallRole.Follower)
        {
            return;
        }
        else
        {
            float distanceTravelled = follower.GetDistanceTravelled() - 2.0f;
            otherBall.role = BallRole.Follower;
            NodeManager.InsertBallAfter(otherBall, GetComponent <Ball>());

            otherBall.GetComponent <Follower>().SetDistanceTravelled(distanceTravelled);
            otherBall.transform.position = follower.pathCreator.path.GetPointAtDistance(distanceTravelled);
            GameStatusManager.InsertingNode();
        }
    }
Beispiel #18
0
 // Start is called before the first frame update
 void Start()
 {
     gsm        = FindObjectOfType <GameStatusManager>();
     ftb        = FindObjectOfType <FadeToBlack>();
     clockImage = GameObject.Find("ClockImage").GetComponent <Image>();
 }
Beispiel #19
0
 public void DiaryEntryMenuManagerStart()
 {
     gamestatusmanager = GameObject.Find("_GameManager").GetComponent <GameStatusManager> ();
 }
Beispiel #20
0
 void Start()
 {
     GameStatusManager.Ready();
 }
Beispiel #21
0
 // Start is called before the first frame update
 void Start()
 {
     gsm       = FindObjectOfType <GameStatusManager>();
     moneyText = transform.GetChild(0).GetComponent <Text>();
 }
Beispiel #22
0
 public void PauseGame()
 {
     GameStatusManager.SetStatus(GameStates.GamePaused, this);
 }
Beispiel #23
0
 public void UnPauseGame()
 {
     GameStatusManager.SetStatus(GameStates.GameRuns, this);
 }
 public void DiaryManagerStart()
 {
     gamestatusmanager = GameObject.Find("_GameManager").GetComponent <GameStatusManager> ();
     GetComponent <DiaryInputReader> ().DiaryReaderStart();
 }
Beispiel #25
0
 // Start is called before the first frame update
 void Start()
 {
     pauseMenuUI.SetActive(false);
     gsm = FindObjectOfType <GameStatusManager>();
 }
Beispiel #26
0
    //[SerializeField]
    //private GameObject levelUI;

    private void Start()
    {
        //levelUI.SetActive(true);
        GameStatusManager.SetStatus(GameStates.GameRuns, this);
    }
Beispiel #27
0
 public void CharacterCreationMenuStart()
 {
     gamestatusmanager = GameObject.Find("_GameManager").GetComponent <GameStatusManager> ();
 }
Beispiel #28
0
 /// <summary>
 /// Sets up managers when a user is logged in
 /// </summary>
 /// <param name="user">User.</param>
 public static void UserLoggedIn(User user)
 {
     Log.WriteLine (Log.Layer.AL, typeof(Application), "User logged in: " + user);
     User = user;
     GameStatusManager = new GameStatusManager (user);
     InfoManager = new InfoManager (user);
     ItemManager = new ItemManager (user);
     OrderTypeManager = new OrderTypeManager (user);
     PositionManager = new PositionManager (user);
     StarSystemManager = new StarSystemManager (user);
     OrderManager = new OrderManager (user);
     NotificationManager = new NotificationManager (user);
 }