Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        SpawnParticleCom = gameObject.AddComponent <XKSpawnParticle>();
        for (int i = 0; i < QianGuanTwRot.Length; i++)
        {
            QianGuanTwRot[i].enabled = false;
        }
        FireLayer    = XkGameCtrl.GetInstance().PlayerAmmoHitLayer;
        PlayerScript = GetComponent <XkPlayerCtrl>();
        PlayerScript.SetPlayerAutoFireScript(this);
        PlayerStEnum = PlayerScript.PlayerSt;

        AmmoStatePOne = PlayerAmmoType.PuTongAmmo;
        AmmoStatePTwo = PlayerAmmoType.PuTongAmmo;
        if (PlayerStEnum != PlayerTypeEnum.CartoonCamera)
        {
            PlayerAudio = PlayerScript.PlayerAudio;
            for (int i = 0; i < 7; i++)
            {
                if (i < 6)
                {
                    PlayerAudio[i].loop = false;
                }
                else
                {
                    PlayerAudio[i].loop = true;
                }
                PlayerAudio[i].Stop();
            }

            InitPlayerAmmoList();
            //InputEventCtrl.GetInstance().ClickFireBtOneEvent += ClickFireBtOneEvent;
            InputEventCtrl.GetInstance().ClickFireBtTwoEvent += ClickFireBtTwoEvent;
            //InputEventCtrl.GetInstance().ClickDaoDanBtOneEvent += ClickDaoDanBtOneEvent;
            InputEventCtrl.GetInstance().ClickDaoDanBtTwoEvent += ClickDaoDanBtTwoEvent;
//			if (Network.peerType == NetworkPeerType.Server) {
//				InitPlayerAmmoList();
//			}
//
//			if ((PlayerStEnum == PlayerTypeEnum.FeiJi && XkGameCtrl.GameJiTaiSt == GameJiTaiType.FeiJiJiTai)
//			    || (PlayerStEnum == PlayerTypeEnum.TanKe && XkGameCtrl.GameJiTaiSt == GameJiTaiType.TanKeJiTai)){
//				InitPlayerAmmoList();
//				InputEventCtrl.GetInstance().ClickFireBtOneEvent += ClickFireBtOneEvent;
//				InputEventCtrl.GetInstance().ClickFireBtTwoEvent += ClickFireBtTwoEvent;
//				InputEventCtrl.GetInstance().ClickDaoDanBtOneEvent += ClickDaoDanBtOneEvent;
//				InputEventCtrl.GetInstance().ClickDaoDanBtTwoEvent += ClickDaoDanBtTwoEvent;
//			}
        }
        else
        {
            this.enabled = false;
        }
    }