예제 #1
0
    // 텐트에서 쉴 수 있는 행동을 하는 IEnumerator
    IEnumerator TentSleep()
    {
        // 현재 게임상의 시간 중 현재 시간에서 오전 6시까지 남은 시간을 계산
        float basicTime;

        if (csSunMove.Instance.CurTime >= 18f && csSunMove.Instance.CurTime <= 24f)
        {
            basicTime = 30f;
        }
        else
        {
            basicTime = 6f;
        }
        basicTime = basicTime - csSunMove.Instance.CurTime;
        basicTime = basicTime * (15 * (1 / csSunMove.Instance.TurnSpeed));

        // 현재 게임시간에서 오전 6시까지의 시간을 계산하여 대기한다.
        yield return(new WaitForSeconds(basicTime));

        // 대기한 후 게임시간과 플레이어의 상태를 이전 상태로 되돌림
        csCharacterStatus cs = csCharacterStatus.Instance;

        cs.curHp  = cs.maxHp;
        cs.isStop = false;
        csCameraController.isStop = false;
        cs.isSleep     = false;
        Time.timeScale = 1f;
    }
예제 #2
0
 // 싱글톤 객체들을 호출하여 미리 초기화를 한다.
 void Awake()
 {
     csItemList        list      = csItemList.Instance;
     csCombineInfo     combInfo  = csCombineInfo.Instance;
     csInventory       inventory = csInventory.Instance;
     csCharacterStatus cs        = csCharacterStatus.Instance;
 }
예제 #3
0
 // 오브젝트 및 변수 초기화
 void Awake()
 {
     transform = gameObject.GetComponent <Transform> ();
     cc        = gameObject.GetComponent <CharacterController> ();
     charStats = csCharacterStatus.Instance;
     attackPS  = attackEffectT.GetComponent <ParticleSystem> ();
     takePS    = takeEffectT.GetComponent <ParticleSystem> ();
     thirdAnim = gameObject.GetComponent <Animator> ();
     Init();
 }