void Start() { s_tag = Util.S_ENEMY; Main_Bullet = Resources.Load("BulletPrefab/" + Util.S_GATLING_BULLET_NAME) as GameObject; Sub_Bullet = Resources.Load("BulletPrefab/" + Util.S_GRENADE_BULLET_NAME) as GameObject; Weapon1 = new GeneralInitialize.GunParameter(Util.S_GATLING_NAME, Util.S_GATLING_BULLET_NAME, Util.F_GATLING_BULLET_SPEED, Util.F_GATLING_BULLET_DAMAGE, Util.F_GATLING_MAGAZINE); Weapon2 = new GeneralInitialize.GunParameter(Util.S_GRENADE_NAME, Util.S_GRENADE_BULLET_NAME, Util.F_GRENADE_BULLET_SPEED, Util.F_GRENADE_BULLET_DAMAGE, Util.F_GRENADE_MAGAZINE); InitializeParam(); cur_Weapon = Weapon1; Muzzle = Muzzle1; spine_GunAnim.Skeleton.SetSkin(Weapon1.s_GunName); if (UI != null) { GameObject _uiGo = Instantiate(UI) as GameObject; _uiGo.SendMessage("SetTarget", this, SendMessageOptions.RequireReceiver); } else { Debug.LogWarning("<Color=Red><a>Missing</a></Color> PlayerUiPrefab reference on player Prefab.", this); } PhotonNetwork.sendRate = 500 / Launcher.MaxPlayersPerRoom; PhotonNetwork.sendRateOnSerialize = 500 / Launcher.MaxPlayersPerRoom; // Find Photon Voice Recorder And Speaker recorder = this.GetComponent <PhotonVoiceRecorder>(); speaker = this.GetComponent <PhotonVoiceSpeaker>(); }
protected virtual void ChangeWeapon() { if (Input.GetKeyDown(KeyCode.Alpha1)) { Muzzle = Muzzle1; cur_Weapon = Weapon1; spine_GunAnim.Skeleton.SetSkin(Weapon1.s_GunName); spine_GunAnim.Skeleton.SetToSetupPose(); spine_GunAnim.AnimationState.Apply(spine_GunAnim.Skeleton); b_Fired = false; } if (Input.GetKeyDown(KeyCode.Alpha2)) { if (Muzzle2 != null) { Muzzle = Muzzle2; } else { Muzzle = null; } cur_Weapon = Weapon2; spine_GunAnim.Skeleton.SetSkin(Weapon2.s_GunName); spine_GunAnim.Skeleton.SetToSetupPose(); spine_GunAnim.AnimationState.Apply(spine_GunAnim.Skeleton); b_Fired = false; } }
void Start() { s_tag = Util.S_PLAYER; n_hp = Util.F_TOWER_HP; f_Speed = Util.F_TOWER_SPEED; f_Damage = Util.F_TOWER_DAMAGE; shootDelayTime = 0.5f; Target = GameObject.FindWithTag(s_tag); //Bullet = Resources.Load("BulletPrefab/" + Util.S__BULLET_NAME) as GameObject; //EnemyWeapon = new GeneralInitialize.GunParameter(Util.S__NAME, Util.S__BULLET_NAME, Util.F__BULLET_SPEED, Util.F__BULLET_DAMAGE, Util.F__MAGAZINE); //디버깅용 Bullet = Resources.Load("BulletPrefab/" + Util.S_ENEMY_BULLET_NAME) as GameObject; EnemyWeapon = new GeneralInitialize.GunParameter(Util.S_ENEMY_NAME, Util.S_ENEMY_BULLET_NAME, Util.F_ENEMY_BULLET_SPEED, Util.F_ENEMY_BULLET_DAMAGE, Util.F_ENEMY_MAGAZINE); //여기까지 InitializeParam(); }
// Use this for initialization void Start() { s_tag = Util.S_PLAYER; n_hp = Util.F_ROBOT_HP; f_Speed = Util.F_ROBOT_SPEED; f_Damage = Util.F_ROBOT_DAMAGE; //shootDelayTime = 0.333f; //총알 발사 딜레이 Target = GameObject.FindWithTag(s_tag); v_muzzle[0] = this.gameObject.transform.position; Bullet = Resources.Load("BulletPrefab/" + Util.S_SMG_BULLET_NAME) as GameObject; EnemyWeapon = new GeneralInitialize.GunParameter(Util.S_SMG_NAME, Util.S_SMG_BULLET_NAME, 6.0f, Util.F_SMG_BULLET_DAMAGE, Util.F_SMG_MAGAZINE); InitializeParam(); if (spine_CharacterAnim == null) { return; } spine_CharacterAnim.state.Event += BossOnevent; spine_CharacterAnim.state.Start += delegate(Spine.TrackEntry entry) { if (spine_CharacterAnim.state.GetCurrent(entry.TrackIndex).Animation.name == "Shot") { int temp = Random.Range(1, 3); string animName = "Robot_Attack" + temp; spine_CharacterAnim.state.SetAnimation(1, animName, true); } if (spine_CharacterAnim.state.GetCurrent(entry.TrackIndex).Animation.name == "Dead") { b_IsSpin = false; spine_CharacterAnim.state.ClearTrack(2); spine_CharacterAnim.state.SetAnimation(1, "Robot_Dead", true); } if (spine_CharacterAnim.state.GetCurrent(entry.TrackIndex).Animation.name == "Idle") { if (spine_CharacterAnim.state.GetCurrent(2) != null) { b_IsSpin = false; spine_CharacterAnim.state.GetCurrent(2).loop = false; } spine_CharacterAnim.state.SetAnimation(1, "Robot_Idle1", true); } }; spine_CharacterAnim.state.Complete += delegate(Spine.TrackEntry entry) { if (spine_CharacterAnim.state.GetCurrent(entry.TrackIndex).Animation.name == "Spin") { if (b_IsSpin) { return; } else { spine_CharacterAnim.state.ClearTrack(entry.TrackIndex); } } }; for (int i = 0; i < deadPart.Length; i++) { deadPart[i].Stop(); } //this.photonView.RPC("StartSpawn", PhotonTargets.All); }