Esempio n. 1
0
    private void Start()
    {
        rigidbody     = this.GetComponent <Rigidbody>();
        box           = this.GetComponent <BoxCollider>();
        audio         = this.GetComponent <AudioSource>();
        scene1Manager = GameObject.Find("Scene1Manager").GetComponent <Scene1Manager>();

        box.size             = new Vector3(50f, 50f, 50f);
        rigidbody.useGravity = false;
    }
Esempio n. 2
0
    private void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }

        instance = this;
        DontDestroyOnLoad(this.gameObject);
    }
Esempio n. 3
0
    void Start()
    {
        scene1Manager = FindObjectOfType <Scene1Manager>();
        scene1DB      = scene1Manager.scene1DB[scene1Manager.process];
        dialogueData  = CSVReader.Read(scene1DB.textFile);


        dialogueUI  = GameObject.Find("Dialogue UI");
        dialogueBox = dialogueUI.transform.Find("Dialogue Box").GetComponent <Image>();
        txt         = dialogueBox.transform.Find("Dialogue Text").GetComponent <Text>();
        panel       = dialogueUI.transform.Find("Dialogue Panel").GetComponent <Image>();
    }
Esempio n. 4
0
 private void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(this.gameObject);
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
     process = 0;
 }
Esempio n. 5
0
    private void Awake()
    {
        //Singleton pattern stuff
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            instance = this;
        }

        cube = noteGameObject.GetComponent <Cube>();
    }
Esempio n. 6
0
    // Use this for initialization
    void Start()
    {
        scene1Manager = GameObject.Find("Scene1Manager").GetComponent <Scene1Manager>();

        _transform      = this.gameObject.GetComponent <Transform>();                  //내 위치
        playerTransform = GameObject.FindWithTag("Player").GetComponent <Transform>(); //지정한 태그를 달고 있는 게임오브젝트를 찾음
        //nvAgent = this.gameObject.GetComponent<NavMeshAgent>();
        _animator = this.gameObject.GetComponent <Animator>();                         //객체에 등록된 Animator를 가져옴
        capsule   = this.gameObject.GetComponent <CapsuleCollider>();

        player       = GameObject.FindWithTag("Player"); // 플레이어 오브젝트에 플레이어 등록
        playerScript = player.GetComponent <Player>();   // 플레이어 스크립트 가져옴(공격 판정에 사용)

        // 추적 대상의 위치를 설정하면 바로 추적 시작
        // nvAgent.destination = playerTransform.position;

        StartCoroutine(this.CheckState());
        StartCoroutine(this.CheckStateForAction());
    }
Esempio n. 7
0
 private void Awake()
 {
     instance = this;
 }
Esempio n. 8
0
 private void Start()
 {
     scene1Manager = GameObject.Find("Scene1Manager").GetComponent <Scene1Manager>();
 }