Beispiel #1
0
    internal void Initialization(IParkourPlayerController PlayerController)
    {
        m_PlayerController      = PlayerController;
        m_RandomEventTimer_Bear = UnityEngine.Random.Range(m_RandomEventTimer_BearBegin, m_RandomEventTimer_BearEnd);

        /*
         * 重点问题:
         * 加密狗在安卓上几个小时后就会休眠,所有和加密狗的访问都会发生崩溃。
         * 所以,在整个游戏运用过程中不应该在访问加密狗已经访问和加密狗相关联的任何功能了。
         * 这里使用缓冲机制处理xml的读取
         *
         * */
        //XmlDocument doc = GameRoot.gameResource.LoadResource_XmlFile("HumanoidAnimation.xml");
        XmlDocument doc      = GameRoot.gameResource.BuffResource_XmlFile("HumanoidAnimation.xml");
        XmlNodeList nodelist = doc.SelectNodes("item");
        int         i        = 0;

        for (i = 0; i < nodelist.Count; i++)
        {
            AnimationParam obj = new AnimationParam();
            obj.id            = Convert.ToInt32(nodelist[i].Attribute("AniID"));
            obj.AnimationName = Convert.ToString(nodelist[i].Attribute("AnimationName"));
            obj.paramName     = Convert.ToString(nodelist[i].Attribute("paramName"));
            obj.paramValue    = (float)Convert.ToDouble(nodelist[i].Attribute("paramValue"));
            obj.nowTimer      = 0.0f;
            obj.delValue      = (float)Convert.ToDouble(nodelist[i].Attribute("delValue"));
            obj.delTimer      = (float)Convert.ToDouble(nodelist[i].Attribute("delTimer"));
            m_AnimationParamlist.Add(obj.id, obj);
        }
    }
 //光头强抓到我了
 public void OnEventGuangTouQiangCaptureMy(IParkourPlayerController guangTouQiang)
 {
     //抓住后加速
     status             = XiongStatus.Status_Standby;
     IsSelectTurnDirect = false;
     playerController.OpenPlayerSystemForceAccelerate(captureAccelerateValue,
                                                      captureAccelerateDampRate);
     //播放被抓住动画和语言
     playerController.playerAnimator.BrotherBearAniCollideArrest();
 }
    private static void ReplacePlayerWheelParticle(IParkourPlayerController player, RaceSceneControl.IParkourSceneDefine sceneDefine)
    {
        GameObject particleObject = (GameObject)Instantiate((GameObject)sceneDefine.frontWheelParticlePrefabs);

        particleObject.transform.parent        = player.particleList[0].transform.parent;
        particleObject.transform.localPosition = player.particleList[0].transform.localPosition;
        particleObject.transform.localRotation = player.particleList[0].transform.localRotation;
        UnityEngine.Object.Destroy(player.particleList[0].gameObject);
        player.particleList[0] = particleObject.GetComponent <ParticleSystem>();

        particleObject = (GameObject)Instantiate((GameObject)sceneDefine.backWheelParticlePrefabs);
        particleObject.transform.parent        = player.particleList[1].transform.parent;
        particleObject.transform.localPosition = player.particleList[1].transform.localPosition;
        particleObject.transform.localRotation = player.particleList[1].transform.localRotation;
        UnityEngine.Object.Destroy(player.particleList[1].gameObject);
        player.particleList[1] = particleObject.GetComponent <ParticleSystem>();
    }
 //我抓到一只熊
 public void OnEventMeCaptureXiong(IParkourPlayerController xiong)
 {
     //播放抓住动画和语言
     playerController.playerAnimator.GuangtouqiangAniCollideArrest();
 }