// FloatかVector2どちらかなので、両方探す public AfterEffectsInstance BindScale(Transform transform, string name) { var type = AfterEffectsCurveSet.ValueType.Float; int index = _resource.FindIndex(type, name); if (index < 0) { type = AfterEffectsCurveSet.ValueType.Vector2; index = _resource.FindIndex(type, name); } if (index >= 0) { if (_scaleCurves == null) { _scaleCurves = new List <TransformCurve>(8); } var curve = new TransformCurve(transform, index, type); _scaleCurves.Add(curve); } else { Debug.LogError(name + " not found in CurveSet"); } return(this); }
/// <summary> /// déclanche l'animation d'attaque. /// </summary> public virtual void Attack() { if (_isAttacking || _lastAttackTime + _cooldown > Time.time) { return; } Debug.Log("LastAttack : " + _lastAttackTime); foreach (var colli in _colliders) { colli.enabled = true; } TransformVector init = new TransformVector(transform.position, transform.rotation); TransformVector dest = new TransformVector(_normalTarget.position, _normalTarget.rotation); _transformCurve = new TransformCurve(init, Time.time, dest.Sub(init).Mult(-1).Sub(_transformCurve.GetSpeed(Time.time)), dest, Time.time + _timeAttack, dest.Sub(init).Mult(10), false); _isAttacking = true; TempCible = Instantiate(_normalTarget.gameObject); TempCible.transform.position = _normalTarget.position; TempCible.transform.rotation = _normalTarget.rotation; TempCible.GetComponentInChildren <SpriteRenderer>().color = CibleColor; TempCible.transform.SetParent(null, true); Destroy(TempCible, _timeAttack); }
// Use this for initialization protected virtual void Start() { _AudioSource = GetComponent<AudioSource>(); _colliders = GetComponentsInChildren<Collider>(); _zeroTransformVector = new TransformVector(); _initialTransformVector = new TransformVector(transform.localPosition,transform.localRotation); _transformCurve = new TransformCurve(_initialTransformVector, Time.time, _zeroTransformVector, _initialTransformVector, Time.time, _zeroTransformVector); BugManager = FindObjectOfType<BugManager>(); }
// Use this for initialization protected virtual void Start() { _AudioSource = GetComponent <AudioSource>(); _colliders = GetComponentsInChildren <Collider>(); _zeroTransformVector = new TransformVector(); _initialTransformVector = new TransformVector(transform.localPosition, transform.localRotation); _transformCurve = new TransformCurve(_initialTransformVector, Time.time, _zeroTransformVector, _initialTransformVector, Time.time, _zeroTransformVector); BugManager = FindObjectOfType <BugManager>(); }
private TransformCurve[] CreateTransformCurves(IKLimb[] iks) { Transform[] transforms = GetIKinfluencedTransforms(iks); Transform root = this.transform; TransformCurve[] tCurves = new TransformCurve[transforms.Length]; for (int i = 0; i < transforms.Length; i++) { tCurves[i] = new TransformCurve(root, transforms[i]); } return(tCurves); }
protected virtual void _StopAttack() { if (_isAttacking) { foreach (var colli in _colliders) { colli.enabled = false; } _transformCurve = new TransformCurve(new TransformVector(transform.localPosition, transform.localRotation), Time.time, _zeroTransformVector, _initialTransformVector, Time.time + _timeAttack, _zeroTransformVector); _lastAttackTime = Time.time; } _isAttacking = false; _nbKill = 0; }
public AfterEffectsInstance BindRotation(Transform transform, string name) { int index = _resource.FindIndex(AfterEffectsCurveSet.ValueType.Float, name); if (index >= 0) { if (_rotationCurves == null) { _rotationCurves = new List <TransformCurve>(8); } var curve = new TransformCurve(transform, index); _rotationCurves.Add(curve); } else { Debug.LogError(name + " not found in CurveSet"); } return(this); }
/// <summary> /// déclanche l'animation d'attaque. /// </summary> public virtual void Attack() { if (_isAttacking || _lastAttackTime + _cooldown >Time.time) return; Debug.Log("LastAttack : " + _lastAttackTime); foreach (var colli in _colliders) { colli.enabled = true; } TransformVector init = new TransformVector(transform.position,transform.rotation); TransformVector dest = new TransformVector(_normalTarget.position, _normalTarget.rotation); _transformCurve = new TransformCurve(init, Time.time, dest.Sub(init).Mult(-1).Sub(_transformCurve.GetSpeed(Time.time)), dest, Time.time + _timeAttack, dest.Sub(init).Mult(10),false); _isAttacking = true; TempCible = Instantiate(_normalTarget.gameObject); TempCible.transform.position = _normalTarget.position; TempCible.transform.rotation = _normalTarget.rotation; TempCible.GetComponentInChildren<SpriteRenderer>().color = CibleColor; TempCible.transform.SetParent(null,true); Destroy(TempCible,_timeAttack); }