Example #1
0
        public static Skill Create(string name, string desc)
        {
            if (string.IsNullOrEmpty(desc))
            {
                return(null);
            }

            Skill skill = ScoreBonus.Create(name, desc);

            if (skill != null)
            {
                return(skill);
            }

            skill = ComboBonus.Create(name, desc);
            if (skill != null)
            {
                return(skill);
            }

            skill = JudgeEnhancement.Create(name, desc);
            if (skill != null)
            {
                return(skill);
            }

            skill = ComboContinuation.Create(name, desc);
            if (skill != null)
            {
                return(skill);
            }

            skill = Revival.Create(name, desc);
            if (skill != null)
            {
                return(skill);
            }

            skill = DamageGuard.Create(name, desc);
            if (skill != null)
            {
                return(skill);
            }

            skill = Overload.Create(name, desc);
            if (skill != null)
            {
                return(skill);
            }

            throw new FormatException("Unknown skill description: " + desc);
        }
    void Start()
    {
        // Get components
        rbtSyncBhvr = transform.parent.GetComponent<RobotSyncBehavior>();
        //animator = GetComponent<Animator>();
        health = transform.parent.GetComponent<Health>();
        maxDamage = health.MaxHealth / DamageScale;

        cmbBnus = transform.parent.GetComponent<ComboBonus>();

        // Robot Sync Initialization
        rbtSyncBhvr.ActionStarted += rb_ActionStarted;
        rbtSyncBhvr.ActionChanged += rb_ActionChanged;
        rbtSyncBhvr.ActionTerminated += rb_ActionTerminated;

        leftHand = transform.FindChild("Motion/B_Pelvis/B_Spine/B_Spine1/B_L_Clavicle/B_L_UpperArm/B_L_Forearm/B_L_Hand").gameObject;
        rightHand = transform.FindChild("Motion/B_Pelvis/B_Spine/B_Spine1/B_R_Clavicle/B_R_UpperArm/B_R_Forearm/B_R_Hand").gameObject;
        leftFoot = transform.FindChild("Motion/B_Pelvis/B_L_Thigh/B_L_Calf/B_L_Foot").gameObject;
        rightFoot = transform.FindChild("Motion/B_Pelvis/B_R_Thigh/B_R_Calf/B_R_Foot").gameObject;

        leftHand.GetComponent<HitBehavior>().ab = this;
        rightHand.GetComponent<HitBehavior>().ab = this;
        leftFoot.GetComponent<HitBehavior>().ab = this;
        rightFoot.GetComponent<HitBehavior>().ab = this;

        foreach (ActorBehavior actor in FindObjectsOfType<ActorBehavior>())
        {
            if (actor != this)
            {
                targetRobot = actor.transform;
                break;
            }
        }
    }