Ejemplo n.º 1
0
    private void Animation()
    {
        Animator animator = GetComponent <Animator>();
        AnimatorOverrideController aoc = new AnimatorOverrideController(animator.runtimeAnimatorController);

        AnimatorOverride.AnimationOverride("DefaultProjectiles", _projectilesData.Anim, aoc, animator);
    }
Ejemplo n.º 2
0
    private void SetAnimation(EnemyData enemyData, Animator animator)
    {
        AnimatorOverrideController aoc = new AnimatorOverrideController(animator.runtimeAnimatorController);

        AnimatorOverride.EnemyAnimationOverride("Walk", enemyData.Move, aoc, animator);
        AnimatorOverride.EnemyAnimationOverride("Idle", enemyData.Idle, aoc, animator);
        AnimatorOverride.EnemyAnimationOverride("Attack", enemyData.Attack, aoc, animator);
    }
Ejemplo n.º 3
0
    private void Initiate()
    {
        GetComponent <EdgeCollider2D>().points = _portalData.Col;

        AnimatorOverrideController aoc = new AnimatorOverrideController(_a.runtimeAnimatorController);

        AnimatorOverride.AnimationOverride("Default", _portalData.Animation, aoc, _a);
        _a.speed = 0.6f;
    }
Ejemplo n.º 4
0
    private void SetAnimation()
    {
        AnimatorOverrideController aoc = new AnimatorOverrideController(_a.runtimeAnimatorController);

        AnimatorOverride.AnimationOverride("DefaultMove", _playerData.Move, aoc, _a);
        AnimatorOverride.AnimationOverride("DefaultIdle", _playerData.Idle, aoc, _a);
        AnimatorOverride.AnimationOverride("DefaultAttack", _playerData.Attack, aoc, _a);
        AnimatorOverride.AnimationOverride("DefaultDash", _playerData.Dash, aoc, _a);
    }
Ejemplo n.º 5
0
        internal RuntimeAnimatorController GetController(Animator local)
        {
            AnimatorOverride animatorOverride = _animators.FirstOrDefault(o => o.animator == local);

            if (animatorOverride == null)
            {
                return(null);
            }
            return(animatorOverride.controllerOverride);
        }
Ejemplo n.º 6
0
    public void Initialise()
    {
        AnimatorOverrideController aoc = new AnimatorOverrideController(_a.runtimeAnimatorController);

        AnimatorOverride.AnimationOverride("Default", _simpleDecoration.Anim, aoc, _a);

        if (_simpleDecoration.AsCol)
        {
            gameObject.AddComponent <EdgeCollider2D>().points = _simpleDecoration.Col;
        }

        int mult = -10;

        if (_simpleDecoration.Behind)
        {
            mult = -12;
        }

        SpriteRenderer s = GetComponent <SpriteRenderer>();

        s.material     = _simpleDecoration.Material;
        s.sortingOrder = (int)((transform.parent.position.y + transform.position.y) * mult);

        if (_simpleDecoration.Color.Length != 0)
        {
            GameObject go = new GameObject("Light");
            go.transform.parent = transform;
            GameObject light = Instantiate(go, transform.position - new Vector3(0, 0, .5f), Quaternion.identity, go.transform);
            Light      o     = light.gameObject.AddComponent <Light>();

            o.color           = new Color(_simpleDecoration.Color[0], _simpleDecoration.Color[1], _simpleDecoration.Color[2]);
            o.intensity       = _simpleDecoration.Intensity;
            o.range           = _simpleDecoration.Range;
            o.bounceIntensity = 0;
            o.renderMode      = LightRenderMode.ForcePixel;
        }
    }
Ejemplo n.º 7
0
    private void SetAnimation()
    {
        AnimatorOverrideController aoc = new AnimatorOverrideController(_a.runtimeAnimatorController);

        AnimatorOverride.AnimationOverride("DefaultDashParticules", _playerData.DashParticles, aoc, _a);
    }