// Use this for initialization void Start() { rb = GetComponent <Rigidbody2D> (); stats = GetComponent <CharTraits> (); ogWalkSpeed = stats.walkspeed; ogJumpHeight = stats.jumpheight; // ogScale = gameObject.transform.localScale; buffSlide.maxValue = cooltime; buffSlide.value = 0.0f; }
// Use this for initialization void Start() { gameObject.tag = "Player 2"; FlipFacing(); anim = GetComponent <Animator> (); rb = GetComponent <Rigidbody2D> (); stats = GetComponent <CharTraits> (); maxSpeed = stats.walkspeed; jumpHeight = stats.jumpheight; projectile = stats.projectile; shieldSlider.maxValue = 5.0f; specialSlider.maxValue = 5.0f; specialSlider.value = specialSlider.maxValue; p1 = GameObject.FindGameObjectWithTag("Player 1"); if (p1 != null) { Debug.Log("p1 isn't null"); if (p1.gameObject.GetComponent <P1_MovementController> ().p2 == null) { Debug.Log("Trying to manually set p1 through p2"); p1.gameObject.GetComponent <P1_MovementController> ().p2 = gameObject; if (p1.gameObject.GetComponent <P1_MovementController> ().p2 == gameObject) { Debug.Log("Successfully set p1's reference to p2. Manually resetting p1's p2Health"); p1.gameObject.GetComponent <P1_MovementController> ().p2Health = gameObject.GetComponent <HealthHandler> (); } } p1Health = p1.GetComponent <HealthHandler> (); Debug.Log("p1 health is " + p1Health); } else { Debug.Log("p1 is null!"); } // TOTAL BULL SHIT WORK AROUND p1.GetComponent <P1_MovementController>().p2 = gameObject; foreach (Transform child in transform) { GameObject g = (GameObject)(child.gameObject); // Debug.Log ("Found game object " + g.name + " in P2"); g.tag = "Player 2 ext"; foreach (Transform grandchild in g.transform) { grandchild.gameObject.tag = "Player 2 ext"; } } }
// Use this for initialization void Start() { stats = GetComponent <CharTraits> (); curHP = 100; lastFrameHP = curHP; healthSlider.maxValue = maxHP; // Debug.Log ("Health slider for " + gameObject.name + " is " + healthSlider); fightUI = GameObject.FindGameObjectWithTag("GameHUD").GetComponent <Canvas>(); gameOverUI = GameObject.FindGameObjectWithTag("GameOverScreen").GetComponent <Canvas>(); gameOverText = GameObject.FindGameObjectWithTag("GameOverText").GetComponent <Text> (); }
// Use this for initialization void Start() { gameObject.tag = "Player 1"; anim = GetComponent <Animator> (); rb = GetComponent <Rigidbody2D> (); stats = GetComponent <CharTraits> (); maxSpeed = stats.walkspeed; jumpHeight = stats.jumpheight; projectile = stats.projectile; shieldSlider.maxValue = 5.0f; specialSlider.maxValue = 5.0f; specialSlider.value = specialSlider.maxValue; p2 = GameObject.FindGameObjectWithTag("Player 2"); if (p2 != null) { Debug.Log("p2 isn't null"); p2Health = p2.GetComponent <HealthHandler> (); Debug.Log("p2 health is " + p2Health); } else { Debug.Log("p2 is null!"); } //blockCoolDown = 0.0f; foreach (Transform child in transform) { GameObject g = (GameObject)(child.gameObject); // Debug.Log ("Found game object " + g.name + " in P1"); g.tag = "Player 1 ext"; foreach (Transform grandchild in g.transform) { grandchild.gameObject.tag = "Player 1 ext"; } } }
static CharExtensions() { CharTraits[] traitsArray = new CharTraits[0x80]; traitsArray[0] = CharTraits.ForceStartNewAssemblyNameSpecToken | CharTraits.ForceStartNewToken; traitsArray[9] = CharTraits.ForceStartNewAssemblyNameSpecToken | CharTraits.ForceStartNewToken | CharTraits.Whitespace; traitsArray[10] = CharTraits.ForceStartNewAssemblyNameSpecToken | CharTraits.ForceStartNewToken | CharTraits.Newline; traitsArray[11] = CharTraits.ForceStartNewAssemblyNameSpecToken | CharTraits.ForceStartNewToken | CharTraits.Whitespace; traitsArray[12] = CharTraits.ForceStartNewAssemblyNameSpecToken | CharTraits.ForceStartNewToken | CharTraits.Whitespace; traitsArray[13] = CharTraits.ForceStartNewAssemblyNameSpecToken | CharTraits.ForceStartNewToken | CharTraits.Newline; traitsArray[0x20] = CharTraits.ForceStartNewAssemblyNameSpecToken | CharTraits.ForceStartNewToken | CharTraits.Whitespace; traitsArray[0x21] = CharTraits.ForceStartNewTokenAfterNumber; traitsArray[0x23] = CharTraits.ForceStartNewTokenAfterNumber; traitsArray[0x24] = CharTraits.VarNameFirst; traitsArray[0x25] = CharTraits.ForceStartNewTokenAfterNumber; traitsArray[0x26] = CharTraits.ForceStartNewToken; traitsArray[40] = CharTraits.ForceStartNewToken; traitsArray[0x29] = CharTraits.ForceStartNewToken; traitsArray[0x2a] = CharTraits.ForceStartNewTokenAfterNumber; traitsArray[0x2b] = CharTraits.ForceStartNewTokenAfterNumber; traitsArray[0x2c] = CharTraits.ForceStartNewAssemblyNameSpecToken | CharTraits.ForceStartNewToken; traitsArray[0x2d] = CharTraits.ForceStartNewTokenAfterNumber; traitsArray[0x2e] = CharTraits.ForceStartNewTokenAfterNumber; traitsArray[0x2f] = CharTraits.ForceStartNewTokenAfterNumber; traitsArray[0x30] = CharTraits.VarNameFirst | CharTraits.Digit | CharTraits.HexDigit; traitsArray[0x31] = CharTraits.VarNameFirst | CharTraits.Digit | CharTraits.HexDigit; traitsArray[50] = CharTraits.VarNameFirst | CharTraits.Digit | CharTraits.HexDigit; traitsArray[0x33] = CharTraits.VarNameFirst | CharTraits.Digit | CharTraits.HexDigit; traitsArray[0x34] = CharTraits.VarNameFirst | CharTraits.Digit | CharTraits.HexDigit; traitsArray[0x35] = CharTraits.VarNameFirst | CharTraits.Digit | CharTraits.HexDigit; traitsArray[0x36] = CharTraits.VarNameFirst | CharTraits.Digit | CharTraits.HexDigit; traitsArray[0x37] = CharTraits.VarNameFirst | CharTraits.Digit | CharTraits.HexDigit; traitsArray[0x38] = CharTraits.VarNameFirst | CharTraits.Digit | CharTraits.HexDigit; traitsArray[0x39] = CharTraits.VarNameFirst | CharTraits.Digit | CharTraits.HexDigit; traitsArray[0x3a] = CharTraits.VarNameFirst; traitsArray[0x3b] = CharTraits.ForceStartNewToken; traitsArray[60] = CharTraits.ForceStartNewTokenAfterNumber; traitsArray[0x3d] = CharTraits.ForceStartNewTokenAfterNumber | CharTraits.ForceStartNewAssemblyNameSpecToken; traitsArray[0x3e] = CharTraits.ForceStartNewTokenAfterNumber; traitsArray[0x3f] = CharTraits.VarNameFirst; traitsArray[0x41] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.IdentifierStart; traitsArray[0x42] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.IdentifierStart; traitsArray[0x43] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.IdentifierStart; traitsArray[0x44] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.TypeSuffix | CharTraits.IdentifierStart; traitsArray[0x45] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.IdentifierStart; traitsArray[70] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.IdentifierStart; traitsArray[0x47] = CharTraits.VarNameFirst | CharTraits.MultiplierStart | CharTraits.IdentifierStart; traitsArray[0x48] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x49] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x4a] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x4b] = CharTraits.VarNameFirst | CharTraits.MultiplierStart | CharTraits.IdentifierStart; traitsArray[0x4c] = CharTraits.VarNameFirst | CharTraits.TypeSuffix | CharTraits.IdentifierStart; traitsArray[0x4d] = CharTraits.VarNameFirst | CharTraits.MultiplierStart | CharTraits.IdentifierStart; traitsArray[0x4e] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x4f] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[80] = CharTraits.VarNameFirst | CharTraits.MultiplierStart | CharTraits.IdentifierStart; traitsArray[0x51] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x52] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x53] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x54] = CharTraits.VarNameFirst | CharTraits.MultiplierStart | CharTraits.IdentifierStart; traitsArray[0x55] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x56] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x57] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x58] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x59] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[90] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x5d] = CharTraits.ForceStartNewTokenAfterNumber | CharTraits.ForceStartNewAssemblyNameSpecToken; traitsArray[0x5e] = CharTraits.VarNameFirst; traitsArray[0x5f] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x61] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.IdentifierStart; traitsArray[0x62] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.IdentifierStart; traitsArray[0x63] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.IdentifierStart; traitsArray[100] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.TypeSuffix | CharTraits.IdentifierStart; traitsArray[0x65] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.IdentifierStart; traitsArray[0x66] = CharTraits.VarNameFirst | CharTraits.HexDigit | CharTraits.IdentifierStart; traitsArray[0x67] = CharTraits.VarNameFirst | CharTraits.MultiplierStart | CharTraits.IdentifierStart; traitsArray[0x68] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x69] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x6a] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x6b] = CharTraits.VarNameFirst | CharTraits.MultiplierStart | CharTraits.IdentifierStart; traitsArray[0x6c] = CharTraits.VarNameFirst | CharTraits.TypeSuffix | CharTraits.IdentifierStart; traitsArray[0x6d] = CharTraits.VarNameFirst | CharTraits.MultiplierStart | CharTraits.IdentifierStart; traitsArray[110] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x6f] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x70] = CharTraits.VarNameFirst | CharTraits.MultiplierStart | CharTraits.IdentifierStart; traitsArray[0x71] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x72] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x73] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x74] = CharTraits.VarNameFirst | CharTraits.MultiplierStart | CharTraits.IdentifierStart; traitsArray[0x75] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x76] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x77] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[120] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x79] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x7a] = CharTraits.VarNameFirst | CharTraits.IdentifierStart; traitsArray[0x7b] = CharTraits.ForceStartNewToken; traitsArray[0x7c] = CharTraits.ForceStartNewToken; traitsArray[0x7d] = CharTraits.ForceStartNewToken; _traits = traitsArray; }