/// <summary> /// Dispose contained fields. /// </summary> public void Dispose() { if (SwapTexture != null) { SwapTexture.Dispose(); SwapTexture = null; } if (Textures != null) { foreach (var texture in Textures) { texture.Dispose(); } Textures = null; } if (RenderTargets != null) { foreach (var renderTargetView in RenderTargets) { renderTargetView.Dispose(); } RenderTargets = null; } if (DepthStencil2D != null) { DepthStencil2D.Dispose(); DepthStencil2D = null; } }
// Use this for initialization void Start() { imageCounter = 0; rotationCounter = 0; maxRotation = 180; textures = FindObjectOfType <SwapTexture> (); fade = FindObjectOfType <FadeAway> (); }
void OnInitPlayersData() { GameObject playerTemp = null; // 1. 선택에 따른 프리팹 생성 후 자식으로 대입 switch (CGameManager.P1_name) { case CharacterNames.agni: { playerTemp = Instantiate(Resources.Load("Characters/" + agni_obj_name), Vector3.zero, Quaternion.identity) as GameObject; agniTextureScript = null; P1_Left.fighterName = CharacterNames.agni; P1_Left.myCharacterInfo.physics.jumpForce = 16.5f; } break; case CharacterNames.miho: { playerTemp = Instantiate(Resources.Load("Characters/" + miho_obj_name), Vector3.zero, Quaternion.identity) as GameObject; mihoTextureScript = null; P1_Left.fighterName = CharacterNames.miho; } break; case CharacterNames.valkiri: { playerTemp = Instantiate(Resources.Load("Characters/" + valkiri_obj_name), Vector3.zero, Quaternion.identity) as GameObject; valkiriTextureScript = null; P1_Left.fighterName = CharacterNames.valkiri; } break; } playerTemp.transform.parent = P1_Left.gameObject.transform; playerTemp.transform.localPosition = Vector3.zero; playerTemp.transform.localRotation = Quaternion.identity; P1_Left.moveSetScript = playerTemp.GetComponent <MoveSetScript>(); P1_Left.moveSetScript.playerScript = P1_Left; defaultUiCtrl.SetPlayerUiImages(1, P1_Left.fighterName); switch (CGameManager.P2_name) { case CharacterNames.agni: { playerTemp = Instantiate(Resources.Load("Characters/" + agni_obj_name), Vector3.zero, Quaternion.identity) as GameObject; playerTemp.transform.parent = P2_Right.gameObject.transform; agniTextureScript = P2_Right.transform.GetChild(0).GetComponent <SwapTexture>(); playerTemp.transform.localPosition = Vector3.zero; playerTemp.transform.localRotation = Quaternion.identity; playerTemp.transform.localScale = new Vector3(playerTemp.transform.localScale.x * -1, playerTemp.transform.localScale.y, playerTemp.transform.localScale.z); P2_Right.moveSetScript = playerTemp.GetComponent <MoveSetScript>(); P2_Right.moveSetScript.playerScript = P2_Right; P2_Right.fighterName = CharacterNames.agni; P2_Right.myCharacterInfo.physics.jumpForce = 16.5f; if (P1_name == P2_name && agniTextureScript != null) { agniTextureScript.OnSetOtherTexture(); } } break; case CharacterNames.miho: { playerTemp = Instantiate(Resources.Load("Characters/" + miho_obj_name), Vector3.zero, Quaternion.identity) as GameObject; playerTemp.transform.parent = P2_Right.gameObject.transform; mihoTextureScript = P2_Right.transform.GetChild(0).GetComponent <SwapTexture>(); playerTemp.transform.localPosition = Vector3.zero; playerTemp.transform.localRotation = Quaternion.identity; playerTemp.transform.localScale = new Vector3(playerTemp.transform.localScale.x * -1, playerTemp.transform.localScale.y, playerTemp.transform.localScale.z); P2_Right.moveSetScript = playerTemp.GetComponent <MoveSetScript>(); P2_Right.moveSetScript.playerScript = P2_Right; P2_Right.fighterName = CharacterNames.miho; if (P1_name == P2_name && mihoTextureScript != null) { mihoTextureScript.OnSetOtherTexture(); } } break; case CharacterNames.valkiri: { playerTemp = Instantiate(Resources.Load("Characters/" + valkiri_obj_name), Vector3.zero, Quaternion.identity) as GameObject; playerTemp.transform.parent = P2_Right.gameObject.transform; valkiriTextureScript = P2_Right.transform.GetChild(0).GetComponent <SwapTexture>(); playerTemp.transform.localPosition = Vector3.zero; playerTemp.transform.localRotation = Quaternion.identity; playerTemp.transform.localScale = new Vector3(playerTemp.transform.localScale.x * -1, playerTemp.transform.localScale.y, playerTemp.transform.localScale.z); P2_Right.moveSetScript = playerTemp.GetComponent <MoveSetScript>(); P2_Right.moveSetScript.playerScript = P2_Right; P2_Right.fighterName = CharacterNames.valkiri; if (P1_name == P2_name && valkiriTextureScript != null) { valkiriTextureScript.OnSetOtherTexture(); } } break; } defaultUiCtrl.SetPlayerUiImages(2, P2_Right.fighterName); P1_Left.player_num = 1; P2_Right.player_num = 2; P1_Left.OnStart(); P2_Right.OnStart(); }