Пример #1
0
    private void NewDoll()
    {
        Level      += 1;
        CuredDolls += 1;

        Save();

        // Destroy old
        if (CurrentDoll != null)
        {
            // Move doll away and destroy
            CurrentDoll.MoveAway = true;
            Destroy(CurrentDoll.gameObject, 5f);
        }

        var newDoll = Instantiate(DollPrefab);

        newDoll.transform.position = new Vector3(15f, 0f, 0f);
        CurrentDoll        = newDoll.GetComponent <DollController>();
        CurrentDoll.MoveIn = true;

        // Spawn audio effect
        var soundEffect = Instantiate(AudioPlayerPrefab).GetComponent <AudioSource>();

        soundEffect.clip = NewDollClip;
        soundEffect.Play();
        Destroy(soundEffect.gameObject, 3f);
    }
Пример #2
0
    /*
     * DollController
     * 1. 알이 선택되었으면 일반공격과 스킬을 고른다.
     * 2. 골랐다면 attacking이 treu로 바뀌며 알을 조종할 수 있게 된다.
     * 3. 알을 조종하였다면 attacking이 false로 바뀌고 턴을 상대에게 넘긴다.
     * 4. 취소하려면 조종하는 상태에서 화면 가장 위 취소선 이내로 드래그해야한다.
     * 5. 취소했을 경우 알의 선택을 해제한다.
     */

    void Awake()
    {
        _instance = this;
    }