Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        //デフォルトでプレイヤーが設定されてない場合
        if (player == null)
        {
            try
            {
                player = GameObject.FindGameObjectWithTag("Player");
            }
            catch (System.NullReferenceException)
            {
                Debug.Log("プレイヤー未発見" + name);
                Destroy(gameObject);
            }
        }
        //デフォルトで泥棒が設定されてない場合
        if (thief == null)
        {
            try
            {
                thief = GameObject.FindGameObjectWithTag("Thief");
            }
            catch (System.NullReferenceException)
            {
                Debug.Log("Thief未発見" + name);
                Destroy(gameObject);
            }
        }
        //泥棒が見つかったら
        if (thief != null)
        {
            trb         = thief.GetComponent <Rigidbody>();
            ifThiefHide = thief.GetComponent <thiefHide>().ifHide;
        }

        GhostAnim = GetComponentInChildren <GhostAnimationController>();
        SE        = GetComponent <Ghost_Sound>();
        SE.playSE();
        GameOver = false;
    }
Beispiel #2
0
    int index;                                  //Index of current record frame

    private void Start()
    {
        rb2d = GetComponent <Rigidbody2D>();
        gd   = GetComponent <GhostData>();
        ac   = GetComponent <GhostAnimationController>();
    }