// Use this for initialization
    void Start()
    {
        // Get ActorBehavior Script and gebing listening for events
        actBhvr = GetComponentInChildren<ActorBehavior>();
        actBhvr.DidGetHit += ActBhvr_DidGetHit; ;
        actBhvr.DidHit += ActBhvr_DidHit;

        // Get Robot Sunc Behavior
        RbtSync = GetComponent<RobotSyncBehavior>();

        // Get Input Scripts
        inputArray = GetComponents<InputManager>();

        // Get Mesh Material
        meshMaterial = meshObj.GetComponent<Renderer>().material;

        // Set Up diferent colors
        origMeshColor = meshMaterial.color;
        stunMeshColor = Color.yellow;
    }
    void Start()
    {
        robot = transform.parent.parent.GetComponent<RobotSyncBehavior>();
        if (robot)
        {
            numberOfPlayers = robot.NumberOfPlayers;
            robotID = robot.RobotID;
        }

        imageBtn = new Image[numberOfPlayers];
        imageMov = new Image[numberOfPlayers];
        imageBlk = new Image[numberOfPlayers];
        currentPress = new string[numberOfPlayers];
        animator = new Animator[numberOfPlayers];

        for (int i = 0; i < numberOfPlayers; i++)
        {
            GameObject playerPanel = transform.GetChild(i).gameObject;
            playerPanel.transform.FindChild("PxImg").GetComponent<Image>().sprite = sprites[11 + robot.PlayerID2JoystickID(i+1)];
            imageBtn[i] = playerPanel.transform.FindChild("BtnImg").GetComponent<Image>();
            imageMov[i] = playerPanel.transform.FindChild("MovImg").GetComponent<Image>();
            imageBlk[i] = playerPanel.transform.FindChild("BlkImg").GetComponent<Image>();
            animator[i] = playerPanel.GetComponent<Animator>();
            currentPress[i] = "";
        }

        //just in case
        for (int i = numberOfPlayers; i < 4; i++)
        {
            transform.GetChild(i).gameObject.SetActive(false);
            //To much trouble...
            //RectTransform t = (RectTransform) transform;
            //t.sizeDelta = new Vector2(t.rect.width - 120, t.rect.height);
        }
    }
    void Start()
    {
        // Initialize  variables dPAd Buttons
        lastX = 0;
        lastY = 0;
        // Get necessary components.
        RobotSyncScrpt = GetComponent<RobotSyncBehavior>();

        // Starts state is reading input;
        //isIgnoringInput = false;
    }
    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;
            }
        }
    }
    void Start()
    {
        rbs = GetComponent<RobotSyncBehavior>();
        rbs.ActionStarted += Rbs_ActionStarted;
        rbs.ActionChanged += Rbs_ActionChanged;
        rbs.ActionTerminated += Rbs_ActionTerminated;

        //animator = GetComponent<Animator>();
    }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        // Initialize Class Variables
        flashTime = 0.1f;
        isComboing = false;
        cmbCount = 0;
        cmbPitch = 0.8f;
        cmbDmgMult = 1.0f;
        cmbThreshold = 1.0f;

        // Get ActorBehavior Script and gebing listening for events
        actBhvr = GetComponentInChildren<ActorBehavior>();
        actBhvr.DidGetHit += ActBhvr_DidGetHit; ;
        actBhvr.DidHit += ActBhvr_DidHit;

        // Get Robot Sunc Behavior
        rbtSync = GetComponent<RobotSyncBehavior>();

        //Get the other robots HUD
        foreach (RobotSyncBehavior robot in GameObject.FindObjectsOfType<RobotSyncBehavior>())
        {
            if (robot != this.rbtSync)
            {
                otherHUD = robot.GetHUD();
                break;
            }
        }

        // Get Mesh Material
        meshMaterial = meshObj.GetComponent<Renderer>().material;
        // Set Up diferent colors
        origMeshColor = meshMaterial.color;
        dmgMeshColor = Color.red;
        blckMeshColor = Color.cyan;

        // Get Sound Player and sounds
        punchSndPlyr = GetComponent<AudioSource>();
        punchSndArray = Resources.LoadAll<AudioClip>("Sounds/");
    }