// Use this for initialization void Awake() { respawn_position_vec3 = transform.position; O_camera = GameObject.Find("Main Camera"); b_die = false; f_jump_speed = 8.5f; f_speed = 8.0f; player_rig = GetComponent <Rigidbody2D>(); t_ground_check = transform.Find("Groundcheck"); t_ground_check2 = transform.Find("Groundcheck2"); t_pic = transform.Find("pic"); player_spine_animator = transform.GetChild(0).GetComponent <Animator>(); player_animator = gameObject.GetComponent <Animator>(); player_tra = gameObject.GetComponent <Transform>(); jump_vec2 = new Vector2(0, f_jump_speed); player_coll = GetComponent <Collider2D>(); respawn_position_vec3 = transform.position; b_jump = false; i_hp = 3; i_hp_tmp = 3; HP_ui = GameObject.Find("UI_HP").GetComponent <C_UIHP>(); player_box = gameObject.GetComponent <BoxCollider2D>(); player_material = player_box.sharedMaterial; AOE_col = transform.GetChild(3); AOE_col.gameObject.SetActive(false); b_AOE_has = false; b_hurting = b_play_ani = false; b_attack_enable = true; f_hurting_time = f_attack_time = 0; skeleton_animator = transform.GetChild(0).GetComponent <SkeletonAnimator>(); i_hit_number = 0; }
void Awake() { // Setting up the references. skeletonAnimation = GetComponent <SkeletonAnimator>(); frontCheck = transform.Find("frontCheck").transform; groundcheck = transform.Find("groundcheck").transform; //score = GameObject.Find("Score").GetComponent<Score>(); faceright = !faceright; sign *= -1; skeleton = skeletonAnimation.Skeleton; bone = skeletonAnimation.Skeleton.FindBone(boneName); anim = GetComponent <Animator>(); GunposBone = this.gameObject.transform.GetChild(3); bulletBone = this.gameObject.transform.GetChild(4); weapon1 = this.gameObject.transform.GetChild(1).gameObject; line = Instantiate(lockLiser); //父物体设为闪电对象 line.transform.parent = transform; //设为非激活 line.SetActive(false); }
protected override void gui() { base.gui(); EditorGUILayout.PropertyField(layerMixModes, true); SkeletonAnimator component = (SkeletonAnimator)target; int CurrentSkipRate = EditorGUILayout.IntField("CurrentSkipRate", component.CurrentSkipRate); if (CurrentSkipRate != component.CurrentSkipRate) { component.CurrentSkipRate = CurrentSkipRate; } if (!component.valid) { return; } EditorGUILayout.Space(); if (!isPrefab) { if (component.GetComponent <SkeletonUtility>() == null) { if (GUILayout.Button(new GUIContent("Add Skeleton Utility", SpineEditorUtilities.Icons.skeletonUtility), GUILayout.Height(30))) { component.gameObject.AddComponent <SkeletonUtility>(); } } } }
protected virtual void OnSpineEvent(SkeletonAnimator animator, int layer_index, Spine.Event ev) { if (ev.Data.name == AnimatorParameters.FireEvent) { OnFire(); } }
protected override void DrawInspectorGUI() { base.DrawInspectorGUI(); EditorGUILayout.PropertyField(layerMixModes, true); SkeletonAnimator component = (SkeletonAnimator)target; if (!component.valid) { return; } EditorGUILayout.Space(); if (!isPrefab) { if (component.GetComponent <SkeletonUtility>() == null) { if (GUILayout.Button(new GUIContent("Add Skeleton Utility", SpineEditorUtilities.Icons.skeletonUtility), GUILayout.Height(30))) { component.gameObject.AddComponent <SkeletonUtility>(); } } } }
// 根据动画root移动角色 add by TangJian 2018/12/8 1:37 public virtual void MoveByAnim(SkeletonAnimator skeletonAnimator) { AnimatorStateInfo nextStateInfo = _animator.GetNextAnimatorStateInfo(0); bool hasNext = nextStateInfo.fullPathHash != 0; // 锁定位置 add by TangJian 2018/8/2 23:00 Vector3 moveByPos = skeletonAnimator.RootBonePos; RoleAnimController.transform.localPosition = new Vector3(GetDirectionInt() > 0 ? moveByPos.x : -moveByPos.x, -moveByPos.y, RoleAnimController.transform.localPosition.z); var movePosition = moveByPos - skeletonAnimator.RootBoneLastPos; skeletonAnimator.RootBoneLastPos = moveByPos; // 使用方向向量影响动画移动 var moveVector = new Vector3(joystick.x, 0, joystick.y); moveVector = movePosition.magnitude * moveVector.normalized; movePosition = moveVector; Vector3 moveXZ = new Vector3(movePosition.x * AnimMoveSpeedScale, -0.001f, movePosition.z * AnimMoveSpeedScale); Vector3 moveY = new Vector3(0, movePosition.y, 0); if (moveXZ.magnitude > 0.01) { Move(moveXZ); Debug.Log("moveXZ" + moveXZ); } if (moveY.magnitude > 0.01) { Move(moveY); Debug.Log("moveY" + moveY); } }
public override void Awake() { base.Awake(); SkeletonAnimator skeletonAnimator = MainAnimator.gameObject.GetComponent <SkeletonAnimator>(); skeletonAnimator.initialSkinName = "qiu"; skeletonAnimator.Initialize(true); MainRigidbody.useGravity = true; MainRigidbody.freezeRotation = true; foreach (RoleController roleController in SceneManager.Instance.CurrScene.RoleControllerList) { if (roleController.RoleData.TeamId != TeamId) { mubiaolist.Add(roleController); } } mubiaolist.Sort((RoleController a, RoleController b) => { if ((gameObject.transform.position - a.transform.position).magnitude > (gameObject.transform.position - b.transform.position).magnitude) { return(1); } else if ((gameObject.transform.position - a.transform.position).magnitude < (gameObject.transform.position - b.transform.position).magnitude) { return(-1); } else { return(0); } }); // MainDamageController.gameObject.SetActive(false); }
void OnValidate() { if (skeletonAnimation == null) { skeletonAnimation = GetComponent <SkeletonAnimator>(); } }
// Use this for initialization void Start() { skeletonAnimation = GetComponent <SkeletonAnimator>(); rigi = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); skeleton = skeletonAnimation.Skeleton; //weapon = GameObject.Find("weapon1"); }
protected virtual void Start() { stateMachine = GetComponentInChildren <Animator>(); skeletonAnimator = GetComponentInChildren <SkeletonAnimator>(); viewResetPos = skeletonAnimator.transform.localPosition; //Store this for ResetView() LinkToStateBehaviors(); controller = controllerContainer.Result; //Make controller linkable in the editor, still accessible as an interface. }
private void LazyInit(Animator animator) { baseSkillController = animator.GetComponentInParent <Tang.BaseSkillController>(); roleController = animator.GetComponentInParent <Tang.RoleController>(); skeletonAnimator = animator.gameObject.GetComponent <SkeletonAnimator>(); valid = skeletonAnimator != null && skeletonAnimator.FrameEventDic != null; }
public void SkeletonAnimatorEyesAttachedTest() { SkeletonAnimator skeletonAnimator = character.GetComponentInChildren <SkeletonAnimator>(); List <BoneFollower> boneFollowers = new List <BoneFollower>(skeletonAnimator.GetComponentsInChildren <BoneFollower>()); GameObject eyesAttach = boneFollowers.Find(x => x.name == "EyesAttach").gameObject; Assert.NotNull(eyesAttach, "There must be a BoneFollower component on an object called EyesAttach, parented to the SkeletonAnimator of the character."); }
public void PupilsAttachedTest() { SkeletonAnimator skeletonAnimator = character.GetComponentInChildren <SkeletonAnimator>(); List <BoneFollower> boneFollowers = new List <BoneFollower>(skeletonAnimator.GetComponentsInChildren <BoneFollower>()); GameObject eyesAttach = boneFollowers.Find(x => x.name == "EyesAttach").gameObject; PupilOffsetter pupilOffsetter = eyesAttach.GetComponentInChildren <PupilOffsetter>(); Assert.NotNull(pupilOffsetter.pupil, "The pupil sprite must be referenced by the PupilOffsetter component"); }
void Awake() { // Set up references. playerRigidbody = GetComponent <Rigidbody> (); GameObject grandChild = this.gameObject.transform.GetChild(0).GetChild(0).gameObject; animator = grandChild.GetComponent <Animator> (); skeletonAnimator = grandChild.GetComponent <SkeletonAnimator> (); }
public void PupilOffsetterExistsTest() { SkeletonAnimator skeletonAnimator = character.GetComponentInChildren <SkeletonAnimator>(); List <BoneFollower> boneFollowers = new List <BoneFollower>(skeletonAnimator.GetComponentsInChildren <BoneFollower>()); GameObject eyesAttach = boneFollowers.Find(x => x.name == "EyesAttach").gameObject; PupilOffsetter pupilOffsetter = eyesAttach.GetComponentInChildren <PupilOffsetter>(); Assert.NotNull(pupilOffsetter, "There must be a PupilOffsetter object parented to EyeAttach."); }
void Start() { mesh = transform.GetComponent <MeshRenderer>(); mesh.material = null; mAni = transform.GetComponent <SkeletonAnimator>(); StartCoroutine(RestMat()); }
protected virtual void Awake() { animator_ = GetComponent <Animator>(); skeleton_animator_ = GetComponent <SkeletonAnimator>(); rigidbody2D_ = GetComponent <Rigidbody2D>(); muzzle_ = GetComponentInChildren <Muzzle>(); muzzle_.Register(this, OnNewBullet); damagearea_layer_mask_ = LayerMask.NameToLayer(Consts.kDamageAreaLayer); }
// Use this for initialization void Start() { sktAnimator = GetComponent<SkeletonAnimator>(); if (sktAnimator == null) { Debug.LogError("sktAnimator == null"); } else { sktAnimator.GetSkeleton().flipX = true; sktAnimator.GetSkeleton().SetColor(new Color(1.0f, 0.0f, 0.0f)); } sktAnimation = GetComponent<SkeletonAnimation>(); if (sktAnimation == null) { Debug.LogError("sktAnimation == null"); } else { Debug.Log("animation : " + sktAnimation.state.GetCurrent(0)); } animator = GetComponent<Animator>(); if (animator == null) { Debug.LogError("animator == null"); } else { AnimatorClipInfo[] items = animator.GetCurrentAnimatorClipInfo(0); Debug.Log("items length : " + items.Length); foreach (AnimatorClipInfo item in items) { Debug.Log("" + item.clip.name); } Debug.Log("ok"); // Debug.Log ("animator : " + animator.GetComponent<UnityEngine.Animation>().name); } sktUtility = GetComponent<SkeletonUtility>(); if (sktUtility == null) { Debug.LogError ("sktUtility == null"); } else { Debug.Log ("123123" + sktUtility.skeletonAnimation.Skeleton.Slots); // foreach (Slot item in sktUtility.skeletonAnimation.Skeleton.Slots) // { // Debug.Log ("item : " + item.ToString()); // if (item.ToString().Equals("front_bracer")) // { // item.SetColor(new Color(0.0f, 1.0f, 0.0f)); // } // } } }
// Use this for initialization void Start() { skeletonAnimation = GetComponent <SkeletonAnimator>(); rigi = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); skeleton = skeletonAnimation.Skeleton; bone = skeletonAnimation.Skeleton.FindBone(boneName); GunposBone = GameObject.Find("gunpos"); bulletBone = GameObject.Find("bulletpos"); playerpos = player.transform.GetChild(0); }
private IEnumerator handleDelayTrigger(float time, string actionName) { yield return(new WaitForSeconds(time)); if (null != SkeletonAnimator) { SkeletonAnimator.SetTrigger(actionName); FaceAnimator.SetTrigger(actionName); } yield return(null); }
/// <summary> /// Awake is called when the script instance is being loaded. /// </summary> public override void Awake() { // 刚体 add by TangJian 2018/01/16 16:15:37 base.Awake(); // 动画 add by TangJian 2018/01/15 15:04:59 skeletonAnimation = GetComponentInChildren <SkeletonAnimator>(); // 伤害 add by TangJian 2018/01/15 15:05:04 { damageController = GetComponentInChildren <DamageController>(); var damageData = damageController.damageData; damageData.itriggerDelegate = this; damageData.force = Vector3.zero; } }
public void SetBackwards(Vector3 offest) { if (gameObject.GetComponent <RoleBehaviorTree>() != null) { if (_currAnimatorStateInfo.IsTag("idle") || _currAnimatorStateInfo.IsTag("walk") || _currAnimatorStateInfo.IsTag("run")) { if (direction == Direction.Left) { if (offest.x > 0) { SkeletonAnimator.SetBackwards(true); } else { SkeletonAnimator.SetBackwards(false); } } else { if (offest.x < 0) { SkeletonAnimator.SetBackwards(true); } else { SkeletonAnimator.SetBackwards(false); } } } else { SkeletonAnimator.SetBackwards(false); } } }
public override void RefreshRoleAnim(SkeletonAnimator skeletonAnimator) { Debug.Log("RefreshRoleAnim: " + name); if (RoleData.EquipData.HasMainHand()) { SkeletonAnimator.AddSkin("MainHand", RoleData.EquipData.MainHand.mainHandAttachmentName); //RefreshSkin(PartSkinType.MainHand, RoleData.EquipData.MainHand.mainHandAttachmentName); } else { SkeletonAnimator.AddSkin("MainHand", null); //RefreshSkin(PartSkinType.MainHand, "NONE"); } //设置副手武器皮肤 if (RoleData.EquipData.HasOffHand()) { SkeletonAnimator.AddSkin("OffHand", RoleData.EquipData.OffHand.offHandAttachmentName); } else { SkeletonAnimator.AddSkin("OffHand", null); } //设置护甲皮肤 if (RoleData.EquipData.armorData != null && RoleData.EquipData.armorData.skinName != null && RoleData.EquipData.HasArmorData()) { SkeletonAnimator.AddSkin("Armor", RoleData.EquipData.armorData.skinName); } else { SkeletonAnimator.AddSkin("Armor", null); } }
public static SkeletonAnimator InstantiateSkeletonAnimator(SkeletonDataAsset skeletonDataAsset, Skin skin = null) { GameObject go = new GameObject(skeletonDataAsset.name.Replace("_SkeletonData", ""), typeof(MeshFilter), typeof(MeshRenderer), typeof(Animator), typeof(SkeletonAnimator)); if (skeletonDataAsset.controller == null) { SkeletonBaker.GenerateMecanimAnimationClips(skeletonDataAsset); } go.GetComponent <Animator>().runtimeAnimatorController = skeletonDataAsset.controller; SkeletonAnimator anim = go.GetComponent <SkeletonAnimator>(); anim.skeletonDataAsset = skeletonDataAsset; bool requiresNormals = false; foreach (AtlasAsset atlasAsset in anim.skeletonDataAsset.atlasAssets) { foreach (Material m in atlasAsset.materials) { if (m.shader.name.Contains("Lit")) { requiresNormals = true; break; } } } anim.calculateNormals = requiresNormals; SkeletonData data = skeletonDataAsset.GetSkeletonData(true); if (data == null) { for (int i = 0; i < skeletonDataAsset.atlasAssets.Length; i++) { string reloadAtlasPath = AssetDatabase.GetAssetPath(skeletonDataAsset.atlasAssets[i]); skeletonDataAsset.atlasAssets[i] = (AtlasAsset)AssetDatabase.LoadAssetAtPath(reloadAtlasPath, typeof(AtlasAsset)); } data = skeletonDataAsset.GetSkeletonData(true); } if (skin == null) { skin = data.DefaultSkin; } if (skin == null) { skin = data.Skins[0]; } anim.Reset(); anim.skeleton.SetSkin(skin); anim.initialSkinName = skin.Name; anim.skeleton.Update(1); anim.skeleton.UpdateWorldTransform(); anim.LateUpdate(); return(anim); }
public override void UpdateMovement(string stateName, AnimatorStateEventType eventType, Animator animator, AnimatorStateInfo stateInfo, int layerIndex, float time) { AnimatorStateInfo currStateInfo = stateInfo; AnimatorStateInfo nextStateInfo = animator.GetNextAnimatorStateInfo(layerIndex); bool hasNext = nextStateInfo.fullPathHash != 0; if (hasNext) { currStateInfo = nextStateInfo; } else if (skeletonAnimator.IsInterruptionActive(layerIndex)) { currStateInfo = skeletonAnimator.GetInterruptingStateInfo(layerIndex); } if (eventType == AnimatorStateEventType.OnStateUpdate) { if (lastUpdateMovementTime < 0) { lastUpdateMovementTime = Time.time; } var deltaTime = Time.time - lastUpdateMovementTime; lastUpdateMovementTime = Time.time; if ( currStateInfo.IsTag("hurt") || currStateInfo.IsTag("hurtHold")) { CalcSpeed(deltaTime, Vector2.zero); speed = CalcGravity(speed, deltaTime); Move(Speed * deltaTime); } else if (currStateInfo.IsTag("idle")) { speed = CalcGravity(speed, deltaTime); TurnBackWithAnim(); if (joystick.magnitude < 0.5f) { speed.x = 0; speed.z = 0; } Move(Speed * deltaTime); } else if ( currStateInfo.IsTag("move") || currStateInfo.IsTag("run") || currStateInfo.IsTag("walk") // || currAnimatorStateInfo.IsTag("accelerateRoll") ) { // 倒播移动 if (IsAltPressed && joystick.x * GetDirectionInt() < 0) { SkeletonAnimator.SetBackwards(true); } else { SkeletonAnimator.SetBackwards(false); } speed = CalcGravity(speed, deltaTime); TurnBackWithAnim(); CalcSpeed(deltaTime); Move(Speed * deltaTime); } else if ( currStateInfo.IsTag("rush") ) { speed = CalcGravity(speed, deltaTime); TurnBackWithAnim(); CalcSpeed(deltaTime, new Vector2(joystick.x, joystick.y / 2), RushSpeed); Move(Speed * deltaTime); } else if ( currStateInfo.IsTag("rush_end") ) { speed = CalcGravity(speed, deltaTime); TurnBackWithAnim(); CalcSpeed(deltaTime, Vector2.zero); Move(Speed * deltaTime); } else if (currStateInfo.IsTag("attack")) { speed = CalcGravity(speed, deltaTime); CalcSpeed(deltaTime, Vector2.zero); Move(Speed * deltaTime); } else if (currStateInfo.IsTag("jumping")) { speed = CalcGravity(speed, deltaTime); // TurnBack(); CalcSpeed(deltaTime); if (joystick.magnitude <= 0.1f) { speed.x = 0; speed.z = 0; } if (speed.x * GetDirectionInt() < 0) { Move(new Vector3(Speed.x / 2f, Speed.y, Speed.z) * deltaTime); } else { Move(Speed * deltaTime); } } else if (currStateInfo.IsTag("jumpingAttack")) { speed = CalcGravity(speed, deltaTime); CalcSpeed(deltaTime, Vector2.zero); Vector3 finalSpeed = Vector3.zero; finalSpeed.x = Speed.x; finalSpeed.y = Speed.y * currVariableSpeed; finalSpeed.z = Speed.z; Move(new Vector3(finalSpeed.x / 5f, finalSpeed.y, finalSpeed.z / 5f) * deltaTime); } else if (currStateInfo.IsTag("landing")) { speed = CalcGravity(speed, deltaTime); CalcSpeed(deltaTime, Vector2.zero); Move(Speed * deltaTime); } else if (currStateInfo.IsTag("nomove")) { speed = CalcGravity(speed, deltaTime); } else if (currStateInfo.IsTag("dun-idle") || currStateInfo.IsTag("dun-move")) { speed = CalcGravity(speed, deltaTime); CalcSpeed(deltaTime); Move(Speed / 3f * deltaTime); } else if (currStateInfo.IsTag("nocontrol")) { speed = CalcGravity(speed, deltaTime); CalcSpeed(deltaTime, Vector2.zero); Move(Speed * deltaTime); } else if (currStateInfo.IsTag("climb")) { speed = CalcGravity(speed, deltaTime); speed.y = 0; } else if (currStateInfo.IsTag("ClimbLadder")) { speed = CalcGravity(speed, deltaTime); speed.y = 0; if (joystick.y != 0f) { OverClimbLadder(); } } else if (currStateInfo.IsTag("jumpattack")) { speed = CalcGravity(speed, deltaTime); CalcSpeed(deltaTime, Vector2.zero); Move(new Vector3(Speed.x / 10f, Speed.y, Speed.x / 10f) * deltaTime); } else { speed = CalcGravity(speed, deltaTime); CalcSpeed(deltaTime, Vector2.zero); Move(Speed * deltaTime); } } else if (eventType == AnimatorStateEventType.OnStateExit) { if ( currStateInfo.IsTag("walk") || currStateInfo.IsTag("run") || currStateInfo.IsTag("move") // || currAnimatorStateInfo.IsTag("accelerateRoll") ) { skeletonAnimator.SetBackwards(false); } } }
public virtual void UpdateMovement(string stateName, AnimatorStateEventType eventType, Animator animator, AnimatorStateInfo stateInfo, int layerIndex, float time) { currStateName = stateName; AnimatorStateInfo currStateInfo = stateInfo; AnimatorStateInfo nextStateInfo = animator.GetNextAnimatorStateInfo(layerIndex); bool hasNext = nextStateInfo.fullPathHash != 0; if (hasNext) { currStateInfo = nextStateInfo; } else if (skeletonAnimator.IsInterruptionActive(layerIndex)) { currStateInfo = skeletonAnimator.GetInterruptingStateInfo(layerIndex); } if (eventType == AnimatorStateEventType.OnStateUpdate) { if (lastUpdateMovementTime < 0) { lastUpdateMovementTime = Time.time; } var deltaTime = Time.time - lastUpdateMovementTime; lastUpdateMovementTime = Time.time; // var deltaTime = Time.deltaTime / 2f; // deltaTime *= _animator.speed * currStateInfo.speed; // 通过移动动画额定速度, 调整动画播放速度 // float moveAnimSpeedScale = skeletonAnimator.GetMoveAnimSpeedScale(stateName, speed.magnitude); // _animator.speed = moveAnimSpeedScale; if ( currStateInfo.IsTag("hurt") || currStateInfo.IsTag("hurtHold")) { joystick = Vector2.zero; CalcSpeed(deltaTime); speed = CalcGravity(speed, deltaTime, true); Move(Speed * deltaTime); } else if (currStateInfo.IsTag("idle")) { speed = CalcGravity(speed, deltaTime); TurnBackWithAnim(); if (joystick.magnitude < 0.5f) { speed.x = 0; speed.z = 0; } CalcSpeed(deltaTime); Move(Speed * deltaTime); } else if ( currStateInfo.IsTag("move") // || currStateInfo.IsTag("walk") // || currStateInfo.IsTag("rush") // || currStateInfo.IsTag("run") ) { // 倒播移动 if (IsAltPressed && joystick.x * GetDirectionInt() < 0) { SkeletonAnimator.SetBackwards(true); } else { SkeletonAnimator.SetBackwards(false); } speed = CalcGravity(speed, deltaTime); TurnBackWithAnim(); CalcSpeed(deltaTime); Move(Speed * deltaTime); } else if ( currStateInfo.IsTag("run") || currStateInfo.IsTag("walk") || currStateInfo.IsTag("move")) { TurnBack(); speed = CalcGravity(speed, deltaTime); CalcSpeed(deltaTime); // Move(Speed * deltaTime); } else if ( currStateInfo.IsTag("rush_end") ) { speed = CalcGravity(speed, deltaTime); joystick = Vector2.zero; //GroundFrictionAcceleration = 30f; CalcSpeed(deltaTime); //GroundFrictionAcceleration = 60f; //Speed = new Vector3(Speed.x, Speed.y, Speed.z / 2f); Move(Speed * deltaTime); } else if ( currStateInfo.IsTag("roll") || currStateInfo.IsTag("dodge")) { TurnBack(); speed = CalcGravity(speed, deltaTime); CalcSpeed(deltaTime, Vector2.zero); Move(Speed * deltaTime); } else if (currStateInfo.IsTag("attack")) { speed = CalcGravity(speed, deltaTime); joystick = Vector2.zero; CalcSpeed(deltaTime); Move(Speed * deltaTime); } else if (currStateInfo.IsTag("jumping")) { speed = CalcGravity(speed, deltaTime); TurnBack(); CalcSpeed(deltaTime); if (joystick.magnitude <= 0.1f) { speed.x = 0; speed.z = 0; } Move(Speed * deltaTime); } else if (currStateInfo.IsTag("jumpingAttack")) { speed = CalcGravity(speed, deltaTime); joystick = Vector2.zero; CalcSpeed(deltaTime); Vector3 finalSpeed = Vector3.zero; finalSpeed.x = Speed.x; finalSpeed.y = Speed.y * currVariableSpeed; finalSpeed.z = Speed.z; Move(new Vector3(finalSpeed.x / 5f, finalSpeed.y, finalSpeed.z / 5f) * deltaTime); } else if (currStateInfo.IsTag("landing")) { speed = CalcGravity(speed, deltaTime); joystick = Vector2.zero; CalcSpeed(deltaTime); Move(Speed * deltaTime); } else if (currStateInfo.IsTag("nomove")) { speed = CalcGravity(speed, deltaTime); joystick = Vector2.zero; Speed = Vector3.zero; } else if (currStateInfo.IsTag("dun-idle") || currStateInfo.IsTag("dun-move")) { speed = CalcGravity(speed, deltaTime); CalcSpeed(deltaTime); Move(Speed / 3f * deltaTime); } else if (currStateInfo.IsTag("nocontrol")) { speed = CalcGravity(speed, deltaTime); joystick = Vector2.zero; CalcSpeed(deltaTime); Move(Speed * deltaTime); } else if (currStateInfo.IsTag("climb")) { speed = CalcGravity(speed, deltaTime); //joystick = Vector2.zero; speed.y = 0; //calcSpeed(deltaTime); //Move(Speed * deltaTime); } else if (currStateInfo.IsTag("ClimbLadder")) { speed = CalcGravity(speed, deltaTime); speed.y = 0; if (joystick.y != 0f) { OverClimbLadder(); } } else { speed = CalcGravity(speed, deltaTime); CalcSpeed(deltaTime, Vector2.zero); Move(Speed * deltaTime); } // // if (currStateInfo.IsTag("walk") == false // && currStateInfo.IsTag("run") == false) // { // SetBackwards(Vector3.zero); // } } else if (eventType == AnimatorStateEventType.OnStateExit) { if ( currStateInfo.IsTag("walk") || currStateInfo.IsTag("run") || currStateInfo.IsTag("move") // || currAnimatorStateInfo.IsTag("accelerateRoll") ) { skeletonAnimator.SetBackwards(false); } // if (stateInfo.IsTag("roll") // || stateInfo.IsTag("dodge")) // { // speed.x = 0; // speed.z = 0; // } } }
void Start() { skeletonAnimator = GetComponent <SkeletonAnimator>(); skeAnimator = GetComponent <Animator>(); //skeletonAnimation.AnimationName = idleAnimation; }
// Use this for initialization void Start() { lvlProperties = GameObject.Find("LevelManager").GetComponent <LevelProperties>(); sceneName = SceneManager.GetActiveScene().name; PowerUp = GameObject.FindGameObjectWithTag("PowerUp"); move = 1.1f * Time.deltaTime; resizeDone = false; //currentSize = Camera.main.orthographicSize; goMoveSNP = false; headItems = GameObject.FindGameObjectsWithTag("Head Item"); rightHandItems = GameObject.FindGameObjectsWithTag("Right Hand Item"); pointsText = GameObject.Find("PointsText"); thisSpriteRenderer = GetComponent <SpriteRenderer>(); snpPlateformOrigin = SnpPlateforme.transform.position; snpBubble = GameObject.Find("SnpBubble"); HeadItemPersistency = PlayerPrefs.GetString("CurrentGeneHeadItem"); HandItemPersistency = PlayerPrefs.GetString("CurrentGeneHandItem"); SkinVariantPersistency = PlayerPrefs.GetString("CurrentGeneSkinModification"); SuperVariant = PlayerPrefs.GetString("SuperVariantEffect"); Debug.Log("SUPER VARIANT : " + SuperVariant); Player = GameObject.FindGameObjectWithTag("Player"); PlayerCurrentSkin = Player.transform.GetChild(2).GetComponent <SkeletonAnimator>(); isFirstGeneOfAvatar = PlayerPrefs.GetString("IsFirstGeneOfAvatar"); currentAvatar = PlayerPrefs.GetInt("CombinationPlayAvatar"); audio = GameObject.Find("Global").GetComponent <AudioSource>(); if (PlayerPrefs.GetString("PlayerTookSNP") == "true") { if (sceneName == "AKT1" || sceneName == "CYP1A2" || sceneName == "HERC2" || sceneName == "FOXO3" || sceneName == "MCM6" || sceneName == "TCF7L2") { SnpReplace.SetActive(false); } if (sceneName == "TCF7L2") { if (HandItemPersistency == "InsulineSyringue") { GameObject.Find("Right Hand Item Container").transform.GetChild(1).gameObject.SetActive(true); } } if (sceneName == "AKT1" || sceneName == "ALDH2" || sceneName == "PCDH15") { GameObject SuperVariantEffects = GameObject.Find("SuperVariantEffects").gameObject; SuperVariantEffects.SetActive(true); if (sceneName == "ALDH2") { SuperVariantEffects.transform.GetChild(0).gameObject.SetActive(true); } if (sceneName == "AKT1") { SuperVariantEffects.transform.GetChild(1).gameObject.SetActive(true); } if (sceneName == "PCDH15") { SuperVariantEffects.transform.GetChild(2).gameObject.SetActive(true); } } transform.position = new Vector3(0, 0, 0); } if (currentAvatar == 21) { GameObject.Find("Head Item Container").transform.GetChild(1).gameObject.transform.position = new Vector3(GameObject.Find("Head Item Container").transform.GetChild(1).gameObject.transform.position.x - 0.01f, GameObject.Find("Head Item Container").transform.GetChild(1).gameObject.transform.position.y - 0.04f, GameObject.Find("Head Item Container").transform.GetChild(1).gameObject.transform.position.z); } }
public static void load(string filename, MaterialManager material_manager, out Dictionary <string, UniqueMesh> unique_mesh_collection, out Dictionary <string, LightLoader.LightLoaderExtras> light_extras) { if (!File.Exists(filename)) { throw new Exception("World File Not Found\n" + filename); } Debug.DebugHelper.logInfo(1, "Loading Collada File", Path.GetFileName(filename)); Grendgine_Collada dae_file = Grendgine_Collada.Grendgine_Load_File(filename); //------------------------------------------------------ // Create Image Dictionary //------------------------------------------------------ Dictionary <string, string> image_collection = new Dictionary <string, string>(); try { if (dae_file.Library_Images.Image != null) { Debug.DebugHelper.logInfo(2, "\tCreating Image Dictionary", dae_file.Library_Images.Image.Count() + " images found"); foreach (Grendgine_Collada_Image i in dae_file.Library_Images.Image) { string id = i.ID; string path = i.Init_From; path = path.Substring(1, path.Length - 1); path = EngineHelper.getPath_MaterialTextures(path); image_collection.Add(id, path); } } else { Debug.DebugHelper.logInfo(2, "\tCreating Image Dictionary", "0 images found :<"); } } catch (Exception e) { Debug.DebugHelper.logError("\tCreating Image Dictionary", e.Message); } //------------------------------------------------------ // Create Material Dictionary //------------------------------------------------------ Dictionary <string, DAE_Material> material_collection = new Dictionary <string, DAE_Material>(); try { if (dae_file.Library_Effects != null) { Debug.DebugHelper.logInfo(2, "\tCreating Material Dictionary", dae_file.Library_Effects.Effect.Count() + " effects found"); foreach (Grendgine_Collada_Effect e in dae_file.Library_Effects.Effect) { string id = e.ID; DAE_Material temp_material = new DAE_Material(id); temp_material.load(e, image_collection, material_manager); material_collection.Add(temp_material.id, temp_material); } } else { Debug.DebugHelper.logInfo(2, "\tCreating Material Dictionary", "0 effects found :<"); } } catch (Exception e) { Debug.DebugHelper.logError("\tCreating Material Dictionary", e.Message); } //------------------------------------------------------ // Create Animation Dictionary //------------------------------------------------------ Dictionary <string, ObjectAnimator> object_animator_collection = new Dictionary <string, ObjectAnimator>(); Dictionary <string, SkeletonAnimator> skeleton_animator_collection = new Dictionary <string, SkeletonAnimator>(); try { if (dae_file.Library_Animations != null) { Debug.DebugHelper.logInfo(2, "\tCreating Animation Dictionary", dae_file.Library_Animations.Animation.Count() + " animations found"); foreach (Grendgine_Collada_Animation a in dae_file.Library_Animations.Animation) { //------------------------------------------------------ // Get match strings to decide what kind of Animation this is //------------------------------------------------------ // Get the ID of the object or bone we are animating Match object_match = Regex.Match(a.Channel[0].Target, "(.+)/.+"); string object_id = object_match.Groups[1].ToString(); // Match if this is an object animation Match object_animation_match = Regex.Match(a.ID, object_id + "_(location|rotation_euler|scale)_(X|Y|Z)"); // Match if this is a skeletal animation Match skeleton_animation_match = Regex.Match(a.ID, "(.+)_" + object_id + "_pose_matrix"); //------------------------------------------------------ // Create Source and Sampler Dictionaries //------------------------------------------------------ // Create source dictionary Dictionary <string, Grendgine_Collada_Source> source_dictionary = a.Source.ToDictionary(s => s.ID, s => s); // Create sampler dictionary Dictionary <string, string> sampler_dictionary = a.Sampler[0].Input.ToDictionary(i => i.Semantic.ToString(), i => i.source); //------------------------------------------------------ // Get Common Animation Data //------------------------------------------------------ // Get Key interpolation method string source_interpolation_id = sampler_dictionary["INTERPOLATION"].Replace("#", ""); string[] key_frame_interpolations = source_dictionary[source_interpolation_id].Name_Array.Value(); // Get Key Frame times string source_input_id = sampler_dictionary["INPUT"].Replace("#", ""); float[] key_frame_times = source_dictionary[source_input_id].Float_Array.Value(); // Get Key Frame data string source_output_id = sampler_dictionary["OUTPUT"].Replace("#", ""); float[] key_frame_data = source_dictionary[source_output_id].Float_Array.Value(); int key_frame_data_stride = (int)source_dictionary[source_output_id].Technique_Common.Accessor.Stride; //------------------------------------------------------ // Object Animation //------------------------------------------------------ if (object_animation_match.Success && !skeleton_animation_match.Success) { string id = object_id; string action = object_animation_match.Groups[1].ToString(); string channel = object_animation_match.Groups[2].ToString(); switch (action) { case "location": action = AnimationHelper.translate; break; case "rotation_euler": action = AnimationHelper.rotation_euler; break; case "scale": action = AnimationHelper.scale; break; } // Create new or use existing Animator ObjectAnimator temp_animator; if (object_animator_collection.TryGetValue(id, out temp_animator)) { object_animator_collection.Remove(id); } else { temp_animator = new ObjectAnimator(id); } // Get Key Frame in tangent data string source_t1_id = sampler_dictionary["IN_TANGENT"].Replace("#", ""); float[] key_frame_data_b1 = source_dictionary[source_t1_id].Float_Array.Value(); // Get Key Frame out tangent data string source_t2_id = sampler_dictionary["OUT_TANGENT"].Replace("#", ""); float[] key_frame_data_b2 = source_dictionary[source_t2_id].Float_Array.Value(); // Loop through key frames and add to animator for (int i = 0; i < key_frame_times.Length; i++) { float current_frame_time = key_frame_times[i]; float current_frame_data = key_frame_data[i]; int j = i * 2; Vector4 current_frame_data_bezier = new Vector4( key_frame_data_b1[j], key_frame_data_b1[j + 1], key_frame_data_b2[j], key_frame_data_b2[j + 1] ); temp_animator.addKeyFrame(current_frame_time, action, channel, current_frame_data, current_frame_data_bezier); } object_animator_collection.Add(id, temp_animator); } //------------------------------------------------------ // Skeletal Animation //------------------------------------------------------ if (skeleton_animation_match.Success && !object_animation_match.Success) { string id = skeleton_animation_match.Groups[1].ToString(); string bone_name = object_id; // Create new or use existing Animator SkeletonAnimator temp_animator; if (skeleton_animator_collection.TryGetValue(id, out temp_animator)) { skeleton_animator_collection.Remove(id); } else { temp_animator = new SkeletonAnimator(id); } // Loop through key frames and add to animator for (int i = 0; i < key_frame_times.Length; i++) { int current_frame_data_index = i * key_frame_data_stride; float current_frame_time = key_frame_times[i]; float[] current_frame_data = new float[16]; // Create Matrix from each 16 strided float Array.Copy(key_frame_data, current_frame_data_index, current_frame_data, 0, key_frame_data_stride); Matrix4 current_frame_data_matrix = EngineHelper.createMatrix(current_frame_data); temp_animator.addKeyFrame(bone_name, current_frame_time, current_frame_data_matrix); } skeleton_animator_collection.Add(id, temp_animator); } source_dictionary.Clear(); sampler_dictionary.Clear(); } // Get last key frame for each animator foreach (ObjectAnimator a in object_animator_collection.Values) { a.calcLastFrame(); } foreach (SkeletonAnimator a in skeleton_animator_collection.Values) { a.calcLastFrame(); } } else { Debug.DebugHelper.logInfo(2, "\tCreating Animation Dictionary", "0 animations found :<"); } } catch (Exception e) { Debug.DebugHelper.logError("\tCreating Animation Dictionary", e.Message); } //------------------------------------------------------ // Create Visual Scene + Skeleton Dictionary //------------------------------------------------------ Debug.DebugHelper.logInfo(2, "\tCreating Visuals Dictionary", dae_file.Library_Visual_Scene.Visual_Scene[0].Node.Count() + " visuals found"); List <Grendgine_Collada_Node> mesh_visual_collection = new List <Grendgine_Collada_Node>(); List <Grendgine_Collada_Node> controlled_visual_collection = new List <Grendgine_Collada_Node>(); List <Grendgine_Collada_Node> light_visual_collection = new List <Grendgine_Collada_Node>(); Dictionary <string, DAE_Skeleton> skeleton_dictionary = new Dictionary <string, DAE_Skeleton>(); light_extras = new Dictionary <string, LightLoader.LightLoaderExtras>(); foreach (Grendgine_Collada_Node node in dae_file.Library_Visual_Scene.Visual_Scene[0].Node) { string id = node.ID; // Convert Blender transformation to Kailash Matrix4 temp_matrix = EngineHelper.createMatrix( new Vector3(node.Translate[0].Value()[0], node.Translate[0].Value()[1], node.Translate[0].Value()[2]), new Vector3(node.Rotate[2].Value()[3], node.Rotate[1].Value()[3], node.Rotate[0].Value()[3]), new Vector3(node.Scale[0].Value()[0], node.Scale[0].Value()[1], node.Scale[0].Value()[2]) ); Matrix4 temp_corrected_matrix = EngineHelper.blender2Kailash(temp_matrix); // Skeletons if (node.node != null && node.node[0].Instance_Geometry == null && node.node[0].Instance_Geometry == null) { DAE_Skeleton temp_skeleton = new DAE_Skeleton(id, temp_matrix, node.node); SkeletonAnimator temp_animator; if (skeleton_animator_collection.TryGetValue(temp_skeleton.id, out temp_animator)) { temp_skeleton.animator = temp_animator; } skeleton_dictionary.Add(id, temp_skeleton); continue; } // Lights if (node.Instance_Light != null) { string light_id = node.Instance_Light[0].URL.Replace("#", ""); ObjectAnimator temp_animator = null; object_animator_collection.TryGetValue(light_id.Replace("-light", ""), out temp_animator); LightLoader.LightLoaderExtras temp_light_extras = new LightLoader.LightLoaderExtras(temp_corrected_matrix, temp_animator); // Add to light matrix collection light_extras.Add(light_id, temp_light_extras); continue; } // Meshes if (node.Instance_Geometry != null) { string mesh_id = node.Instance_Geometry[0].URL.Replace("#", ""); // Add to scene collection mesh_visual_collection.Add(node); continue; } // Controlled Objects if (node.Instance_Controller != null) { string controller_id = node.Instance_Controller[0].URL.Replace("#", ""); // Add to scene collection controlled_visual_collection.Add(node); continue; } } //------------------------------------------------------ // Load Skinning Data //------------------------------------------------------ Dictionary <string, string> mesh_2_skeleton = new Dictionary <string, string>(); Dictionary <string, string> skin_2_mesh = new Dictionary <string, string>(); try { if (dae_file.Library_Controllers.Controller != null) { Debug.DebugHelper.logInfo(2, "\tLoading Skinning Data", dae_file.Library_Controllers.Controller.Count() + " skins found"); foreach (Grendgine_Collada_Controller c in dae_file.Library_Controllers.Controller) { string skin_id = c.ID; string skeleton_id = c.Name.Replace(".", "_"); ; DAE_Skeleton temp_skeleton; if (skeleton_dictionary.TryGetValue(skeleton_id, out temp_skeleton)) { Grendgine_Collada_Skin temp_skin = c.Skin; string mesh_id = temp_skin.source.Replace("#", ""); //------------------------------------------------------ // Load BSM into skeleton //------------------------------------------------------ Matrix4 BSM = EngineHelper.createMatrix(temp_skin.Bind_Shape_Matrix.Value()); temp_skeleton.BSM = BSM; //------------------------------------------------------ // Load Sources //------------------------------------------------------ Dictionary <string, Grendgine_Collada_Source> source_dictionary = temp_skin.Source.ToDictionary(s => s.ID, s => s); string joint_source_id = ""; string IBM_source_id = ""; string weights_source_id = ""; foreach (Grendgine_Collada_Input_Unshared i in temp_skin.Joints.Input) { switch (i.Semantic.ToString()) { case "JOINT": joint_source_id = i.source.Replace("#", ""); break; case "INV_BIND_MATRIX": IBM_source_id = i.source.Replace("#", ""); break; } } foreach (Grendgine_Collada_Input_Shared i in temp_skin.Vertex_Weights.Input) { switch (i.Semantic.ToString()) { case "WEIGHT": weights_source_id = i.source.Replace("#", ""); break; } } Grendgine_Collada_Source IBM_source = source_dictionary[IBM_source_id]; Grendgine_Collada_Source weights_source = source_dictionary[weights_source_id]; //------------------------------------------------------ // Load Bone IDs //------------------------------------------------------ string[] bone_names = source_dictionary[joint_source_id].Name_Array.Value(); int[] bone_ids = new int[bone_names.Length]; for (int i = 0; i < bone_names.Length; i++) { bone_ids[i] = temp_skeleton.bone_ids[bone_names[i]]; } //------------------------------------------------------ // Load IBMs //------------------------------------------------------ int IBM_stride = 16; for (int i = 0; i < bone_names.Length; i++) { float[] temp_IBM = new float[IBM_stride]; Array.Copy(IBM_source.Float_Array.Value(), i * IBM_stride, temp_IBM, 0, IBM_stride); string current_bone_name = bone_names[i]; int current_bone_id = temp_skeleton.bone_ids[current_bone_name]; temp_skeleton.bones[current_bone_id].IBM = EngineHelper.createMatrix(temp_IBM); } //------------------------------------------------------ // Load Vertex Weights //------------------------------------------------------ float[] vertex_weights = weights_source.Float_Array.Value(); int[] bones_and_weights = temp_skin.Vertex_Weights.V.Value(); string vcount_string = temp_skin.Vertex_Weights.VCount.Value_As_String; int[] vcount = Grendgine_Collada_Parse_Utils.String_To_Int(vcount_string.Remove(vcount_string.Length - 1, 1)); int current_weight_index = 0; for (int i = 0; i < vcount.Length; i++) { int num_bones = vcount[i]; List <DAE_Skeleton.VertexWeight> temp_weights = new List <DAE_Skeleton.VertexWeight>(); for (int j = 0; j < num_bones * 2; j += 2) { int bone_index = bones_and_weights[current_weight_index + j]; int weight_index = bones_and_weights[current_weight_index + j + 1]; temp_weights.Add(new DAE_Skeleton.VertexWeight(bone_ids[bone_index], i, vertex_weights[weight_index])); } current_weight_index += num_bones * 2; temp_skeleton.vertex_weights.Add(i, temp_weights.ToArray()); } //------------------------------------------------------ // Map mesh_id to the Mesh's skeleton_id //------------------------------------------------------ mesh_2_skeleton.Add(mesh_id, skeleton_id); skin_2_mesh.Add(skin_id, mesh_id); } } } else { Debug.DebugHelper.logInfo(2, "\tLoading Skinning Data", "0 skins found :<"); } } catch (Exception e) { Debug.DebugHelper.logError("\tLoading Skinning Data", e.Message); } //------------------------------------------------------ // Create Mesh Dictionary //------------------------------------------------------ Dictionary <string, DAE_Mesh> mesh_collection = new Dictionary <string, DAE_Mesh>(); try { if (dae_file.Library_Geometries != null) { Debug.DebugHelper.logInfo(2, "\tCreating Mesh Dictionary", dae_file.Library_Geometries.Geometry.Count() + " meshes found"); foreach (Grendgine_Collada_Geometry g in dae_file.Library_Geometries.Geometry) { // Load Mesh string mesh_id = g.Name.Replace('.', '_') + "-mesh"; DAE_Mesh temp_mesh = new DAE_Mesh(mesh_id, g); try { string skeleton_id; if (mesh_2_skeleton.TryGetValue(mesh_id, out skeleton_id)) { temp_mesh.load(material_collection, skeleton_dictionary[skeleton_id]); } else { temp_mesh.load(material_collection); } } catch (Exception e) { Debug.DebugHelper.logError("[ FAILED ] Loading Mesh: " + mesh_id, e.Message); continue; } // Load mesh's VAO foreach (Mesh mesh in temp_mesh.submeshes) { mesh.setBufferIDs(loadVAO(mesh)); } // Add to Mesh Collection mesh_collection.Add(temp_mesh.id, temp_mesh); } } else { Debug.DebugHelper.logInfo(2, "\tCreating Mesh Dictionary", "0 meshes found :<"); } } catch (Exception e) { Debug.DebugHelper.logError("\tCreating Mesh Dictionary", e.Message); } //------------------------------------------------------ // Create Mesh Visuals //------------------------------------------------------ Debug.DebugHelper.logInfo(2, "\tLoading Mesh Visuals", ""); unique_mesh_collection = new Dictionary <string, UniqueMesh>(); foreach (Grendgine_Collada_Node node in mesh_visual_collection) { string visual_id = node.ID; string mesh_id = node.Instance_Geometry[0].URL.Replace("#", ""); Debug.DebugHelper.logInfo(3, "\t\tLoading Visual Scene", visual_id); // Convert Blender transformation to Kailash Matrix4 temp_matrix = EngineHelper.blender2Kailash(EngineHelper.createMatrix( new Vector3(node.Translate[0].Value()[0], node.Translate[0].Value()[1], node.Translate[0].Value()[2]), new Vector3(node.Rotate[2].Value()[3], node.Rotate[1].Value()[3], node.Rotate[0].Value()[3]), new Vector3(node.Scale[0].Value()[0], node.Scale[0].Value()[1], node.Scale[0].Value()[2]) )); // Load unique Mesh and its transformation DAE_Mesh m; if (mesh_collection.TryGetValue(mesh_id, out m)) { UniqueMesh temp_unique_mesh = new UniqueMesh(visual_id, m, temp_matrix); // Add animator to unique mesh if one exists ObjectAnimator temp_animator; if (object_animator_collection.TryGetValue(visual_id, out temp_animator)) { temp_unique_mesh.animator = temp_animator; } // Add to mesh collection unique_mesh_collection.Add(visual_id, temp_unique_mesh); } } //------------------------------------------------------ // Create Skin Visuals //------------------------------------------------------ Debug.DebugHelper.logInfo(2, "\tLoading Controlled Visuals", ""); foreach (Grendgine_Collada_Node node in controlled_visual_collection) { string visual_id = node.ID; string controller_id = node.Instance_Controller[0].URL.Replace("#", ""); string mesh_id; if (skin_2_mesh.TryGetValue(controller_id, out mesh_id)) { Debug.DebugHelper.logInfo(3, "\t\tLoading Visual Scene", visual_id + " (" + controller_id + " )"); // Convert Blender transformation to Kailash Matrix4 temp_matrix = EngineHelper.blender2Kailash(EngineHelper.createMatrix( new Vector3(node.Translate[0].Value()[0], node.Translate[0].Value()[1], node.Translate[0].Value()[2]), new Vector3(node.Rotate[2].Value()[3], node.Rotate[1].Value()[3], node.Rotate[0].Value()[3]), new Vector3(node.Scale[0].Value()[0], node.Scale[0].Value()[1], node.Scale[0].Value()[2]) )); // Load unique Mesh and its transformation DAE_Mesh m; if (mesh_collection.TryGetValue(mesh_id, out m)) { UniqueMesh temp_unique_mesh_test = new UniqueMesh(visual_id, m, temp_matrix); unique_mesh_collection.Add(visual_id, temp_unique_mesh_test); } } } // Clear dictionaries. dat mesh is loooaded image_collection.Clear(); material_collection.Clear(); mesh_collection.Clear(); object_animator_collection.Clear(); skeleton_animator_collection.Clear(); mesh_visual_collection.Clear(); controlled_visual_collection.Clear(); light_visual_collection.Clear(); skeleton_dictionary.Clear(); mesh_2_skeleton.Clear(); }
public void SetTrigger(string actionName) { //Debug.LogError ("设置actionName------------actionName=" + actionName); SkeletonAnimator.SetTrigger(actionName); FaceAnimator.SetTrigger(actionName); }
public void SkeletonAnimatorExistsTest() { SkeletonAnimator skeletonAnimator = character.GetComponentInChildren <SkeletonAnimator>(); Assert.NotNull(skeletonAnimator, "There must be a SkeletonAnimator component in the character hierarchy."); }