public void btnBullet0() { Destroy(m_goBullet.transform.GetChild(0).gameObject); m_goTmpBullet = Instantiate(m_cLoadBullet.getBullet(0), new Vector3(0.0f, 0.0f, 0.0f), Quaternion.Euler(-90.0f, 0.0f, 0.0f)); m_goTmpBullet.transform.parent = m_goBullet.transform; m_nBulletNum = 0; }
public void setBulletSelect(int nIndex) { Destroy(m_goBullet.transform.GetChild(0).gameObject); m_goTmpBullet = Instantiate(m_cLoadBullet.getBullet(nIndex), m_goCharacter.transform.position + new Vector3(3.0f, 1.0f, 0.0f), Quaternion.Euler(-90.0f, 0.0f, 0.0f)); m_goTmpBullet.transform.parent = m_goBullet.transform; m_nBulletNum = nIndex; }
public void CreateTower() { m_goMyTower = Instantiate((GameObject)Resources.Load("Tower/Custom/customizingTower")); m_goMyTower.transform.GetChild(1).GetComponent <Renderer>().material = m_cLoadItem.getLoadMaterial(m_nMtrCustom); GameObject m_goHand = m_goMyTower.transform.GetChild(0).GetChild(1).GetChild(0).GetChild(2).GetChild(0).GetChild(2).GetChild(0).GetChild(0).GetChild(0).GetChild(0).gameObject; GameObject m_goFace = m_goMyTower.transform.GetChild(0).GetChild(1).GetChild(0).GetChild(2).GetChild(0).GetChild(0).GetChild(1).gameObject; GameObject m_goHair = m_goMyTower.transform.GetChild(0).GetChild(1).GetChild(0).GetChild(2).GetChild(0).GetChild(0).GetChild(2).gameObject; if (m_nFace != -1) { GameObject goTmpFace = Instantiate(m_cLoadItem.getLoadFace(m_nFace), m_goMyTower.transform.position, Quaternion.Euler(new Vector3(-90.0f, 0.0f, 0.0f))); goTmpFace.transform.parent = m_goFace.transform; } if (m_nHair != -1) { GameObject goTmpHair = Instantiate(m_cLoadItem.getLoadHair(m_nHair), m_goMyTower.transform.GetChild(1).position, Quaternion.Euler(new Vector3(-90.0f, 0.0f, 0.0f))); goTmpHair.GetComponent <Renderer>().material = m_cLoadItem.getLoadHairMaterial(PlayerPrefs.GetInt("HairMaterielNumber")); goTmpHair.transform.parent = m_goHair.transform; } if (m_nWeapon != -1) { GameObject goTmpWeapon = Instantiate(m_cLoadItem.getLoadWeapon(m_nWeapon), m_goHand.transform.position, m_goHand.transform.rotation); goTmpWeapon.transform.parent = m_goHand.transform; } m_goMyTower.AddComponent <C_CUSTOMTOWER>(); m_goMyTower.AddComponent <C_TOWER>(); m_goMyTower.AddComponent <C_TOWERUI>(); m_goMyTower.AddComponent <C_TOWERANIMATION>(); m_goMyTower.GetComponent <Animation>().enabled = true; m_goMyTower.AddComponent <C_CUSTOMTOWER>().setBullet(m_cLoadBullet.getBullet(PlayerPrefs.GetInt("bullet"))); m_goMyTower.AddComponent <C_CUSTOMTOWER>().init(PlayerPrefs.GetFloat("striking", 0.0f), PlayerPrefs.GetFloat("downrange", 0.0f) , PlayerPrefs.GetFloat("speedOfStriking", 0.0f), PlayerPrefs.GetInt("targetCount", 0), 25); GameObject goTmpEffect = Instantiate(m_cLoadAura.getTowerAuraEffect((C_LOADAURA.E_AURAEFFECT)PlayerPrefs.GetInt("aura")), m_goMyTower.transform.position, Quaternion.Euler(-90.0f, 0.0f, 0.0f)) as GameObject; //m_goMyTower.AddComponent<C_CUSTOMTOWER>().setBullet(GameObject.Find("BulletnAura").GetComponent<C_AURABULLETBUTTON>().getBulletNum()); //GameObject goTmpEffect = Instantiate(GameObject.Find("BulletnAura").GetComponent<C_AURABULLETBUTTON>().getAuraNum(), m_goMyTower.transform.position, Quaternion.Euler(-90.0f, 0.0f, 0.0f)) as GameObject; goTmpEffect.transform.parent = m_goMyTower.transform; GameObject.Find("Cus").GetComponent <C_CUSTOMIZINGCLOTH>().getCharacter().SetActive(false); }
void Start() { m_cLoadAura = new C_LOADAURA(); m_cLoadAura.init(); m_cLoadBullet = new C_LOADBULLET(); m_cLoadBullet.init(); m_goAura = new GameObject(); m_goAura.name = "Aura"; m_goBullet = new GameObject(); m_goBullet.name = "Bullet"; m_goTmpBullet = Instantiate(m_cLoadBullet.getBullet(0), new Vector3(0.0f, 0.0f, 0.0f), Quaternion.Euler(-90.0f, 0.0f, 0.0f)); m_goTmpBullet.transform.parent = m_goBullet.transform; m_goTmpAura = Instantiate(m_cLoadAura.getTowerAuraEffect(C_LOADAURA.E_AURAEFFECT.E_ARCANE), new Vector3(0.0f, 0.0f, 0.3f), Quaternion.Euler(-90.0f, 0.0f, 0.0f)) as GameObject; m_goTmpAura.transform.parent = m_goAura.transform; m_eAura = C_LOADAURA.E_AURAEFFECT.E_ARCANE; m_nBulletNum = 0; }
void Start() { m_cLoadData = GameObject.Find("LoadData").GetComponent <C_LOADDATA>(); m_cLoadBullet = new C_LOADBULLET(); m_cLoadBullet.init(); m_cLoadAura = new C_LOADAURA(); m_cLoadAura.init(); m_goCharacter = Instantiate((GameObject)Resources.Load("Tower/Custom/customizingTower")); m_goCharacter.transform.Translate(new Vector3(0.0f, -1.0f, 0.0f)); m_mtrCharacterMaterial = m_goCharacter.transform.GetChild(1).gameObject.GetComponent <Renderer>(); m_goCharacter.tag = "CustomTower"; m_goHand = m_goCharacter.transform.GetChild(0).GetChild(1).GetChild(0).GetChild(2).GetChild(0).GetChild(2).GetChild(0).GetChild(0).GetChild(0).GetChild(0).gameObject; m_goFace = m_goCharacter.transform.GetChild(0).GetChild(1).GetChild(0).GetChild(2).GetChild(0).GetChild(0).GetChild(1).gameObject; m_goHair = m_goCharacter.transform.GetChild(0).GetChild(1).GetChild(0).GetChild(2).GetChild(0).GetChild(0).GetChild(2).gameObject; m_nHairItemNumber = -1; m_nHandItemNumber = -1; m_nFaceItemNumber = -1; m_nMaterielNumber = 0; m_nHairMaterielNumber = m_cLoadData.getLoadItem().getHairMaterialCustom(); m_goAura = new GameObject(); m_goAura.name = "Aura"; m_goBullet = new GameObject(); m_goBullet.name = "Bullet"; m_nAuraNum = (int)C_LOADAURA.E_AURAEFFECT.E_ARCANE; m_nBulletNum = 0; m_goTmpBullet = Instantiate(m_cLoadBullet.getBullet(m_nBulletNum), m_goCharacter.transform.position + new Vector3(3.0f, 1.0f, 0.0f), Quaternion.Euler(-90.0f, 0.0f, 0.0f)); m_goTmpBullet.transform.parent = m_goBullet.transform; m_goTmpAura = Instantiate(m_cLoadAura.getTowerAuraEffect((C_LOADAURA.E_AURAEFFECT)m_nAuraNum), m_goCharacter.transform.position, Quaternion.Euler(-90.0f, 0.0f, 0.0f)) as GameObject; m_goTmpAura.transform.parent = m_goAura.transform; m_nHairColorNum = 0; m_nBulletColor = 0; }