Example #1
0
 void Awake()
 {
     if (mouseManager == null) //this way you cannot create more than one Player_Score instance
     {
         _mouseManager = this;
     }
 }
Example #2
0
    private void Start()
    {
        // Only do thing is it's on Main scene or on Tutorial Scene
        if (IsInCorrectScene() == false)
        {
            return;
        }

        // Get reference to GameMaster
        gameMaster = GameObject.FindWithTag("GameMaster");

        // Finding the player gameObject
        player = GameObject.FindGameObjectWithTag("Player");

        // Get reference to MouseCursorManager on GameMaster to manage cursor changes
        mouseCursorManage = gameMaster.GetComponent <MouseCursorManager>();

        //This will repeat every 0.5 sec
        InvokeRepeating("UpdateTarget", 0f, 0.5f);

        if (bulletPrefab == null)
        {
            return;
        }

        pm = GetComponent <PropertiesManager> ();

        SetRangeObject();

        // Set skill values from prefab
        pm.SetValues(bulletPrefab.GetComponent <SkillsProperties>());
    }
Example #3
0
    private void Start()
    {
        if (IsNotInCutScene())
        {
            gameMaster        = GameObject.Find("GameMaster");
            deathManager      = gameMaster.GetComponent <DeathManager>();
            pauseManager      = gameMaster.GetComponent <PauseManager>();
            soulsCounter      = gameMaster.GetComponent <SoulsCounter>();
            buildManager      = gameMaster.GetComponent <BuildManager>();
            towerManager      = gameMaster.GetComponent <TowerManager>();
            mouseCursorManage = gameMaster.GetComponent <MouseCursorManager>();
            ShopGObj          = GameObject.Find("Shop");
            if (IsInCorrectScene())
            {
                ShopGObj.SetActive(false);
                shop = ShopGObj.GetComponent <Shop>();
            }
            icosphereLight           = GetComponent <Light>();
            icosphereLight.intensity = initialIntensity;

            if (IsInCorrectScene() == false)
            {
                return;
            }
            masterTowerTowerScript = GameObject.FindWithTag("GameMaster").
                                     GetComponent <InstancesManager>().
                                     GetMasterTowerObj().
                                     GetComponent <TowerScript>();
        }
    }
Example #4
0
 private void Start()
 {
     gameMaster          = GameObject.FindWithTag("GameMaster");
     actionManager       = gameMaster.GetComponent <ActionManager>();
     masterTower         = gameMaster.GetComponent <InstancesManager>().GetMasterTowerObj();
     masterTowerScript   = masterTower.GetComponent <MasterTowerScript> ();
     mouserCursorManager = gameMaster.GetComponent <MouseCursorManager>();
     SetSpeed(waveSpawner.GetBaseSpeed() * speedEnemyConst);
     target         = wayPoints.GetPoints(0);
     originalHeight = transform.position.y;
 }
Example #5
0
    public int mouseLeftNumber, mouseRightNumber, mouseTwoNumber = 0;      // 왼쪽 부착, 오른쪽 부착, 두 포탈 부착에 관한 것을 int형으로 해서, 비교

    private void Awake()
    {
        if (mouseCursorInstance == null)                           //게임매니저 중복생성 방지 및 싱글톤 객체화
        {
            mouseCursorInstance = this;
        }
        else if (mouseCursorInstance != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(this);
    }
Example #6
0
    void Awake()
    {
        if (m_instance == null)
        {
            m_instance = this;
            SceneManager.sceneLoaded += onSceneLoad;
        }
        else if (m_instance != this)
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
    }
Example #7
0
 void Start()
 {
     // Finding the player gameObject
     if (SceneVerifier.IsInMainSceneOrTutorial() == false)
     {
         return;
     }
     player = GameObject.FindGameObjectWithTag("Player");
     if (GetComponent <TowerScript> () == null)
     {
         return;
     }
     partToRotate       = GetComponent <TowerScript> ().partToRotate;
     playerSpawnOnTower = GetComponent <TowerScript> ().playerSpawnOnTower;
     mouseCursosManage  = GameObject.FindWithTag("GameMaster").GetComponent <MouseCursorManager>();
 }
Example #8
0
 void Start()
 {
     if (IsInCorrectScene())
     {
         gameMaster         = GameObject.FindGameObjectWithTag("GameMaster");
         sphereShop         = GameObject.FindGameObjectWithTag("Icosphere").GetComponent <SphereShop>();
         mouseCursorManager = gameMaster.GetComponent <MouseCursorManager>();
         deathManager       = gameMaster.GetComponent <DeathManager>();
         buildManager       = gameMaster.GetComponent <BuildManager>();
         towerManager       = gameMaster.GetComponent <TowerManager>();
         shopScript         = gameMaster.GetComponent <InstancesManager>().GetShopGObj().GetComponent <Shop>();
         soulsCounter       = SoulsCounter.instance;
         scoreCounter       = ScoreCounter.instance;
         towerToBuild       = null;
         isAlreadBuilt      = false;
     }
 }
Example #9
0
 private void Start()
 {
     mouseCursorManager = gameObject.GetComponent <MouseCursorManager>();
     image       = GameObject.Find("Image");
     versionText = GameObject.Find("VersionText");
     name1       = GameObject.Find("Name1");
     name2       = GameObject.Find("Name2");
     name3       = GameObject.Find("Name3");
     version     = GameObject.Find("_VERSION").GetComponent <_Version>().GetVersion();
     StartCoroutine(VersionSceneFlow());
     image.SetActive(false);
     versionText.SetActive(false);
     name1.SetActive(false);
     name2.SetActive(false);
     name3.SetActive(false);
     image.GetComponent <CanvasGroup>().alpha       = 0;
     versionText.GetComponent <CanvasGroup>().alpha = 0;
     name1.GetComponent <CanvasGroup>().alpha       = 0;
     name2.GetComponent <CanvasGroup>().alpha       = 0;
     name3.GetComponent <CanvasGroup>().alpha       = 0;
     versionText.GetComponent <Text>().text         = "Overhead - v" + version;
 }