public void OnEnterShop(GameObject shopObj, Constant.MapObjects shopType) { shopScript_.SetShopType(shopType); //GameObject.Find("ShopUI").SetActive(true); shopScript_.SetShopUIVisible(true); playerScript_.SetSpeed(0); }
// Shop public void OnCollideShop(GameObject collideObj, Constant.MapObjects shopType) { LastCollideObject_ = collideObj; float collidePos = gameObject.transform.position.x - collideObj.transform.position.x; //characterPosition_.y = 0.0f; if (Mathf.Abs(collidePos) < Constant.Width_INTO_ShopHole) { //홀에 빠짐 changeCharacterState(CharacterStates.IN_THE_HOLE); //shop이므로 바로 구멍 안으로 들어가는 트리거 발동 //animator_.SetTrigger("trInOutHole"); changeCharacterState(CharacterStates.IN_TO_THE_HOLE); enterShopType_ = shopType; } else if (collidePos < 0.0f) { //왼쪽에 부딪힘 changeCharacterState(CharacterStates.STOP_LEFT); } else { //오른쪽에 부딪힘 changeCharacterState(CharacterStates.STOP_RIGHT); } }
float calcObjectZpos(Constant.MapObjects objType, int dist) { int distFromCurPos = dist - (int)distance_; switch (objType) { case Constant.MapObjects.LHOLE: case Constant.MapObjects.SHOP_NORMAL: case Constant.MapObjects.SHOP_EXPENSIVE: case Constant.MapObjects.SHOP_SANTA: return((float)distFromCurPos * 4.0f); case Constant.MapObjects.FISH_HOLE: case Constant.MapObjects.CRACK: return((float)distFromCurPos * 4.0f); case Constant.MapObjects.GOAL: return((float)distFromCurPos * 4.0f); case Constant.MapObjects.ROCK: return((float)distFromCurPos * 4.0f); default: break; } return(0.0f); }
public void SetShopType(Constant.MapObjects shopType) { shopType_ = shopType; switch (shopType_) { case Constant.MapObjects.SHOP_NORMAL: //gameObject.GetComponent<SpriteRenderer>().sprite = Resources.Load() break; case Constant.MapObjects.SHOP_EXPENSIVE: break; case Constant.MapObjects.SHOP_SANTA: break; default: break; } }
float calcObjectXPos(Constant.MapObjects objType, int hPos, int dist) { switch (objType) { case Constant.MapObjects.LHOLE: return((float)hPos * 3.0f); case Constant.MapObjects.FISH_HOLE: case Constant.MapObjects.CRACK: return((float)hPos * 3.5f); case Constant.MapObjects.SHOP_NORMAL: case Constant.MapObjects.SHOP_EXPENSIVE: case Constant.MapObjects.SHOP_SANTA: return((float)hPos * 4.0f); case Constant.MapObjects.ROCK: return((float)hPos * 4.8f); default: break; } return(0.0f); }
public GameObject GetMapObjectInstance(Constant.MapObjects objectType) { switch (objectType) { case Constant.MapObjects.CRACK: foreach (GameObject obj in crackPool_) { if (obj.activeSelf == false) { return(obj); } } break; case Constant.MapObjects.FISH_HOLE: foreach (GameObject obj in fishHolePool_) { if (obj.activeSelf == false) { return(obj); } } break; case Constant.MapObjects.LHOLE: foreach (GameObject obj in largeHolePool_) { if (obj.activeSelf == false) { return(obj); } } break; case Constant.MapObjects.ROCK: foreach (GameObject obj in rockPool_) { if (obj.activeSelf == false) { return(obj); } } break; case Constant.MapObjects.SHOP_EXPENSIVE: case Constant.MapObjects.SHOP_NORMAL: case Constant.MapObjects.SHOP_SANTA: foreach (GameObject obj in shopPool_) { if (obj.activeSelf == false) { return(obj); } } break; default: break; } return(null); }
public void SetShopType(Constant.MapObjects shopType) { shopType_ = shopType; }