/// <summary>
 /// Define Singleton
 /// </summary>
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     manager   = FindObjectOfType <ObjectiveManager>() ?? throw new Exception("Could not find manager");
     listItems = new Dictionary <Objective, GameObject>();
     ObjectiveManager.onObjectiveAdded   += OnObjectiveAdded;
     ObjectiveManager.onObjectiveRemoved += OnObjectiveRemoved;
 }
Ejemplo n.º 3
0
    //////////////////////////////////////////////////
    // Functions
    //////////////////////////////////////////////////
    #region Functions
    void Awake()
    {
        // If this is the only object if this type set the instance
        // if it isn't then destroy the game object attached to this script
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(this);

        // Getting the music manager
        m_musicManager = GetComponent <MusicManager>();

        // Getting the objective manager
        m_objectiveManager = GetComponent <ObjectiveManager>();

        // Find the fader object, helps when changing scenes
        if (m_fadeInOut == null)
        {
            m_fadeInOut = GameObject.FindGameObjectWithTag("Fader").GetComponent <Image>();
        }

        // Turn on the fade
        m_fadeInOut.gameObject.SetActive(true);
    }
 //One method for the Objective manager to call to pass through the required values
 public void ObjectivesSetup(List <int> inputList, List <int> expectedOutputs, ObjectiveManager objManager, TMP_Text outputText)
 {
     this.inputList       = inputList;
     this.expectedOutputs = expectedOutputs;
     this.objManager      = objManager;
     this.outputText      = outputText;
 }
Ejemplo n.º 5
0
    public void InitObjective()
    {
        // add this objective to the list contained in the objective manager
        ObjectiveManager objectiveManager = FindObjectOfType <ObjectiveManager>();

        //DebugUtility.HandleErrorIfNullFindObject<ObjectiveManager, Objective>(objectiveManager, this);
        objectiveManager.RegisterObjective(this);

        // register this objective in the ObjectiveHUDManger
        m_ObjectiveHUDManger = FindObjectOfType <ObjectiveHUDManger>();
        //        DebugUtility.HandleErrorIfNullFindObject<ObjectiveHUDManger, Objective>(m_ObjectiveHUDManger, this);
        if (m_ObjectiveHUDManger)
        {
            m_ObjectiveHUDManger.RegisterObjective(this);
        }


        // register this objective in the NotificationHUDManager
        m_NotificationHUDManager = FindObjectOfType <NotificationHUDManager>();
        // DebugUtility.HandleErrorIfNullFindObject<NotificationHUDManager, Objective>(m_NotificationHUDManager, this);
        if (m_NotificationHUDManager)
        {
            m_NotificationHUDManager.RegisterObjective(this);
        }
    }
Ejemplo n.º 6
0
 private void Awake()
 {
     instance = this;
     notificationTextMenuTextMesh = notificationTextMenu.GetComponent <TextMeshProUGUI>();
     notificationTextMenuAnimator = notificationTextMenu.GetComponent <Animator>();
     actualClueController         = AnimatedClueController.Instance();
 }
    public static void OnClick()
    {
        //Finds all of the start blocks and calls there start interpreter method.

        IEnumerable <GameObject> startBlocks = GameObject.FindGameObjectsWithTag("CodeBlock").Where(b => b.GetComponent <StartBlock>() != null);
        //Checks that there arent more than one start block on the canvas

        ObjectiveManager objManager = FindObjectOfType <ObjectiveManager>();

        if (startBlocks.Where(b => b.transform.parent.tag == "CodeList").Count() > 1)
        {
            objManager.SetInstruction("Too many start blocks on canvas!");
            Debug.Log("Too many start blocks on canvas!");
        }
        else if (startBlocks.Where(b => b.transform.parent.tag == "CodeList").Count() == 1)
        {
            objManager.SetInstruction();
            //Finds the start block that is
            startBlocks.Where(b => b.transform.parent.tag == "CodeList")
            .FirstOrDefault().GetComponent <StartBlock>().StartInterpreter();
        }
        else
        {
            Debug.Log("No start block on canvas!");
            objManager.SetInstruction("No start block on canvas!");
        }
    }
Ejemplo n.º 8
0
    private void Awake()
    {
        canvases = GameObject.Find("Canvases");

        foreach (Canvas canvas in canvases.GetComponentsInChildren <Canvas>(true))
        {
            if (canvas.gameObject.name.Equals("Inventory Canvas"))
            {
                inventoryCanvas = canvas.gameObject;
            }
            else if (canvas.gameObject.name.Equals("Meters Canvas"))
            {
                metersCanvas = canvas.gameObject;
            }
            else if (canvas.gameObject.name.Equals("Dialogue Canvas"))
            {
                dialogueCanvas = canvas.gameObject;
            }
            else if (canvas.gameObject.name.Equals("Trade Canvas"))
            {
                tradeCanvas = canvas.gameObject;
            }
            else if (canvas.gameObject.name.Equals("Death Canvas"))
            {
                deathCanvas = canvas.gameObject;
            }
            else if (canvas.gameObject.name.Equals("Segue Canvas"))
            {
                segueCanvas = canvas.gameObject;
            }
            else if (canvas.gameObject.name.Equals("NPC Interacted Canvas"))
            {
                npcInteractedCanvas = canvas.gameObject;
            }
            else if (canvas.gameObject.name.Equals("Tooltip Canvas"))
            {
                tooltipCanvas = canvas.gameObject;
            }
        }

        keyboardManager  = GameObject.Find("Keyboard Manager");
        deathManager     = GameObject.Find("Death Manager");
        player           = GameObject.Find("Player");
        sceneManagement  = GameObject.Find("Scene Management");
        itemLoader       = GameObject.Find("Item Manager");
        objectiveManager = GameObject.Find("Objective Manager").GetComponent <ObjectiveManager>();
        gameStateManager = GameObject.Find("Game State Manager");
        tooltipManager   = tooltipCanvas.GetComponent <TooltipManager>();
        foreach (Transform child in tooltipCanvas.GetComponentsInChildren <Transform>(true))
        {
            if (child.gameObject.name.Equals("Keybinds"))
            {
                keybinds = child.gameObject;
            }
            if (child.gameObject.name.Equals("Points"))
            {
                pointsText = child.gameObject;
            }
        }
    }
Ejemplo n.º 9
0
    void OnSceneChanged(SceneParent parent)
    {
        m_sceneParent = parent;
        if (m_sceneParent && m_sceneParent.BossNeutralSprite)
        {
            m_portraitImage.sprite  = parent.BossNeutralSprite;
            m_portraitImage.enabled = true;
        }
        else
        {
            m_portraitImage.enabled = false;
        }

        GameObject ghostSpawnObject = GameObject.Find("GhostSpawnManager");

        m_ghostSpawnManager = ghostSpawnObject ? ghostSpawnObject.GetComponent <SpawnManager>() : null;

        if (m_objectiveManager)
        {
            m_objectiveManager.OnObjectiveIncremented -= OnObjectiveIncremented;
        }
        m_objectiveManager = FindObjectOfType <ObjectiveManager>();
        if (m_objectiveManager)
        {
            m_objectiveManager.OnObjectiveIncremented += OnObjectiveIncremented;
        }
    }
Ejemplo n.º 10
0
    // Start is called before the first frame update
    void Start()
    {
        Objective[] list;
        list = FindObjectsOfType <Objective>();
        for (int i = 0; i < list.Length; i++)
        {
            list[i].Deactivate();
        }

        if (Instance != null)
        {
            Destroy(gameObject);
            return;
        }

        Instance = this;
#if UNITY_STANDALONE
        if (startOnPlay)
        {
            if (starter != null)
            {
                starter.Activate();
            }
        }
#endif
    }
Ejemplo n.º 11
0
 private void Start()
 {
     m_ObjectiveManager = FindObjectOfType <ObjectiveManager>();
     rb            = GetComponent <Rigidbody>();
     stoneInstance = GetComponent <GameObject>();
     ki_audio      = GetComponent <AudioSource>();
 }
Ejemplo n.º 12
0
        public KinectRagdollGame()
        {
            Main = this;

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth  = WIDTH;
            graphics.PreferredBackBufferHeight = HEIGHT;


            Content.RootDirectory = "Content";

            FarseerTextures.Init();
            FarseerTextures.SetGame(this);

            kinectManager  = new KinectManager();
            farseerManager = new FarseerManager(true, this);
            ragdollManager = new RagdollManager();

            actionCenter = new ActionCenter(this);
            inputManager = new InputManager(this);

            //spriteHelper = new SpriteHelper();
            objectiveManager      = new ObjectiveManager(this);
            powerupManager        = new PowerupManager(ragdollManager, farseerManager);
            jukebox               = new Jukebox();
            hazardManager         = new HazardManager(farseerManager, ragdollManager);
            particleEffectManager = new ParticleEffectManager(graphics, ref farseerProjection);

            toolbox = new Toolbox(this);


            this.IsMouseVisible = true;
            bkColor             = Color.CornflowerBlue;
        }
Ejemplo n.º 13
0
 void Start()
 {
     if (isServer)
     {
         _objectiveManager = ObjectiveManager.Singleton();
         StartCoroutine(EatCheck());
     }
 }
Ejemplo n.º 14
0
 public static void SetLevelReferences()
 {
     playerObject         = GameObject.Find("PlayerReferenceObject(Clone)");
     mainCamera           = playerObject.transform.Find("Main Camera").gameObject;
     levelUI              = GameObject.Find("UI");
     mainObjectiveManager = GetLevelUIReference().transform.Find("Player Objectives").GetComponent <ObjectiveManager> ();
     inventory            = levelUI.transform.Find("Inventory").gameObject;
 }
Ejemplo n.º 15
0
 void Start()
 {
     player           = GameObject.Find("Player");
     objectiveManager = player.GetComponent <ObjectiveManager>();
     audioSource      = gameObject.GetComponent <AudioSource>();
     sr = gameObject.GetComponent <SpriteRenderer>();
     dc = gameObject.GetComponent <DialogueContainer>();
 }
Ejemplo n.º 16
0
    void Start()
    {
        m_Player = FindObjectOfType <PlayerCharacterController>();

        m_ObjectiveManager = FindObjectOfType <ObjectiveManager>();

        AudioUtility.SetMasterVolume(1);
    }
Ejemplo n.º 17
0
    void Start()
    {
        inventory  = GetComponent <Inventory>();
        objectives = GetComponent <ObjectiveManager>();
        player     = GetComponent <HFPS_GameManager>().Player;
        switcher   = player.GetComponentInChildren <ScriptManager>().GetScript <ItemSwitcher>();

        JsonManager.Settings(SaveLoadSettings, true);

        if (saveableDataPairs.Any(pair => pair.Instance == null))
        {
            Debug.LogError("[SaveGameHandler] Some of Saveable Instances are missing or it's destroyed. Please select Setup SaveGame again from the Tools menu!");
            return;
        }

        if (Prefs.Exist(Prefs.LOAD_STATE))
        {
            int loadstate = Prefs.Game_LoadState();

            if (loadstate == 0)
            {
                DeleteNextLvlData();
            }
            else if (loadstate == 1 && Prefs.Exist(Prefs.LOAD_SAVE_NAME))
            {
                string filename = Prefs.Game_SaveName();

                if (File.Exists(JsonManager.GetFilePath(FilePath.GameSavesPath) + filename))
                {
                    JsonManager.DeserializeData(filename);
                    string loadScene = (string)JsonManager.Json()["scene"];
                    lastSave = filename;

                    if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == loadScene)
                    {
                        LoadSavedSceneData(true);
                    }
                }
                else
                {
                    Debug.Log("<color=yellow>[SaveGameHandler]</color> Could not find load file: " + filename);
                    Prefs.Game_LoadState(0);
                }
            }
            else if (loadstate == 2 && Prefs.Exist(Prefs.LOAD_SAVE_NAME) && dataBetweenScenes)
            {
                JsonManager.ClearArray();
                Prefs.Game_SaveName("_NextSceneData.sav");

                if (File.Exists(JsonManager.GetFilePath(FilePath.GameDataPath) + "_NextSceneData.sav"))
                {
                    JsonManager.DeserializeData(FilePath.GameDataPath, "_NextSceneData.sav");
                    LoadSavedSceneData(false);
                }
            }
        }
    }
Ejemplo n.º 18
0
	void Awake() {
		if (Instance == null) {
			Instance = this;
			objectives = FindObjectsOfType<Objective>();
        }
		else {
			Destroy(gameObject);
		}
	}
    void Start()
    {
        mainAudio        = GetComponent <AudioSource>();
        mm_audio         = GetComponent <AudioSource>();
        mainAudio.clip   = bazzi;
        mainAudio.volume = 0.5F;
        mainAudio.loop   = true;
        mainAudio.Play();

        Player();
        if (PhotonNetwork.IsMasterClient)
        {
            Debug.Log("IsMasterClient");
        }
        boosterItem1.enabled = false;
        boosterItem2.enabled = false;
        boosterItem3.enabled = false;
        boosterState.enabled = false;
        cloudItem.enabled    = false;
        rocketBar.SetActive(false);

        itemBox.sprite = emptyItem;

        if (autoFindKarts)
        {
            karts = FindObjectsOfType <ArcadeKart>();
            if (karts.Length > 0)
            {
                if (!playerPrefab)
                {
                    playerPrefab = karts[0];
                }
            }
            DebugUtility.HandleErrorIfNullFindObject <ArcadeKart, photonManager>(playerPrefab, this);
        }
        m_ObjectiveManager = FindObjectOfType <ObjectiveManager>();
        DebugUtility.HandleErrorIfNullFindObject <ObjectiveManager, photonManager>(m_ObjectiveManager, this);
        m_TimeManager = FindObjectOfType <TimeManager>();
        DebugUtility.HandleErrorIfNullFindObject <TimeManager, photonManager>(m_TimeManager, this);
        AudioUtility.SetMasterVolume(1);
        winDisplayMessage.gameObject.SetActive(false);
        loseDisplayMessage.gameObject.SetActive(false);
        m_TimeManager.StopRace();
        foreach (ArcadeKart k in karts)
        {
            Debug.Log("StopRace()");
            k.SetCanMove(false); // 못 움직이이게 함
            map1BoostCanStart = false;
        }

        //startButton
        if (!PhotonNetwork.IsMasterClient)
        {
            startButton.gameObject.SetActive(false);
        }
        startButton.onClick.AddListener(clickStartButton);
    }
Ejemplo n.º 20
0
    private void Start()
    {
        m_ObjectiveManager = GetComponentInParent <ObjectiveManager>();

        m_SpawnedEnemies = new HashSet <GameObject>();

        Instantiate(m_Target, transform);
        StartCoroutine(Countdown());
    }
Ejemplo n.º 21
0
 protected void Start()
 {
     theDialogueManager  = GameMaster.getCanvas().transform.Find("DialogueBox").GetComponent <DialogueManager>();
     theObjectiveManager = theDialogueManager.transform.parent.Find("ObjectiveBox").GetComponent <ObjectiveManager>();
     isEventFinished     = false;//just putting this as a placeholder value
     if (skip)
     {
         isEventFinished = skip;
     }
 }
 /// <summary>
 /// Enables the endLevelMenu attached to this GameObject and the menu pointer.
 /// </summary>
 public void EnableConfirmationMenu()
 {
     canvas.worldCamera = GameObject.Find("Pointer").GetComponent <Camera>();
     objManager         = GameObject.Find("LevelManager").GetComponent <ObjectiveManager>();
     if (endLevelMenu.activeInHierarchy == false)
     {
         endLevelMenu.SetActive(true);
         Pointer.MenuIsActive(true);
     }
 }
Ejemplo n.º 23
0
    void Start()
    {
        m_Player = FindObjectOfType <PlayerCharacterController>();
        DebugUtility.HandleErrorIfNullFindObject <PlayerCharacterController, GameFlowManager>(m_Player, this);

        m_ObjectiveManager = FindObjectOfType <ObjectiveManager>();
        DebugUtility.HandleErrorIfNullFindObject <ObjectiveManager, GameFlowManager>(m_ObjectiveManager, this);

        AudioUtility.SetMasterVolume(1);
    }
 private void ResetProperties()
 {
     //Resets the properties of the object before a new scene so that there are no references to old objects
     variableList    = new List <Variable>();
     inputList       = new List <int>();
     expectedOutputs = new List <int>();
     outputList      = new List <int>();
     objManager      = null;
     outputText      = null;
 }
    public void HasLost()
    {
        PlayerManager pm = GameObject.Find("Player").GetComponent <PlayerManager>();

        pm.invulnerable = true;
        ObjectiveManager om = GameObject.Find("Objectives").GetComponent <ObjectiveManager>();

        om.endGameCanvas.gameObject.SetActive(true);
        om.lossImage.gameObject.SetActive(true);
    }
    void Awake()
    {
        if (_instance != null)
        {
            Destroy(this);
            return;
        }

        _instance = this;
    }
Ejemplo n.º 27
0
    public void StartReading(ObjectiveManager objectiveManager)
    {
        objectives.Clear();

        foreach (string sentence in objectiveManager.sentences)
        {
            objectives.Enqueue(sentence);
        }

        DisplayNextSentence();
    }
Ejemplo n.º 28
0
        protected override void Awake()
        {
            base.Awake();
            DebugSetup();
            InitGameStates();

            // First to score 5 -> win the match
            gameObjectiveManager = new ObjectiveManager();
            gameObjectiveManager.Add(new ObjectiveGameFinish(10));
            gameObjectiveManager.Completed += (sender, args) => States.ChangeState(GameStates.GameResult);
        }
Ejemplo n.º 29
0
    private void Start()
    {
        chatProgress           = 0;
        objectiveManager       = GameObject.Find("ObjectiveManager");
        objectiveManagerScript = objectiveManager.GetComponent <ObjectiveManager>();

        chatBoxGameObj = GameObject.Find("ChatBox");
        if (chatBoxGameObj == null)
        {
            Debug.LogError("ChatBox is null");
        }
    }
    // Use this for initialization
    void Start()
    {
        m_cInstance = this;

        m_dObjectives = new Dictionary<string, GameObject>();
        foreach (Transform t in transform)
        {
            m_dObjectives.Add(t.gameObject.name, t.gameObject);
            t.FindChild("Progress").GetComponent<Slider>().value = 0;
            t.FindChild("Label").GetComponent<Text>().text = t.gameObject.name;
        }
    }
Ejemplo n.º 31
0
    void Start()
    {
        if (autoFindKarts)
        {
            //karts[0] es el creado por defecto
            karts = FindObjectsOfType <ArcadeKart>();
            if (karts.Length > 0)
            {
                if (!playerKart)
                {
                    playerKart = karts[0];
                }
            }
            DebugUtility.HandleErrorIfNullFindObject <ArcadeKart, GameFlowManager>(playerKart, this);
        }

        m_ObjectiveManager = FindObjectOfType <ObjectiveManager>();
        DebugUtility.HandleErrorIfNullFindObject <ObjectiveManager, GameFlowManager>(m_ObjectiveManager, this);

        m_TimeManager = FindObjectOfType <TimeManager>();
        DebugUtility.HandleErrorIfNullFindObject <TimeManager, GameFlowManager>(m_TimeManager, this);

        timeDisplay = FindObjectOfType <TimeDisplay>();
        DebugUtility.HandleErrorIfNullFindObject <TimeDisplay, GameFlowManager>(timeDisplay, this);

        AudioUtility.SetMasterVolume(1);

        winDisplayMessage.gameObject.SetActive(false);
        loseDisplayMessage.gameObject.SetActive(false);

        m_TimeManager.StopRace();

        foreach (ArcadeKart k in karts)
        {
            k.SetCanMove(false);
        }

        //Obtiene el anterior best time
        previousBestTime = PlayerPrefs.GetFloat("BestTime", -1);

        //Nuevo valor de best time
        bestTime = -1;

        //Obtiene la cantidad de monedas almacenadas durante el resto de partidas
        totalCoins = PlayerPrefs.GetInt("Coins", 0);

        //run race countdown animation
        ShowRaceCountdownAnimation();
        StartCoroutine(ShowObjectivesRoutine());

        StartCoroutine(CountdownThenStartRaceRoutine());
    }
Ejemplo n.º 32
0
    //public int health;

    void Start()
    {
        questionMark.SetActive(false);
        currDelay        = ActionDelay;
        currInputDelay   = InputDelay;
        objectiveManager = GetComponent <ObjectiveManager>();

        for (int i = 0; i < movementArrows.Length; i++)
        {
            movementArrows[i].SetActive(false);
        }
//        movementArrows[(int)currDir].SetActive(true);
    }
	void Awake ()
	{
		_instance = this;
	}
Ejemplo n.º 34
0
    void Awake()
    {
        pauseCanvas = GameObject.Find ("PauseCanvas");
        HTPCanvas = GameObject.Find ("HTPCanvas");

        animHUD = GetComponent<Animator> ();

        playerHealth = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerHealth> ();
        scoreManager = GetComponentInChildren<ScoreManager> ();
        objectiveManager = GetComponentInChildren<ObjectiveManager> ();
        // Data is used to transfer enemy information from each "Level 0x" scene to the "Next Level" scene
        // without the data being destroyed between scenes
        // This is accomplished by creating an empty GameObject (TransferredData),
        // placing a script (DataManager) as a component,
        // And calling DontDestroyOnLoad on the GameObject
        dataManager = GameObject.Find("TransferredData").GetComponent<DataManager> ();
        GameObject.DontDestroyOnLoad(dataManager);

        backgroundMusic = GetComponentInChildren<AudioSource> ();
        volumeSlider = pauseCanvas.GetComponentInChildren<Slider> ();
        musicToggle = pauseCanvas.GetComponentInChildren<Toggle> ();
    }