Exemple #1
0
 //=============================================//
 public void ResetInner()
 {
     { // Inner
         isFliped    = false;
         mineType    = MineTypes.NONE;
         dangerCount = 0;
         // arround
         arroundInners.Clear();
         // anim
         isDanger = false;
         anim.SetBool(hashInnerIsDanger, isDanger);
         anim.SetBool(hashFlipInner, false);
         //
         anim.enabled = false;
         sr.sprite    = null;
         //anim.enabled = true;
     }
     // Thunder
     foreach (var item in GetComponentsInChildren <Thunder>())
     {
         item.ResetThunder();
     }
     // Display
     display.ResetDisplay();
     // FootBoard
     footBoard.ResetFootBoard();
 }
Exemple #2
0
    } // End ShowDisplay()

    //=============================================//
    public void SetDanger(int value)
    { // value : 0 ~ 5
        //GameManager.instance.Loading(); // MineCount
        mineType = (MineTypes)(value);
        //
        isDanger = true;
        anim.SetBool(hashInnerIsDanger, isDanger);
        //
        display.SetDanger(isDanger, value);
    } // End SetDanger()
Exemple #3
0
    public static Color MineTypeToColor(MineTypes type)
    {
        switch (type)
        {
        case MineTypes.Simple:
            return(Color.grey);

        case MineTypes.Speed:
            return(Color.blue);

        case MineTypes.Dash:
            return(Color.red);

        default:
            return(Color.white);
        }
    }
Exemple #4
0
    //=========================================//
    private void SetExplosion(MineTypes type, Transform tf)
    {
        switch (type)
        {
        case MineTypes.PULL:
            EffectManager.instance.Play("Explosion", tf);
            break;

        case MineTypes.PUSH:
        {
            for (int i = 0; i < 6; ++i)
            {
                // Check 6 dir tiles that is Concrete
                RaycastHit2D hit = GameManager.instance.RayToDirs(
                    tf, i, GameManager.instance.concreteLayer);
                if (hit)
                {
                    if (hit.collider.CompareTag("Concrete"))
                    {
                        continue;
                    }
                }
                else
                {
                    Vector3 pos = tf.position + GameManager.instance.dirs[i];
                    pos.z = -5.0f;
                    EffectManager.instance.Play("Explosion", pos, Quaternion.identity);
                }
            }
        }
        break;

        default:
            break;
        }
    }
Exemple #5
0
 //=============================================//
 //private void Start()
 private void Awake()
 {
     audioSRC          = GetComponent <AudioSource>();
     audioSRC.priority = 256;
     mineType          = MineTypes.NONE;
 } // End Start
Exemple #6
0
    //=========================================//
    public void BeginAlert(MineTypes type, Inner inner)
    {
        switch (type)
        {
        case MineTypes.NONE: break;

        case MineTypes.PULL:
        {
            if (difficulty == Difficulty.HARD)        // || difficulty == Difficulty.IMPOSSIBLE)
            {
                inner.FlipSides();
            }
            //
            EffectManager.instance.Play("Pull", inner.transform);
        }
        break;

        case MineTypes.PUSH:
        {
            if (difficulty == Difficulty.HARD)
            {
                inner.FlipArround(false);
            }
            //
            EffectManager.instance.Play("Push", inner.transform);
        }
        break;

        case MineTypes.GHOST: break;

        case MineTypes.THUNDER: break;

        case MineTypes.NARROWING: break;

        case MineTypes.CRASH:
        {
            // Flip Tiles in crash route
            if (difficulty == Difficulty.HARD)
            {
                Floor floor = inner.GetComponent <Inner>().GetFloor();
                //
                int innerIndex = MyUtility.CharToInt(inner.transform.parent.name[0]);
                int crashIndex = MyUtility.CharToInt(floor.concreteTiles[2].name[0]);
                foreach (GameObject tile in floor.tiles)
                {
                    int itemIndex = MyUtility.CharToInt(tile.name[0]);
                    if (crashIndex > innerIndex)
                    {
                        if (itemIndex < crashIndex)
                        {
                            tile.GetComponent <Tile>().closet.Flip();
                        }
                    }
                    else
                    {
                        if (itemIndex > crashIndex)
                        {
                            tile.GetComponent <Tile>().closet.Flip();
                        }
                    }
                }
            }
        }
        break;

        default:
            break;
        }
    }