|
@@ -1,18 +1,39 @@
|
|
|
using System.Collections;
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
|
|
|
+using UnityEngine.TextCore.Text;
|
|
|
|
|
|
|
|
public class SwordsControl : MonoBehaviour
|
|
public class SwordsControl : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
|
|
+ public enum SwordsControlState
|
|
|
|
|
+ {
|
|
|
|
|
+ Damage,
|
|
|
|
|
+ Scale,
|
|
|
|
|
+ All
|
|
|
|
|
+ }
|
|
|
public float intervalTime; //造成伤害的间隔时间
|
|
public float intervalTime; //造成伤害的间隔时间
|
|
|
- public int damage; //造成的伤害
|
|
|
|
|
|
|
+ public int boostNum;
|
|
|
public List<MoveCharacter> moveCharacrters = new List<MoveCharacter>(); //被造成伤害的角色
|
|
public List<MoveCharacter> moveCharacrters = new List<MoveCharacter>(); //被造成伤害的角色
|
|
|
public float totalTime; //多少时间后消失
|
|
public float totalTime; //多少时间后消失
|
|
|
[HideInInspector] public float time; //经过的时间
|
|
[HideInInspector] public float time; //经过的时间
|
|
|
public GameObject parent;
|
|
public GameObject parent;
|
|
|
public PlayerController owner;
|
|
public PlayerController owner;
|
|
|
public int conductId;
|
|
public int conductId;
|
|
|
-
|
|
|
|
|
|
|
+ [Header("伤害基数")]
|
|
|
|
|
+ public int damage;
|
|
|
|
|
+ [Header("范围基数")]
|
|
|
|
|
+ public float scale;
|
|
|
|
|
+ public SwordsControlState swordsControl;
|
|
|
|
|
+ public float[] stageSize;
|
|
|
|
|
+ public int[] demonicDieNum;
|
|
|
|
|
+ private void Start()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (swordsControl != SwordsControlState.Damage)
|
|
|
|
|
+ {
|
|
|
|
|
+ print(111111);
|
|
|
|
|
+ transform.parent.parent.localScale = Vector3.one * scale * TranSize(boostNum);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
private void Update()
|
|
private void Update()
|
|
|
{
|
|
{
|
|
|
time += Time.deltaTime;
|
|
time += Time.deltaTime;
|
|
@@ -34,7 +55,10 @@ public class SwordsControl : MonoBehaviour
|
|
|
moveCharacrters.Add(character);
|
|
moveCharacrters.Add(character);
|
|
|
character.sustainedInjuryTime = intervalTime;
|
|
character.sustainedInjuryTime = intervalTime;
|
|
|
character.sustainedInjury_IntervalTime = intervalTime;
|
|
character.sustainedInjury_IntervalTime = intervalTime;
|
|
|
- character.sustainedInjury_damage = damage;
|
|
|
|
|
|
|
+ if(swordsControl != SwordsControlState.Scale)
|
|
|
|
|
+ {
|
|
|
|
|
+ character.sustainedInjury_damage = damage * boostNum;
|
|
|
|
|
+ }
|
|
|
character.isSustainedInjury = true;
|
|
character.isSustainedInjury = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -64,4 +88,21 @@ public class SwordsControl : MonoBehaviour
|
|
|
moveCharacrters[i].isSustainedInjury = false;
|
|
moveCharacrters[i].isSustainedInjury = false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private float TranSize(int dieNum)
|
|
|
|
|
+ {
|
|
|
|
|
+ for (int i = stageSize.Length - 1; i >= 0; i--)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (dieNum >= demonicDieNum[i])
|
|
|
|
|
+ {
|
|
|
|
|
+ if (i == stageSize.Length - 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ return stageSize[i];
|
|
|
|
|
+ }
|
|
|
|
|
+ float size = stageSize[i] + (stageSize[i + 1] - stageSize[i]) / (demonicDieNum[i + 1] - demonicDieNum[i]) * (dieNum - demonicDieNum[i]);
|
|
|
|
|
+ return size;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|