Commit 3c1a7b98 authored by czy's avatar czy

添加boss动画管理器

parent 062757c0
...@@ -368,7 +368,7 @@ public class BattleUI : MonoBehaviour ...@@ -368,7 +368,7 @@ public class BattleUI : MonoBehaviour
//设置战斗UI状态 //设置战斗UI状态
public void SetBattleObjState(bool bool_) public void SetBattleObjState(bool bool_)
{ {
print("显示m_battleObj:"+bool_); //print("显示m_battleObj:"+bool_);
m_battleObj.SetActive(bool_); m_battleObj.SetActive(bool_);
//m_successResultObj.SetActive(bool_); //m_successResultObj.SetActive(bool_);
//m_successResultMaskObj.SetActive(!bool_); //m_successResultMaskObj.SetActive(!bool_);
...@@ -502,7 +502,7 @@ public class BattleUI : MonoBehaviour ...@@ -502,7 +502,7 @@ public class BattleUI : MonoBehaviour
} }
public void UpdateScore2(string name,string text) public void UpdateScore2(string name,string text)
{ {
print("name:" + name + ",text" + text); //print("name:" + name + ",text" + text);
switch (name) switch (name)
{ {
case "Player": case "Player":
......
...@@ -36,7 +36,7 @@ AnimationClip: ...@@ -36,7 +36,7 @@ AnimationClip:
m_Level: 0 m_Level: 0
m_CycleOffset: 0 m_CycleOffset: 0
m_HasAdditiveReferencePose: 0 m_HasAdditiveReferencePose: 0
m_LoopTime: 1 m_LoopTime: 0
m_LoopBlend: 0 m_LoopBlend: 0
m_LoopBlendOrientation: 0 m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0 m_LoopBlendPositionY: 0
......
...@@ -22354,4 +22354,11 @@ AnimationClip: ...@@ -22354,4 +22354,11 @@ AnimationClip:
script: {fileID: 0} script: {fileID: 0}
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 0
functionName: ChangeAttackType
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0
...@@ -262,17 +262,17 @@ PrefabInstance: ...@@ -262,17 +262,17 @@ PrefabInstance:
- target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d, - target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d,
type: 3} type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 1 value: 0.8
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d, - target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d,
type: 3} type: 3}
propertyPath: m_LocalScale.y propertyPath: m_LocalScale.y
value: 1 value: 0.8
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d, - target: {fileID: -4216859302048453862, guid: 092b5adfc35664b43a5e216c3aba0c4d,
type: 3} type: 3}
propertyPath: m_LocalScale.z propertyPath: m_LocalScale.z
value: 1 value: 0.8
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: 092b5adfc35664b43a5e216c3aba0c4d, - target: {fileID: -927199367670048503, guid: 092b5adfc35664b43a5e216c3aba0c4d,
type: 3} type: 3}
...@@ -2386,8 +2386,8 @@ MonoBehaviour: ...@@ -2386,8 +2386,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 88224c51f1a97cf40895dff846d2a5b3, type: 3} m_Script: {fileID: 11500000, guid: 88224c51f1a97cf40895dff846d2a5b3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
foodNumber: 20 foodNumber: 100
timeSpan: 10 timeSpan: 2
foodPoint: foodPoint:
- {fileID: 1752813316} - {fileID: 1752813316}
- {fileID: 1547259537} - {fileID: 1547259537}
...@@ -6945,6 +6945,7 @@ GameObject: ...@@ -6945,6 +6945,7 @@ GameObject:
- component: {fileID: 557966604} - component: {fileID: 557966604}
- component: {fileID: 557966602} - component: {fileID: 557966602}
- component: {fileID: 557966603} - component: {fileID: 557966603}
- component: {fileID: 557966605}
m_Layer: 0 m_Layer: 0
m_Name: Boss m_Name: Boss
m_TagString: Boss m_TagString: Boss
...@@ -7015,7 +7016,7 @@ MonoBehaviour: ...@@ -7015,7 +7016,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
VSpeed: 10 VSpeed: 10
life: 30 life: 300
scale: 1 scale: 1
MinScale: 0.2 MinScale: 0.2
targetList: targetList:
...@@ -7025,9 +7026,27 @@ MonoBehaviour: ...@@ -7025,9 +7026,27 @@ MonoBehaviour:
MoveSpeed: 0 MoveSpeed: 0
BirthplacePos: {fileID: 225105685} BirthplacePos: {fileID: 225105685}
EnemyNumber: 0 EnemyNumber: 0
Timer1: 0 HurricaneKickDuration: 1.5
CurrentHurricaneKickDuration: 0
HurricaneKickCoolingTime: 5
CurrentHurricaneKickCoolingTime: 0
isDeltaTime: 0 isDeltaTime: 0
LegSweepDuration: 2
CurrentLegSweepDuration: 0
isDeltaTime2: 0
bossState: 0 bossState: 0
--- !u!114 &557966605
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 557966600}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 17ab4b61d0b362349828e661a3b978a3, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &560627449 stripped --- !u!4 &560627449 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: 5957448836295836418, guid: 15d49ef1e12d35a46b7c6fb953021b43, m_CorrespondingSourceObject: {fileID: 5957448836295836418, guid: 15d49ef1e12d35a46b7c6fb953021b43,
...@@ -18506,8 +18525,8 @@ MonoBehaviour: ...@@ -18506,8 +18525,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 88224c51f1a97cf40895dff846d2a5b3, type: 3} m_Script: {fileID: 11500000, guid: 88224c51f1a97cf40895dff846d2a5b3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
foodNumber: 20 foodNumber: 100
timeSpan: 10 timeSpan: 2
foodPoint: foodPoint:
- {fileID: 297527856} - {fileID: 297527856}
- {fileID: 1128247090} - {fileID: 1128247090}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum BossAnimationState
{
LegSweep=1,
HurricaneKick=2,
NotAttack=3
}
public class BossAnimationManager : MonoBehaviour
{
private Animator animator;
void Start()
{
animator = GetComponentInChildren<Animator>();
}
public void ChangeAnimatorState(BossAnimationState state)
{
print(gameObject.name + ",ChangeAnimatorState:" + state);
switch (state)
{
case BossAnimationState.LegSweep:
animator.SetBool("HurricaneKick", false);
animator.SetBool("LegSweep", true);
animator.SetFloat("MoveSpeed", 0);
break;
case BossAnimationState.HurricaneKick:
animator.SetBool("HurricaneKick", true);
animator.SetBool("LegSweep", false);
animator.SetFloat("MoveSpeed", 0) ;
break;
case BossAnimationState.NotAttack:
animator.SetBool("HurricaneKick", false);
animator.SetBool("LegSweep", false);
break;
default:
animator.SetBool("HurricaneKick", false);
animator.SetBool("LegSweep", false);
Debug.LogError(state);
break;
}
}
}
fileFormatVersion: 2
guid: 17ab4b61d0b362349828e661a3b978a3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -60,7 +60,7 @@ public class BossAttack : MonoBehaviour ...@@ -60,7 +60,7 @@ public class BossAttack : MonoBehaviour
public void ChangeAttackType(int i) public void ChangeAttackType(int i)
{ {
attackType = (AttackType)i; attackType = (AttackType)i;
//print("改变boss攻击状态为:"+attackType); print("改变boss攻击状态为:"+attackType);
} }
......
...@@ -104,10 +104,10 @@ public class PlayerMove : MonoBehaviour ...@@ -104,10 +104,10 @@ public class PlayerMove : MonoBehaviour
{ {
if (hit.gameObject== targetWall) if (hit.gameObject== targetWall)
{ {
print("Player碰到墙:"+ scale); //print("Player碰到墙:"+ scale);
if (scale>1) if (scale>1)
{ {
print("推墙"); //print("推墙");
hit.gameObject.GetComponent<Rigidbody>().AddForce(new Vector3(0, 0, 100)); hit.gameObject.GetComponent<Rigidbody>().AddForce(new Vector3(0, 0, 100));
scale -= reduceStep; scale -= reduceStep;
ReduceIsPlayChangeModeEffect(); ReduceIsPlayChangeModeEffect();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment