//MonoBehaviour void Awake() { Sys = GetComponentInParent <C_GameManager>(); if (Sys == null) { Destroy(this); } MyCollider = GetComponent <Collider>(); bool _trigger = false; if (MyCollider == null) { Debug.Log("Collider Componant not Found. " + gameObject.name + ".C_PlayerMove Componant Destroyed."); _trigger = true; } MyRigidBody = GetComponent <Rigidbody>(); if (MyRigidBody == null) { Debug.Log("RigidBody Componant not Found. " + gameObject.name + ".C_PlayerMove Componant Destroyed."); _trigger = true; } if (_trigger) { Destroy(this); } }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody> (); rb.velocity = new Vector3(0, -Mathf.Abs(FallSpeed), 0); gameManager = C_GameManager.Instance; }
private void Awake() { // if the singleton hasn't been initialized yet if (instance != null && instance != this) { Destroy(this.gameObject); } instance = this; DontDestroyOnLoad(this.gameObject); }
void OnJoinedRoom() { if (!_gameManagerClass) _gameManagerClass = GameObject.Find("Game Manager").GetComponent<C_GameManager>(); Debug.Log("joined room"); thisPlayer = players[ PhotonNetwork.room.playerCount - 1 ]; _gameManagerClass.Z_LoadGame(); if (PhotonNetwork.isMasterClient) PhotonNetwork.room.maxPlayers = totalPlayers; }
/************************************ public methods *********************************/ public void Z_Start() { _gmClass = GameObject.Find("Game Manager").GetComponent<C_GameManager>(); _gameObject = gameObject; _hpMainTex = GameObject.Find("Abilities + Bars/Bars/HP Bar").GetComponent<GUITexture>(); _mpMainTex = GameObject.Find("Abilities + Bars/Bars/MP Bar").GetComponent<GUITexture>(); m_mainBarSize = GameObject.Find("Abilities + Bars/Bars/Background").GetComponent<GUITexture>().pixelInset.width; _show_attackText = GameObject.Find("Player Stats/Attack Text").GetComponent<GUIText>(); _show_rangeText = GameObject.Find("Player Stats/Range Text").GetComponent<GUIText>(); _show_defenseText = GameObject.Find("Player Stats/Defense Text").GetComponent<GUIText>(); _show_movementText = GameObject.Find("Player Stats/Movement Text").GetComponent<GUIText>(); }
public void Z_UpdateAllStats(C_GameUnit.EmptyClass curStats) { Z_UpdateUnitBars(curStats); if ( curStats.GetType() == typeof(C_Hero.CurrentStats) ) { C_Hero.CurrentStats stats = (C_Hero.CurrentStats) curStats; Z_UpdateEnergy(stats.energy); // update only for this player if (!_gmClass) _gmClass = GameObject.Find("Game Manager").GetComponent<C_GameManager>(); if (_gmClass.z_thisPlayerGO != _gameObject) return; _show_attackText.text = "Attack: " + stats.attackPower; _show_rangeText.text = "Range: " + stats.attackRange; _show_defenseText.text = "Defense: " + stats.defensePercent + "%"; _show_movementText.text = "Movement: " + stats.movementSpeed; Z_UpdateMainBars(stats); } }
//MonoBehaviour void Awake() { Sys = GetComponentInParent<C_GameManager>(); if (Sys == null) { Destroy(this); } MyCollider = GetComponent<Collider>(); bool _trigger = false; if (MyCollider == null) { Debug.Log("Collider Componant not Found. " + gameObject.name + ".C_PlayerMove Componant Destroyed."); _trigger = true; } MyRigidBody = GetComponent<Rigidbody>(); if (MyRigidBody == null) { Debug.Log("RigidBody Componant not Found. " + gameObject.name + ".C_PlayerMove Componant Destroyed."); _trigger = true; } if (_trigger) Destroy(this); }
public void OnPurchased() { gameManager = C_GameManager.Instance; gameManager.CurrentAquarium.SpawnFood(gameObject); }
// Use this for initialization void Start() { txtMoney = transform.Find("txt_money").GetComponent <Text>(); gameManager = C_GameManager.Instance; }
/************************************ private methods *********************************/ void Start() { _transform = transform; _gameObject = gameObject; _gmClass = GameObject.Find("Game Manager").GetComponent<C_GameManager>(); _updateGUI = gameObject.GetComponent<S_UpdateGUI>(); // initialize stats m_curStats.HP = maxStats.maxHP; m_curStats.maxHP = maxStats.maxHP; m_curStats.regHP = maxStats.regHP; m_curStats.attackPower = maxStats.attackPower; m_curStats.defensePercent = maxStats.defensePercent; m_curStats.attackRange = maxStats.attackRange; // for testing ... m_curStats.HP = 66; }
/************************************ private methods *********************************/ void Start() { _transform = transform; _gameObject = gameObject; _gmClass = GameObject.Find("Game Manager").GetComponent<C_GameManager>(); _updateGUI = gameObject.GetComponent<S_UpdateGUI>(); // initialize stats m_curStats.level = _gmClass.heroLvStart; m_curStats.HP = maxStats.maxHP; m_curStats.maxHP = maxStats.maxHP; m_curStats.regHP = maxStats.regHP; m_curStats.MP = maxStats.maxMP; m_curStats.maxMP = maxStats.maxMP; m_curStats.regMP = maxStats.regMP; m_curStats.attackPower = maxStats.attackPower; m_curStats.defensePercent = maxStats.defensePercent; m_curStats.movementSpeed = maxStats.movementSpeed; m_curStats.energy = _gmClass.heroEnergy; m_curStats.attackRange = maxStats.attackRange; // for testing ... m_curStats.MP = 0; m_curStats.HP = 66; _updateGUI.Z_Start(); _updateGUI.Z_UpdateAllStats(m_curStats); }
void Start() { gameManager = C_GameManager.Instance; StartCoroutine("GenerateMoney"); }
// Use this for initialization void Start() { cameraViewPos = transform.Find("CameraPos"); tankBoundsBox = transform.Find("TankBoundary").GetComponent <BoxCollider>(); gameManager = C_GameManager.Instance; }
// 조이스틱 CS 기능 // 각 과일은 조이스틱 함수를 가지고있고 // 클릭하면 PointDown, OnMouseDrag 함수가 실행됨. // 클릭한 상태로 일정거리 이상 움직이면 GameManager에서 Swap private void Start() { gm = C_GameManager.Instance; c_MyBlock = GetComponent <C_ImBlock>(); }
public void OnPurchased() { gameManager = C_GameManager.Instance; gameManager.CurrentAquarium.SpawnFish(Name); }