예제 #1
0
파일: NPCMove.cs 프로젝트: tbollman/CvS
 // Start is called before the first frame update
 void Start()
 {
     Init();
     targetUnit = null;
     hM         = GetComponent <HealthManager>();
     cM         = GameObject.FindGameObjectWithTag("cam").GetComponent <Camera_Manager>();
 }
예제 #2
0
 protected void OnDestroy()
 {
     if (singleton == this)
     {
         singleton = null;
     }
 }
예제 #3
0
    public void Event_Init()
    {
        str_ride_car = ride_car.Instance;
        str_char     = Character.Instance;
        str_Game_mag = Game_Manager.Instance;
        str_camera   = Camera_Manager.Instance;

        //1회만 셋팅.
        dir_p_set = false;
        steel_on  = false;

        //충돌 차량 관련 변수
        car_speed  = 6.0f;
        dump_speed = 10.0f;
        car_attack = false;
        dump_on    = false;
        car_dis    = .0f;
        car_dir    = new Vector3(0, 0, 0);
        car_roll   = 20.0f;

        dis_steel_       = .0f;
        dir_steel_       = new Vector3(0, 0, 0);
        steel_attack     = false;
        steel_down_speed = 5.0f;

        //파편과 파편방향 초기화.
        for (int i = 0; i < 4; i++)
        {
            player_p[i].GetComponent <Renderer>().enabled = false;

            player_p[i].transform.position     = str_char.transform.position;
            player_p_dir[i].transform.position = str_char.transform.position;
        }
    }
 // Use this for initialization
 void Start()
 {
     healthBarLength = Screen.width / 3;
     origPos         = transform.position; // Marks Starting Position
     // Calls in camera functions to this script
     myOtherCameraManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Camera_Manager> ();
     myCameraTrigger      = GameObject.FindGameObjectWithTag("camCollider").GetComponent <Camera_Trigger> ();
 }
예제 #5
0
 void Start()
 {
     pM         = GetComponent <PlayerMove>();
     turn       = pM.turn;
     willMove   = false;
     attacking  = false;
     targetUnit = null;
     hM         = GetComponent <HealthManager>();
     cM         = GameObject.FindGameObjectWithTag("cam").GetComponent <Camera_Manager>(); //.GetComponent<Camera_Manager>();
 }
	// Use this for initialization
	void Awake(){
		if (sInstance != null && sInstance != this)
		{
			Destroy(this.gameObject);
			return;
		}
		else
		{
			sInstance = this;
		}
		DontDestroyOnLoad (this.gameObject);
	}
예제 #7
0
 protected void Awake()
 {
     if (singleton == null)
     {
         singleton = this;
         DontDestroyOnLoad(singleton);
         init();
     }
     else
     {
         Destroy(this);
     }
 }
    // Use this for initialization
    void Start()
    {
        if (GetComponent <Camera_Manager> () != null)
        {
            cameraManager = GetComponent <Camera_Manager> ();
        }
        else
        {
            Debug.LogError("You need to add a camera manager to the game manager");
        }

        pInv = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Inventory>();
        // Change later to main menu instead of loading into game
        view = ViewState.GAME;
    }
 // Helper / Util methods
 private void HandleRespawn()
 {
     // We've been teleported to the new position on respawn
     if (Time.realtimeSinceStartup >= fadeTimer + timeToFade / 2 && fadeTimer != 0)
     {
         transform.position = determineRespawnPos(spawnPos.position, 15); // Set player pos to current respawn point
         Camera_Manager cm = manager.GetComponent <Camera_Manager>();
         cm.DeactivateAllCameras();
         fadeTimer = -1;
         cameraRespawnLookingAtPlayer.SetActive(true);
     }
     if (Time.realtimeSinceStartup >= fadeTimer + timeToFade && fadeTimer == -1)
     {
         fadeTimer      = 0;
         Time.timeScale = 1;
         state          = PLAYER_STATE.ALIVE; // Finally set us back to alive
     }
 }
예제 #10
0
    void Start()
    {
        str_Event_Mag  = Event_Manager.Instance; //사용할때 변수 안쓰고 쓸라면 (Event_Manager.Instance).
        str_Camera_Mag = Camera_Manager.Instance;
        str_Character  = Character.Instance;
        str_ride_car   = ride_car.Instance;
        str_sound_Mag  = Sound_Manager.Instance;

        //타 클래스 초기화.
        str_Event_Mag.Event_Init();
        str_Character.Character_Init();
        str_ride_car.ride_car_Init();
        str_Camera_Mag.Camera_Init();

        eat_ice_cream = true;
        ice_cream     = false;
        trash_check   = false;
        car_check     = false;
        F_key_        = true;

        ride_car_update = false;
        ride_car_Evnet  = false;
        char_update     = true;
        trash_Event     = false;
        cross_Event     = false;
        steel_down      = false;

        shoot_       = false;
        trash_shoot_ = false;
        dir_con      = new Vector3(0, 0, 0);

        c_distance = .0f;
        t_distance = .0f;
        trash_dis  = 4.0f;

        spriteRenderer = GameObject.Find("Player_ice_cream").GetComponent <SpriteRenderer>();

        //오브젝트 위치 set
        obj_trash.transform.position = new Vector3(-5.66f, 3.94f, -1.0f);

        //background_bgm
        str_sound_Mag.PlayBGM(1);
    }
예제 #11
0
    public void Character_Init()
    {
        c_move = false;

        str_Game_mag   = Game_Manager.Instance;
        str_camera_mag = Camera_Manager.Instance;
        str_sound_mag  = Sound_Manager.Instance;

        //character start postion
        transform.position = new Vector3(1.29f, -7.62f, -1.0f);


        //위치 초기화.
        wall_check[0].transform.position = new Vector3(transform.position.x,
                                                       transform.position.y,
                                                       transform.position.z);

        animator = GetComponent <Animator>();
        animator.applyRootMotion = false;
    }
 // Use this for initialization
 void Start()
 {
     player            = GameObject.FindGameObjectWithTag("Player");
     player_controller = player.GetComponent <Player_Controller> ();
     cameraManager     = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Camera_Manager> ();
 }
 // Use this for initialization
 void Start()
 {
     myCameraManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Camera_Manager> ();
 }
예제 #14
0
 // Use this for initialization
 void Start()
 {
     Cursor.visible = false;
     a_animation    = GetComponentInParent <Animator>();
     cm             = GameObject.FindGameObjectWithTag("Animation_Kontroller").GetComponent <Camera_Manager>();
 }
예제 #15
0
 void Awake()
 {
     Instance = this;
 }
예제 #16
0
 void Start()
 {
     z_zl = GameObject.FindObjectOfType(typeof(Zombie_Leben)) as Zombie_Leben;
     cm   = GameObject.FindGameObjectWithTag("Zombie_Animation_Kontroller").GetComponent <Camera_Manager>();
     p_pl_collider.enabled = false;
 }
 private void Awake()
 {
     Instance = this;
 }