예제 #1
0
        // 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);
        }
예제 #2
0
파일: Arme.cs 프로젝트: corndl/Emergence
    /// <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);
    }
예제 #3
0
파일: Arme.cs 프로젝트: corndl/Emergence
 // 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>();
 }
예제 #4
0
파일: Arme.cs 프로젝트: corndl/Emergence
 // 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>();
 }
예제 #5
0
    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);
    }
예제 #6
0
파일: Arme.cs 프로젝트: corndl/Emergence
 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;
 }
예제 #7
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);
        }
예제 #8
0
파일: Arme.cs 프로젝트: corndl/Emergence
    /// <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);
    }
예제 #9
0
파일: Arme.cs 프로젝트: corndl/Emergence
 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;
 }