Ejemplo n.º 1
0
    void Start()
    {
        isDogWin      = false;
        isCatWin      = false;
        catJewelCount = 0;
        initObtainedObjectCounts();
        popupMessage = GameObject.FindObjectOfType <GamePopupMessage>();

        if (PhotonManager.Instance.NowPlayerType == PlayerType.Cat)
        {
            dogMoveController.SetActive(false);
            catMoveCotroller.SetActive(true);
            jewelImages = catJewelImages;
        }
        else
        {
            dogMoveController.SetActive(true);
            catMoveCotroller.SetActive(false);
            jewelImages = dogJewelImages;
        }

        sweetController  = GameObject.FindObjectOfType <SweetController>();
        sensorController = GameObject.FindObjectOfType <SensorController>();

        // 攻撃したオブジェクトを購読
        attackedObserve();
        // 獲得したオブジェクトを購読
        obtainedObserve();
        //とりあえず即座にゲーム始まる
        startBattle();
    }
Ejemplo n.º 2
0
    void Start()
    {
        popupMessage = GameObject.FindObjectOfType <GamePopupMessage>();
        alearted     = false;
        animator     = GetComponent <Animator>();

        // 猫に衝突した時
        var OnTriggerEnterPlayer = collider.OnTriggerEnterAsObservable()
                                   .Where(collider => (collider.CompareTag("Cat")) && !alearted)
                                   .Subscribe(_ => onAleart());
    }
    // Start is called before the first frame update
    void Start()
    {
        if (PhotonManager.Instance.IsConnect)
        {
            gameManager = GameObject.FindObjectOfType <GameManager>();
            photonView  = this.GetComponent <PhotonView>();
            if (photonView.isMine)
            {
                playerId = PhotonManager.Instance.PlayerId;
                initGorillaController();
            }

            gameManager.ObserveEveryValueChanged(x => x.IsDogWin)
            .Where(x => x)
            .Subscribe(_ => EndGame());
        }
        else
        {
            initGorillaController();
        }

        dogAnimation = GetComponent <DogAnimation>();
        popupMessage = GameObject.FindObjectOfType <GamePopupMessage>();
    }