Example #1
0
 // Use this for initialization
 void Start()
 {
     ninjaScript              = ninjaObject.GetComponent <NinjaAI>();
     gameManagerScript        = rig.GetComponent <_GameManager>();
     playerSwordTriggerScript = playerSword.GetComponent <PlayerSwordTrigger>();
     //currentSword = this.GetComponent<GameObject>();
 }
 // Update is called once per frame
 private void Awake()
 {
     pickupCount    = 0;
     m_Rigidbody    = GetComponent <Rigidbody>();
     countText.text = "Resource: " + pickupCount.ToString();
     _gameManager   = FindObjectOfType <_GameManager>();
 }
Example #3
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.name == "Player")

        {
            GameObject   manager  = GameObject.Find("Manager");
            _GameManager scriptMa = manager.GetComponent <_GameManager>();

            switch (this.gameObject.name)
            {
            case "Sheep(Clone)":
                scriptMa.Food = 0.01f + scriptMa.Food;
                break;

            case "Duck(Clone)":
                scriptMa.Food = 0.02f + scriptMa.Food;
                break;

            case "FlowerMonster(Clone)":
                scriptMa.Food = 0.03f + scriptMa.Food;
                break;

            case "MoleMonster(Clone)":
                scriptMa.Food = 0.03f + scriptMa.Food;
                break;

            case "Penquin(Clone)":
                scriptMa.Food = 0.01f + scriptMa.Food;
                break;
            }


            Destroy(this.gameObject);
        }
    }
    void Start()
    {
        playerPhysics = GetComponent <PlayerPhysicsTest> ();
        animator      = GetComponent <Animator> ();
        manager       = Camera.main.GetComponent <_GameManager>();

        animator.SetLayerWeight(1, 1);
    }
Example #5
0
    private void Start()
    {
        ManagerObj = GameObject.Find("Manager");
        manager    = ManagerObj.GetComponent <_GameManager>();

        TText = TerrianObj.GetComponent <Text>();
        TerrianMenu();
    }
Example #6
0
    //Singleton so there is only ever one instacne of the game mamanager.
    public _GameManager()
    {
        if (singleton != null)
        {
            throw new System.Exception("You can only have one _Gamemanager object! Remove one instance");
        }

        singleton     = this;
        _currentLevel = 0;
    }
Example #7
0
    void Start()
    {
        _gm = transform.parent.GetComponentInChildren <_GameManager>();

        curLevel = levels[0];
        _gm._GUI.getAudioSources();
        _gm._GUI.setLevelAudio();

        _gm.GameOver += EndGame;
    }
Example #8
0
    private void Start()
    {
        ObjManger = GameObject.Find("Manager");
        manager   = ObjManger.GetComponent <_GameManager>();

        ObjUI   = GameObject.Find("UI");
        storeUI = ObjUI.GetComponent <Store_UI>();

        img        = this.GetComponent <Image>();
        img.sprite = sprite;
    }
Example #9
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Example #10
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        else
        {
            Destroy(this);
        }
    }
Example #11
0
 private void Start()
 {
     swordMovementScript = playerSword.GetComponent <SwordMovement>();
     gameManagerScript   = rig.GetComponent <_GameManager>();
     animator            = this.GetComponent <Animator>();
     rigidBody           = GetComponent <Rigidbody>();
     ResetValues();
     playerHealth         = 100;
     aiHealth             = 100;
     playerStartingHealth = playerHealth;
     aiStartingHealth     = aiHealth;
 }
Example #12
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
         //DontDestroyOnLoad(this);
     }
 }
Example #13
0
 public void _MakeSingleInstance()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
Example #14
0
    //XML데이터도 다른데에 박아두는게 나을 것 같다

    // Use this for initialization
    void Start()
    {
        instance = this;
        DontDestroyOnLoad(gameObject);//다른 씬을 로드해도 파괴되지 않음.

        //XMLData init
        LoadXML();

        //
        Init();

        OpenMainStage("BT1");
    }
Example #15
0
    void Start()
    {
        if (!_gm)
        {
            _gm = GameObject.Find("_GameManager").GetComponent <_GameManager>();
        }
        if (!_base)
        {
            _base = GetComponent <ActorBase>();
        }

        _base.myOppElement = _base.setOppElement();
    }
Example #16
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
 }
Example #17
0
 void Singleton()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     else
     if (_instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Example #18
0
 private void Initialize()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
         db        = GetComponent <_GameManagerDB> ();
         camPanner = GetComponent <CameraPanner> ();
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
Example #19
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        else
        {
            Destroy(this);
        }

        photonView = GetComponent <PhotonView>();
    }
Example #20
0
    public void InitiateKnight()
    {
        GM    = GameObject.Find("Game Manager").GetComponent <_GameManager>();
        Class = GM.GetUnitClass(this.gameObject);

        MaxHealth    = 50;
        Health       = MaxHealth;
        AttackDamage = 10;
        Range        = 3;
        AttackSpeed  = 1.5f;

        ProjectileSpeed = 0;

        Nav = GetComponent <NavMeshAgent>();
    }
Example #21
0
    public void InitiateArcher()
    {
        GM    = GameObject.Find("Game Manager").GetComponent <_GameManager>();
        Class = GM.GetUnitClass(this.gameObject);

        MaxHealth    = 25;
        Health       = MaxHealth;
        AttackDamage = 20;
        Range        = 40;
        AttackSpeed  = 5f;

        ProjectileSpeed = 100;

        Nav = GetComponent <NavMeshAgent>();
    }
Example #22
0
    private void Start()
    {
        //Screen.SetResolution(1920, 1080, false);
        Instance      = this;
        isStartGame   = false;
        myOnlineCount = 0;
        if (isNoDestroyHandler)
        {
            DontDestroyOnLoad(gameObject);
            isNoDestroyHandler = false;
        }
#if SERVER
        OnClickHost();
#endif
    }
Example #23
0
    // Start is called before the first frame update
    void Start()
    {
        GM     = GameObject.Find("Game Manager").GetComponent <_GameManager>();
        PL     = GameObject.Find("Game Manager").GetComponent <_Player>();
        Prefab = GameObject.Find("Game Manager").GetComponent <_Prefab>();

        // INITIALISE PARTS OF THE UI

        INIT_GameManagement();
        INIT_Currency();
        INIT_BarracksUI();
        INIT_WaveUI();
        INIT_HealthBarUI();
        INIT_SpacialUI();
    }
Example #24
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(this);

        SceneManager.sceneLoaded += StartGame;
    }
Example #25
0
    private void Awake()
    {
        //Time.timeScale = 1;

        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        // Prevent the game manager from being destroyed while loading scenes
        // DontDestroyOnLoad(gameObject);
    }
Example #26
0
    private void Awake()
    {
        if (_GameManager.sharedInstance == null)
        {
            _GameManager.sharedInstance = this;
        }
        else if (_GameManager.sharedInstance != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);

        boardScript = GetComponent <_BoardManager>();

        recordLevelText = GameObject.Find("RecordLevelText").GetComponent <Text>();
    }
    // Start is called before the first frame update
    void Start()
    {
        CheckStartingAnim();
        GM = GameObject.FindGameObjectWithTag("GameManager").GetComponent <_GameManager>();
        if (GM.isMultiplayer)
        {
            GameObject[] ships = GameObject.FindGameObjectsWithTag("Player");
            ship = ships[Random.Range(0, 2)];
        }
        else
        {
            ship = GameObject.FindGameObjectWithTag("Player");
        }

        DetermineSpeed();
        DetermineRotation();
        ShootAsteroid();
    }
Example #28
0
    private void Start()
    {
        GlobalObj = GameObject.Find("ProgramingUI");
        ObjString = GameObject.Find("StringInput");
        ObjInt    = GameObject.Find("IntInput");

        ObjString.SetActive(true);
        ObjInt.SetActive(false);

        if (GlobalObj != null)
        {
            GlobalObj.SetActive(false);
        }

        ObjManager = GameObject.Find("Manager");
        if (ObjManager != null)
        {
            manager = ObjManager.GetComponent <_GameManager>();
        }
    }
Example #29
0
    private void Start()
    {
        StoreUI = GameObject.Find("UI");

        ObjManger = GameObject.Find("Manager");
        manager   = ObjManger.GetComponent <_GameManager>();

        thisButton = this.GetComponent <Button>();


        if (createOnce)
        {
            GameObject startPointer = (GameObject)Instantiate(mousePointer.gameObject, Vector3.zero, Quaternion.identity);
            startPointer.name = "MousePointer";
            startPointer.tag  = "Pointer";
            mousePointer      = startPointer;

            createOnce = false;
        }
    }
Example #30
0
 void Awake()
 {
     instance = this;
 }
Example #31
0
	void OnNetworkLoadedLevel () {
		_nc = FindObjectOfType(typeof(_GameManager)) as _GameManager;
	}
Example #32
0
	void Start(){
		_nc = FindObjectOfType(typeof(_GameManager)) as _GameManager;
		menuState = MenuState.MainMenu;
		T_style = GameObject.Find("_GameManager").GetComponent<Console>().textStyle;
	}