Esempio n. 1
0
 public CharacterDebugInfo(CharacterDebugInfo other)
 {
     this.toggle          = other.toggle;
     this.currentMove     = other.currentMove;
     this.position        = other.position;
     this.lifePoints      = other.lifePoints;
     this.currentState    = other.currentState;
     this.currentSubState = other.currentSubState;
     this.stunTime        = other.stunTime;
     this.comboHits       = other.comboHits;
     this.comboDamage     = other.comboDamage;
     this.inputs          = other.inputs;
     this.buttonSequence  = other.buttonSequence;
     this.aiWeightList    = other.aiWeightList;
 }
Esempio n. 2
0
    void Start()
    {
        if (gameObject.name == "Player1") {
            transform.position = new Vector3(UFE.config.roundOptions.p1XPosition, .009f, 0);
            opponent = GameObject.Find("Player2");
            if (UFE.config.player1Character == null)
                Debug.LogError("Player 1 character not found! Make sure you have set the characters correctly in the Global Editor");

            myInfo = (CharacterInfo) Instantiate(UFE.config.player1Character);
            UFE.config.player1Character = myInfo;

            debugger = UFE.debugger1;
            mirror = -1;
            playerNum = 1;

            inputController = UFE.GetPlayer1Controller();
            debugInfo = UFE.config.debugOptions.p1DebugInfo;
        }else{
            transform.position = new Vector3(UFE.config.roundOptions.p2XPosition, .009f, 0);
            opponent = GameObject.Find("Player1");
            if (UFE.config.player2Character == null)
                Debug.LogError("Player 2 character not found! Make sure you have set the characters correctly in the Global Editor");

            myInfo = (CharacterInfo) Instantiate(UFE.config.player2Character);
            UFE.config.player2Character = myInfo;

            debugger = UFE.debugger2;
            mirror = 1;
            playerNum = 2;

            inputController = UFE.GetPlayer2Controller();
            debugInfo = UFE.config.debugOptions.p2DebugInfo;
        }

        myInfo.currentLifePoints = (float)myInfo.lifePoints;

        if (myInfo.characterPrefab == null)
            Debug.LogError("Character prefab for "+ gameObject.name +" not found. Make sure you have selected a prefab character in the Character Editor");

        character = (GameObject) Instantiate(myInfo.characterPrefab);
        character.transform.parent = transform;
        character.AddComponent<MoveSetScript>();

        standardYRotation = character.transform.rotation.eulerAngles.y;

        myPhysicsScript = GetComponent<PhysicsScript>();
        myMoveSetScript = character.GetComponent<MoveSetScript>();
        myHitBoxesScript = character.GetComponent<HitBoxesScript>();
        cameraScript = transform.parent.GetComponent<CameraScript>();

        myHitBoxesScript.controlsScript = this;

        if (myInfo.headLook.enabled){
            character.AddComponent<HeadLookScript>();
            headLookScript = character.GetComponent<HeadLookScript>();
            headLookScript.segments = myInfo.headLook.segments;
            headLookScript.nonAffectedJoints = myInfo.headLook.nonAffectedJoints;
            headLookScript.effect = myInfo.headLook.effect;
            headLookScript.overrideAnimation = !myInfo.headLook.overrideAnimation;

            foreach(BendingSegment segment in headLookScript.segments) {
                segment.firstTransform = myHitBoxesScript.GetTransform(segment.bodyPart).parent.transform;
                segment.lastTransform = myHitBoxesScript.GetTransform(segment.bodyPart);
            }

            foreach(NonAffectedJoints nonAffectedJoint in headLookScript.nonAffectedJoints)
                nonAffectedJoint.joint = myHitBoxesScript.GetTransform(nonAffectedJoint.bodyPart);
        }

        if (gameObject.name == "Player2") {
            testCharacterRotation(100, true);
            UFE.FireGameBegins();
        }

        if (UFE.config.roundOptions.allowMovement) {
            UFE.config.lockMovements = false;
        }else{
            UFE.config.lockMovements = true;
        }
    }