public void initData(Transform pCameraTransform, Transform pRoleTranform, Vector3 pPos, Canvas pCanvas, Transform pMapCamerTransform, //Transform pRoleFlagTrans, Transform pMonsterParent) { App.Game.character = this; //mainRoleState = new RoleStateMgr(); //mainRoleState = roleInstance.transform.GetComponent<RoleStateMgr>(); //mainRoleState.initData(roleInstance); monsterParent = pMonsterParent; mainRoleState = roleInstance.transform.GetComponent <roleAI>(); mainRoleState.AIInitData(roleInstance); rolePosCamer = new RolePosAndCamerMgr(); rolePosCamer.initData(roleInstance, pCameraTransform, pRoleTranform, pPos, pCanvas, pMapCamerTransform); mainPro = roleInstance.transform.GetComponent <roleProperty>(); mainPro.InitData(pCameraTransform, pCanvas.transform, 1); //计算跳跃的加速度 //s=0.5*a*t*t a= s/0.5/t/t jumpA = csJumpHeightMax / 0.5f / csJumpUpTime / csJumpUpTime; updateGravity(); // setJumpDownRigidBody(); // test(); //testGrav(); sceneAlpha = null; attackMonster = null; isStart = true; roleIsAttack = false; roleIsEscape = false; roleIsDie = false; skillInit(); }
public void onlyRoleDestory() { roleInstance = null; roleChangeColorWeaponMgr.dataDestory(); roleChangeColorWeaponMgr = null; mainRoleState = null; //角色位置及Camer管理 rolePosCamer = null; mainPro = null; attackMonster = null; //被玩家攻击的怪物 roleIsAttack = false; //玩家是否正在攻击中 roleIsEscape = false; //玩家逃跑中 roleIsDie = false; //玩家死亡 skillDestory(); }