dev/bolas #11
@ -152,7 +152,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 531d7966d86bd0c4d83baf58bcb56cd5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_entityLinked: {fileID: 5530763025372097863}
|
||||
_entityLinked: {fileID: 814896672592409367}
|
||||
--- !u!1 &1167891119861249516
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -499,7 +499,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7468362030574254172}
|
||||
- component: {fileID: 5530763025372097863}
|
||||
- component: {fileID: 814896672592409367}
|
||||
- component: {fileID: 7802907299062813180}
|
||||
- component: {fileID: 1182150014477180862}
|
||||
- component: {fileID: 5931428661698025033}
|
||||
@ -530,7 +530,7 @@ Transform:
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &5530763025372097863
|
||||
--- !u!114 &814896672592409367
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@ -539,7 +539,7 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 7468362030574254173}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 20821ed53f7f53e4cbdc7b3157c35b97, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: 4efc1afdf7c559a4cac25dad0d8917cb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_lifeBar: {fileID: 9115548409632460044}
|
||||
@ -1963,7 +1963,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c0fbd934c179894458914437255781c4, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_entity: {fileID: 5530763025372097863}
|
||||
_entity: {fileID: 814896672592409367}
|
||||
_projectile: {fileID: 6962989255644195630, guid: 3df5eaab2a4c1d64bba590ed4e1ac0f7, type: 3}
|
||||
_projectileSpawn: {fileID: 7322466304790414952}
|
||||
--- !u!1 &9107841294774877216
|
||||
|
||||
@ -73,6 +73,7 @@ MonoBehaviour:
|
||||
_angle: 0
|
||||
_speed: 2
|
||||
_slowIntensity: 0.25
|
||||
_slowDuration: 10
|
||||
--- !u!1 &6962989256011107503
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Bolas : Ally
|
||||
{
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (IsEnemyDetected)
|
||||
{
|
||||
AttackEnemy();
|
||||
}
|
||||
}
|
||||
|
||||
void AttackEnemy()
|
||||
{
|
||||
//Attack Cooldown
|
||||
if (AttackInterval < AttackSpeedWait)
|
||||
{
|
||||
Animation.PlayAttackAnim();
|
||||
AttackSpeedWait = 0f;
|
||||
}
|
||||
AttackSpeedWait += Time.deltaTime;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20821ed53f7f53e4cbdc7b3157c35b97
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -134,6 +134,7 @@ public class Projectile : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// applies effects on hit
|
||||
protected virtual void ApplyEffects() { }
|
||||
|
||||
//Getter and Setter
|
||||
|
||||
@ -6,6 +6,7 @@ public class BolasProjectile : Projectile
|
||||
{
|
||||
[SerializeField]
|
||||
private float _slowIntensity = 0.25f;
|
||||
[SerializeField]
|
||||
private float _slowDuration = 5f;
|
||||
|
||||
protected override void ApplyEffects()
|
||||
|
||||
@ -8,13 +8,19 @@ public class Slow : Status
|
||||
|
||||
public override void Apply(float duration)
|
||||
{
|
||||
// reset slow duration
|
||||
_duration += duration;
|
||||
|
||||
// slow entity
|
||||
EntityLinked.SpeedStatusModifier *= _speedModifier;
|
||||
}
|
||||
|
||||
public override void Unapply()
|
||||
{
|
||||
// bring entity to normal speed
|
||||
EntityLinked.SpeedStatusModifier /= _speedModifier;
|
||||
|
||||
// stop effect
|
||||
Destroy(this);
|
||||
}
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ public abstract class Status : MonoBehaviour
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
// effect timer
|
||||
_duration -= Time.deltaTime;
|
||||
if ( _duration < 0 ) Unapply();
|
||||
}
|
||||
|
||||
@ -9,8 +9,13 @@ public class StatusHandler : MonoBehaviour
|
||||
|
||||
public void ApplySlow(float intensity, float duration)
|
||||
{
|
||||
// check if effect already applied
|
||||
Slow slow = (Slow)GetStatus(Enum.StatusType.Slow);
|
||||
|
||||
// init effect params
|
||||
slow.Intensity = intensity;
|
||||
|
||||
// apply effect
|
||||
slow.Apply(duration);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user