Ejemplo n.º 1
0
    public ModifyModel(GameObject fighter, bool mainScene = false)
    {
        this.target = fighter;

        if (this.target == null)
        {
            throw new Exception("No fighter selected");
        }

        this.mainScene = mainScene;
        this.animator  = this.target.GetComponent <Animator>();

        if (this.animator == null)
        {
            this.animator = this.target.AddComponent <Animator>();
        }

        this.controller = this.animator.runtimeAnimatorController as UnityEditor.Animations.AnimatorController;

        var names = this.target.name.Split('_');

        this.tid      = names[1];
        this.skeleton = names[0];
        this.config   = GameConfig.Get();

        this.modifyBox       = new ModifyBox(this);
        this.modifyAnimator  = new ModifyAnimator(this);
        this.modifyPrefab    = new ModifyPrefab(this);
        this.modifyAnimation = new ModifyAnimation(this);
        this.tag             = "Fighter";
        this.layer           = "Player";
    }
Ejemplo n.º 2
0
    public ModifyBarrel(GameObject target)
    {
        this.target       = target;
        this.modifyPrefab = new ModifyPrefab(this);

        this.animator   = this.target.GetComponent <Animator>() ?? this.target.AddComponent <Animator>();
        this.controller = this.animator.runtimeAnimatorController as UnityEditor.Animations.AnimatorController;
        this.tid        = target.name;
        this.config     = GameConfig.Get();
        this.tag        = "Barrel";
        this.layer      = "Barrel";

        this.modifyAnimator = new ModifyBarrelAnimator(this);
        this.modifyPrefab   = new ModifyPrefab(this);
    }