コード例 #1
0
ファイル: GameMode.cs プロジェクト: paulash/LoveChicken
    public void SpawnChicken(GameObject chickenPrefab)
    {
        chickenGO = GameObject.Instantiate(chickenPrefab, new Vector3(0.2f, 0.1f, 0), Quaternion.identity);
        chickenGO.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);

        chickenBrain    = chickenGO.GetComponent <ChickenBrain>();
        chickenAnimator = chickenGO.GetComponent <ChickenAnimator>();
        chickenSound    = chickenGO.GetComponent <ChickenSound>();
    }
コード例 #2
0
    void Awake()
    {
        base.Awake();
        _animator = GetComponent <Animator>();
        _manager  = FindObjectOfType <GameManager>();
        _sound    = GetComponent <ChickenSound>();
        float angle = Random.Range(0, 2 * Mathf.PI);

        goTo = _manager.center.position;
    }
コード例 #3
0
ファイル: ChickenBrain.cs プロジェクト: paulash/LoveChicken
    float happiness = 0; // -1 to 1

    private void Awake()
    {
        chickenAnimator = GetComponent <ChickenAnimator>();
        chickenSound    = GetComponent <ChickenSound>();

        List <Question> shuffledQuestions = new List <Question>(questions);

        Shuffle <Question>(shuffledQuestions);
        questions = shuffledQuestions.ToArray();
    }