public void onChangePartII() { int val = -1; int.TryParse(partIIState.text, out val); if (val != -1) { characterLoader.playPart2Animation(charAnimator, currCharIndex, val); } }
/** * sets the parameter for the part's animation layer to be value given */ public void setPartLayerParam(int cCode, GameObject c, int partIndex, int value) { Animator a = c.GetComponent <Animator>(); switch (partIndex) { case 1: //part 1 characterLoader.playPart1Animation(a, cCode, value); break; case 2: //part 2 characterLoader.playPart2Animation(a, cCode, value); break; default: Debug.Log("unknown layer"); break; } }